9.0.030 bad interaction with binutils 2.15.92.0.2

9.0.030 bad interaction with binutils 2.15.92.0.2

nikkoara's picture




I am posting this as a reference to others who may run into the same problem: runaway linking (process does not end) when using the stock binutils on Slackware 10.





I run Slackware 10 on dual Xeon EM64T machine w/ 32 bit kernel:





tmp$ uname -a


Linux skynet 2.6.14.5 #3 SMP PREEMPT Mon Jan 9 13:59:21 MST 2006 i686 unknown unknown GNU/Linux


tmp$ gcc -v


Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs


Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux


Thread model: posix


gcc version 3.3.4


tmp$ ld -v


GNU ld version 2.15.92.0.2 20040927





I installed Intel 9.0.030 in /opt/... using "rpm -i --force --nodeps" and I then sed'ed the "INSTALLDIR".





I compiled and attempted to link the product I am maintaining (C++ library).





I used compile time options:





$ icpc -cxxlib-gcc -fPIC -g -w1 -IMYINCLUDES -c foo.cpp





And linking options:





icpc -cxxlib-gcc -LMYLIBDIR -shared -o mylib.so foo.o ...





The linking phase does not end - I waited as much as 15 minutes.





tmp$ ps -dafe


........


nicoara 29536 29535 0 09:17 pts/1 00:00:00 /opt/compilers/icc-9.0/bin/icpc -cxx...


nicoara 29537 29536 0 09:17 pts/1 00:00:00 /opt/compilers/icc-9.0/bin/icpc -cxx...


nicoara 29538 29537 0 09:17 pts/1 00:00:00 /opt/compilers/icc-9.0/bin/icpc -cxx...


nicoara 29544 29536 99 09:17 pts/1 00:00:26 ld /usr/lib/gcc-lib/i486-slackware-l...





tmp$ strace -p 29538


Process 29538 attached - interrupt to quit


setup(


Ctrl-C to interrupt...



Process 29538 detached





I strace'd 29538 because that is the process which launched the GNU linker.





strace'ing the GNU linker shows it's spinning doing something I don't understand - here's a snippet of its work:





..............


open("foo.o", O_RDONLY) = 3


fstat64(3, {st_mode=S_IFREG|0644, st_size=266196, ...}) = 0


old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40021000


_llseek(3, 192512, [192512], SEEK_SET) = 0


read(3, "H221f276L2|221.276"..., 1352) = 1352


_llseek(3, 143360, [143360], SEEK_SET) = 0


read(3, "1201*1"..., 4096) = 4096


read(3, "326321625004
22110"..., 45056) = 45056


read(3, "H221f276L2|221.276"..., 4096) = 4096


brk(0x887b000) = 0x887b000


_llseek(9, 4096, [4096], SEEK_SET) = 0


read(9, "nceEPKv_ZN15RWDlistIterator17fi"..., 4096) = 4096


read(9, "L3371002s
3O"..., 4096) = 4096


brk(0x885b000) = 0x885b000


brk(0x8859000) = 0x8859000


_llseek(3, 143360, [143360], SEEK_SET) = 0


read(3, "1201*1"..., 4096) =
4096


read(3, "326321625004
22110"..., 45056) = 45056


read(3, "H221f276L2|221.276"..., 4096) = 4096


brk(0x887b000) = 0x887b000


_llseek(9, 4096, [4096], SEEK_SET) = 0


read(9, "nceEPKv_ZN15RWDlistIterator17fi"..., 4096) = 4096


read(9, "L3371002s
3O"..., 4096) = 4096


brk(0x885b000) = 0x885b000


brk(0x8859000) = 0x8859000


_llseek(3, 143360, [143360], SEEK_SET) = 0


read(3, "1201*1"..., 4096) = 4096


read(3, "326321625004
22110"..., 45056) = 45056


read(3, "H221f276L2|221.276"..., 4096) = 4096


brk(0x887b000) = 0x887b000


_llseek(9, 4096, [4096], SEEK_SET) = 0


read(9, "nceEPKv_ZN15RWDlistIterator17fi"..., 4096) = 4096


read(9, "L3371002s
3O"..., 4096) = 4096


brk(0x885b000) = 0x885b000


brk(0x8859000) = 0x8859000


close(6) = 0


munmap(0x4001a000, 4096) = 0


open("bar.o", O_RDONLY) = 6


.............





I verified and it's opening and closing same set of files over and over again.





Solution:


I built and installed GNU binutils version 2.16 and it links fine.





Liviu

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.