Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fPIC issues: dies building binutils #4

Open
justincormack opened this issue Jul 2, 2012 · 2 comments
Open

fPIC issues: dies building binutils #4

justincormack opened this issue Jul 2, 2012 · 2 comments

Comments

@justincormack
Copy link

Trying to build from git head (on Ubuntu 12.04 x86_64) I get...

make[4]: Entering directory `/home/justin/musl/bootstrap-linux/work/binutils-2.22/ld'
/bin/bash ./libtool  --tag=CC   --mode=compile x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I.  -I. -I. -I../bfd -I./../bfd -I./../include  -Os -DENABLE_PLUGINS -DLOCALEDIR="\"//share/locale\""  -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c -o libldtestplug_la-testplug.lo `test -f 'testplug.c' || echo './'`testplug.c
libtool: compile:  x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -Os -DENABLE_PLUGINS -DLOCALEDIR=\"//share/locale\" -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c testplug.c  -fPIC -DPIC -o .libs/libldtestplug_la-testplug.o
libtool: compile:  x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -Os -DENABLE_PLUGINS -DLOCALEDIR=\"//share/locale\" -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c testplug.c -o libldtestplug_la-testplug.o >/dev/null 2>&1
mv -f .deps/libldtestplug_la-testplug.Tpo .deps/libldtestplug_la-testplug.Plo
/bin/bash ./libtool --tag=CC   --mode=link x86_64-unknown-linux-musl-gcc -g -O2 -Os -no-undefined -rpath /nowhere -s -o libldtestplug.la  libldtestplug_la-testplug.lo  
libtool: link: x86_64-unknown-linux-musl-gcc -shared  .libs/libldtestplug_la-testplug.o      -Wl,-soname -Wl,libldtestplug.so.0 -o .libs/libldtestplug.so.0.0.0
/home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/bin/ld: /home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/lib/libc.a(lite_malloc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/lib/libc.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [libldtestplug.la] Error 1

Doing export CFLAGS=-fPIC and adding -fPIC in the CFLAGS in bootstrap.sh seems to fix it so far, if anyone else having this issue.

@justincormack
Copy link
Author

Aargh! still getting the same problem, something not built with -fPIC. I hate libtool.

/bin/bash ./libtool --tag=CC --tag=disable-static  --mode=link x86_64-unknown-linux-musl-gcc -Wall -Os -fPIC  -module -bindir //libexec/gcc/x86_64-unknown-linux-musl/4.6.3  -s -o liblto_plugin.la -rpath //libexec/gcc/x86_64-unknown-linux-musl/4.6.3 lto-plugin.lo -Wc,../libiberty/pic/libiberty.a 
libtool: link: x86_64-unknown-linux-musl-gcc -shared  .libs/lto-plugin.o    ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,liblto_plugin.so.0 -o .libs/liblto_plugin.so.0.0.0
/home/justin/musl/bootstrap-2/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/bin/ld: /home/justin/musl/bootstrap-2/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/lib/libc.a(vfork.o): relocation R_X86_64_PC32 against symbol `__syscall_ret' can not be used when making a shared object; recompile with -fPIC
/home/justin/musl/bootstrap-2/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

@rofl0r
Copy link
Contributor

rofl0r commented Jul 17, 2012

according to the README the authors intention was to build everything statically
so the real bug is not a lack of fpic, but that something wants to build shared stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants