[Bug target/64237] [5 Regression] glibc build failure

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 9 14:28:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64237

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #0)
> trippels@gcc20 nscd % cat nscd.i
> extern int program_invocation_name;
> extern void fn2(int, int);
> void
> fn1() { fn2(0, program_invocation_name); }
> 
> trippels@gcc20 nscd % gcc -shared nscd.i -fpie
> /home/trippels/bin/ld: /home/trippels/tmp/ccoI5Lbg.o: relocation
> R_X86_64_PC32 against undefined symbol
> `program_invocation_name@@GLIBC_2.2.5' can not be used when making a shared
> object; recompile with -fPIC
> /home/trippels/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status

If you use -fpie, you should use -pie.
If you use -shared, you should use -fpic.



More information about the Gcc-bugs mailing list