Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 420899 - dev-libs/libgcrypt uses ugly inlining gcc hacks and doesn't compile with clang
Summary: dev-libs/libgcrypt uses ugly inlining gcc hacks and doesn't compile with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
URL: https://bugs.g10code.com/gnupg/issue1406
Whiteboard:
Keywords: Bug, PATCH
Depends on:
Blocks: 297436 freebsd-clang-3.1
  Show dependency tree
 
Reported: 2012-06-12 21:40 UTC by Michał Górny
Modified: 2013-06-01 19:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The build log (20120612-203115.log,62.58 KB, text/plain)
2012-06-12 21:40 UTC, Michał Górny
Details
Suggested patch (0001-Fix-use-of-inline-to-avoid-multiple-declarations.patch,2.48 KB, patch)
2012-06-12 21:40 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-12 21:40:30 UTC
Created attachment 315143 [details]
The build log

Long story short: upstream first declares regular prototypes for functions, then 'extern __inline__' ones which simply doesn't conform to any kind of C standard I can think of, and it's a miracle gcc eats this somehow.

I'll attach patch which seems to be the best course of action. It removes the pointless 'extern', and uses 'inline' in both the prototype and the declaration. This is the correct way of doing that, and should work both with and without the inline bodys. Also, configure uses AC_C_INLINE, so no reason to use __inline__.

I wanted to report this directly to upstream but I'm still waiting for the registration e-mail.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-12 21:40:56 UTC
Created attachment 315147 [details, diff]
Suggested patch
Comment 2 Richard Yao (RETIRED) gentoo-dev 2012-06-13 19:39:11 UTC
This patch enables us to build with Clang, but it causes a build failure when we build with GCC.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-13 20:23:35 UTC
Comment on attachment 315147 [details, diff]
Suggested patch

Then the only solution I see is appending '-std=gnu89' to CFLAGS.
Comment 4 Johan Bergström 2012-12-05 04:59:00 UTC
Just stumbled in here. Seems like upstream states that it's fixed. Mgorny?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-05 08:56:36 UTC
(In reply to comment #4)
> Just stumbled in here. Seems like upstream states that it's fixed. Mgorny?

I can reproduce it with 1.5.0-r4 but maybe upstream referred to a newer version.
Comment 6 Dan Johnson 2013-05-29 21:33:47 UTC
I too have just stumbled across this bug

> I can reproduce it with 1.5.0-r4 but maybe upstream referred to a newer version.

Apparently so; libgcrypt-1.5.2 seems to build fine with clang-3.2 (and passes tests)

So this bug can probably be closed.
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2013-06-01 19:27:07 UTC
closing pre comment#6.