Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 498640 - >=dev-lang/python-3.3.0 with <sys-devel/gcc-4.3 - ld: .../work/Python-3.3.3/Modules/_decimal/libmpdec/basearith.o: relocation R_X86_64_PC32 against symbol `mprime_rdx' can not be used when making a shared object; recompile with -fPIC
Summary: >=dev-lang/python-3.3.0 with <sys-devel/gcc-4.3 - ld: .../work/Python-3.3.3/M...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: http://bugs.python.org/issue20324
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-19 23:42 UTC by Ruud Koolen (RETIRED)
Modified: 2017-08-12 20:25 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,135.82 KB, text/plain)
2014-01-19 23:42 UTC, Ruud Koolen (RETIRED)
Details
emerge --info (emerge-info.log,4.14 KB, text/plain)
2014-01-20 04:46 UTC, Ruud Koolen (RETIRED)
Details
Proposed patch. (decimal-gcc-4.2-constant-visibility.patch,508 bytes, patch)
2014-01-20 21:34 UTC, Ruud Koolen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruud Koolen (RETIRED) archtester gentoo-dev Security 2014-01-19 23:42:34 UTC
Created attachment 368198 [details]
build.log

When building python >= 3.3 with gcc older than 4.3, the _decimal module fails to build due to an apparently PIC-related link error:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/bin/ld: build/temp.linux-x86_64-3.3/var/tmp/portage/dev-lang/python-3.3.3/work/Python-3.3.3/Modules/_decimal/libmpdec/mpdecimal.o: warning: relocation against `mprime_rdx' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/bin/ld: build/temp.linux-x86_64-3.3/var/tmp/portage/dev-lang/python-3.3.3/work/Python-3.3.3/Modules/_decimal/libmpdec/basearith.o: relocation R_X86_64_PC32 against symbol `mprime_rdx' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value

I am not sure whether or not this bug is specific to amd64.

In gcc, declaring this variable as __attribute__((visibility("hidden"))) seems to solve the problem.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-01-20 01:35:08 UTC
Comment on attachment 368198 [details]
build.log

Please post your `emerge --info' output in a comment.
Comment 2 Ruud Koolen (RETIRED) archtester gentoo-dev Security 2014-01-20 04:46:21 UTC
Created attachment 368214 [details]
emerge --info
Comment 3 Ruud Koolen (RETIRED) archtester gentoo-dev Security 2014-01-20 21:34:34 UTC
Created attachment 368290 [details, diff]
Proposed patch.
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2014-01-21 08:22:05 UTC
I filed an upstream bug, let's see what they say.
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2014-01-21 16:23:15 UTC
CPython upstream says it's a compiler bug. Since the compiler is no longer being maintained, it should be fixed on our end if we still support gcc-4.2:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46861#c3
Comment 6 Dirkjan Ochtman (RETIRED) gentoo-dev 2014-01-21 16:24:46 UTC
By which I mean, in our compiler.
Comment 7 SpanKY gentoo-dev 2014-01-21 16:51:23 UTC
there doesn't appear to be any commits pointed out in the PR that fixes the issue.  i would just update the python ebuild to die when the current gcc version is older than 4.3.

there's really no reason to be using older than 4.3 in Gentoo as your main compiler anymore ...
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2017-08-12 20:25:19 UTC
(In reply to SpanKY from comment #7)
> there's really no reason to be using older than 4.3 in Gentoo as your main
> compiler anymore ...

Right so.