Bug 61956 - problem linking cilk on RHEL4
Summary: problem linking cilk on RHEL4
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 69582
  Show dependency treegraph
 
Reported: 2014-07-29 16:35 UTC by Bruce Adams
Modified: 2017-12-04 10:55 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce Adams 2014-07-29 16:35:40 UTC
Following on from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61955
I tried compiling gcc4.9 on RHEL4 using configure --disable-libsanitizer.
It progresses the build which subsequently fails when linking cilk.
Building worked with the previous version gcc 4.8.1

brucea@:development/brucea/gcc>lsb_release -a
LSB Version:	:core-3.0-amd64:core-3.0-ia32:core-3.0-noarch:graphics-3.0-amd64:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID:	RedHatEnterpriseES
Description:	Red Hat Enterprise Linux ES release 4 (Nahant Update 5)
Release:	4
Codename:	NahantUpdate5

brucea@:development/brucea/gcc>uname -a
Linux uktnswg-tvdev01.tnsad.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

Build using configure/make/install for each of the following in turn
gmp-5.0.2.tar.bz2
mpfr-3.1.0.tar.bz2
mpc-0.9.tar.gz
gcc-4.9.0.tar.bz2   or gcc-4.9.1.tar.bz2

Output:

libtool: link:  /development/brucea/gcc/build/./gcc/xg++ -B/development/brucea/gcc/build/./gcc/ -nostdinc++ -nostdinc++ -I/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/include -I/development/brucea/gcc/gcc-4.9.1/libstdc++-v3/libsupc++ -I/development/brucea/gcc/gcc-4.9.1/libstdc++-v3/include/backward -I/development/brucea/gcc/gcc-4.9.1/libstdc++-v3/testsuite/util -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/home/brucea/gcc4.9.1/x86_64-unknown-linux-gnu/bin/ -B/home/brucea/gcc4.9.1/x86_64-unknown-linux-gnu/lib/ -isystem /home/brucea/gcc4.9.1/x86_64-unknown-linux-gnu/include -isystem /home/brucea/gcc4.9.1/x86_64-unknown-linux-gnu/sys-include    -shared -nostdlib /usr/lib/../lib64/crti.o /development/brucea/gcc/build/./gcc/crtbeginS.o  .libs/cilk-abi-vla.o .libs/os-unix-sysdep.o .libs/bug.o .libs/cilk-abi.o .libs/cilk-abi-cilk-for.o .libs/cilk-abi-vla-internal.o .libs/cilk_api.o .libs/cilk_fiber.o .libs/cilk_fiber-unix.o .libs/cilk_malloc.o .libs/c_reducers.o .libs/except-gcc.o .libs/frame_malloc.o .libs/full_frame.o .libs/global_state.o .libs/jmpbuf.o .libs/local_state.o .libs/metacall_impl.o .libs/os_mutex-unix.o .libs/os-unix.o .libs/pedigrees.o .libs/record-replay.o .libs/reducer_impl.o .libs/scheduler.o .libs/signal_node.o .libs/spin_mutex.o .libs/stats.o .libs/symbol_test.o .libs/sysdep-unix.o .libs/worker_mutex.o   -Wl,-rpath -Wl,/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -Wl,-rpath -Wl,/home/brucea/gcc4.9.1/lib/../lib64 -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -lpthread -ldl -L/development/brucea/gcc/build/./gcc -L/lib/../lib64 -L/usr/lib/../lib64 /development/brucea/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so -lm -lc -lgcc_s /development/brucea/gcc/build/./gcc/crtendS.o /usr/lib/../lib64/crtn.o  -Wl,--version-script -Wl,../../../gcc-4.9.1/libcilkrts/runtime/linux-symbols.ver   -Wl,-soname -Wl,libcilkrts.so.5 -o .libs/libcilkrts.so.5.0.0
/usr/bin/ld: .libs/cilk-abi.o: relocation R_X86_64_PC32 against `__cilkrts_get_tls_worker' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libcilkrts.la] Error 1
make[2]: Leaving directory `/development/brucea/gcc/build/x86_64-unknown-linux-gnu/libcilkrts'
make[1]: *** [install-target-libcilkrts] Error 2
make[1]: Leaving directory `/development/brucea/gcc/build'
make: *** [install] Error 2
Command exited with non-zero status 2
Comment 1 Andrew Pinski 2014-07-29 16:43:17 UTC
Can you try a newer binutils?
Comment 2 Bruce Adams 2014-08-22 20:46:21 UTC
I have tried using a newer binutils (2.24) either installed before attempting to build gcc or in a combined tree build.

The combined tree build complains that binutils/bfd is already configured when I run make bootstrap.

mkdir -p -- ./bfd
Configuring in ./bfd
configure: creating cache ./config.cache
[snip]
checking for style of include used by make... GNU
configure: error: source directory already configured; run "make distclean" there first
make[4]: *** [configure-bfd] Error 1
make[4]: Leaving directory `/development/brucea/gcc/build/binutils'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/development/brucea/gcc/build/binutils'
make[2]: *** [all-stage1-binutils] Error 2
make[2]: Leaving directory `/development/brucea/gcc/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/development/brucea/gcc/build'
make: *** [bootstrap] Error 2

However, running configure using --disable-libcilkrts (in addition to the already required   --disable-libsanitiser ) which is not documented results in a useable gcc 4.9.1 (with c++ working but presumably cilk++ broken).
Comment 3 Paolo Carlini 2017-12-04 10:55:10 UTC
Cilk Plus, deprecated for 7.x, will not be in 8.x.