Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 536894 - dev-libs/gmp-6.0.0a fails to compile with gcc-4.0.1
Summary: dev-libs/gmp-6.0.0a fails to compile with gcc-4.0.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal
Assignee: Gentoo Prefix
URL: https://trac.macports.org/ticket/16634
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-17 20:09 UTC by Michael Weiser
Modified: 2016-05-01 11:59 UTC (History)
0 users

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


Attachments
fix inlining with (apple) gcc 4.0.1 (fix-inlining-with-gcc-4.0.1.diff,979 bytes, patch)
2015-01-17 20:10 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2015-01-17 20:09:02 UTC
During bootstrap on OS X 10.5, when the system's gcc-4.0.1 is still in use, gmp-6.0.0a fails to link:

ld: duplicate symbol ___gmpz_abs in .libs/compat.o and .libs/assert.o

This is due to the fact that gmp.h tries to use __attribute__(__gnu_inline__) to force GNU inlining behaviour if the compiler might also use C99 inlining rules. gcc-4.0.1 doesn't understand that attribute and ends up ignoring all inlining directives altogether:

In file included from add.c:33:
../gmp.h:1703: warning: '__gnu_inline__' attribute directive ignored
[repeated 17 times]

This makes all inline function declarations end up being global and repeated in every file that includes gmp.h.

Reproducible: Always
Comment 1 Michael Weiser 2015-01-17 20:10:28 UTC
Created attachment 394212 [details, diff]
fix inlining with (apple) gcc 4.0.1

This patch, derived from the linked MacPorts fix, placed in "${FILESDIR}"/6.0.0a of the ebuild fixes the problem for me.
Comment 2 Fabian Groffen gentoo-dev 2016-04-16 06:39:19 UTC
need to check if this is still necessary for 6.0.1
Comment 3 Brandon George 2016-04-27 12:29:04 UTC
I can confirm that this is still a bug on PPC Mac OS X (10.5.8).  The patch supplied by Michael Weiser fixed the compile problem, but I haven't tested the library for proper function yet.
Comment 4 Fabian Groffen gentoo-dev 2016-05-01 11:59:26 UTC
I pushed the fix.