Created attachment 8354 [details] Results of "make check" Dear binutils developers, I have just compiled binutils 2.24. The compilation step was fine. However, the "make check" result showed 16 unexpected failures for "ld". The errors are consistent even for binutils 2.23.2 and 2.25. My system environment: * CentOS 6.6 * x86_64 architecture (Intel(R) Xeon(R) CPU W3550 @ 3.07GHz) * Tools used for installation: 1) libiconv/1.14 2) zlib/1.2.8 3) isl/0.12.2 4) texinfo 5) dejagnu 6) gcc/4.7.4 (non-system gcc) * build command: ../binutils-2.24/configure --prefix=/Scr/scr-test-steven/install/binutils/2.24 --enable-shared --enable-static --enable-plugins --with-zlib=yes --with-libiconv-prefix=/Scr/scr-test-steven/install/libiconv/1.14 --enable-build-warnings=yes CC=/Scr/scr-test-steven/install/gcc/4.7.4/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.7.4/bin/g++ * rpm -q glibc glibc-2.12-1.149.el6_6.9.x86_64 glibc-2.12-1.149.el6_6.9.i686 The failed tests are: FAIL: static preinit array FAIL: static init array FAIL: static fini array FAIL: static init array mixed FAIL: TLS -fpic and -fno-pic exec transitions FAIL: TLS descriptor -fpic and -fno-pic exec transitions FAIL: TLS -fno-pic -shared FAIL: Could not link a static executable FAIL: TLS -fpic -shared transitions FAIL: TLS descriptor -fpic -shared transitions FAIL: TLS -fpic and -fno-pic exec transitions FAIL: TLS descriptor -fpic and -fno-pic exec transitions FAIL: TLS with global dynamic and descriptors FAIL: TLS GD->IE transition FAIL: TLS X32 GD->IE transition FAIL: ld-x86-64/ilp32-4 Please let me know how to fix this. Thanks! Yuhang Wang
Hi Yuhang, I have been unable to reproduce these testsuite failures. :-( If you can reproduce them with a toolchain built using the latest development sources then please could you upload the log file so that I can investigate further. Cheers Nick
Yes, I can try again with the latest source.
Created attachment 8461 [details] Log file for "make check" This is the log file for the command "make check" after "make"
Hi Nick, Sorry for the delay. I have compiled binutils-2.25.1 and still got the same type of errors at the "make check" stage (see attached log files). Here is the command line options I used. ../binutils-2.25.1/configure --prefix=/Scr/scr-test-steven/install/binutils/2.25.1 --enable-shared --enable-static --enable-plugins --with-zlib=yes --with-libiconv-prefix=/Scr/scr-test-steven/install/libiconv/1.14 --enable-build-warnings=yes CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++ Do you think I should compile everything in the same folder as the source file instead? Yuhang
Hi Yuhang, > Do you think I should compile everything in the same folder as the source file > instead? No, that will not help. Please could you upload the ld.log file from the failed tests, so that I can examine it ? Cheers Nick
Created attachment 8464 [details] ld/ld.log file from the binutils compilation directory
Hi Nick, I have uploaded the ld.log file. Please take a look. Thanks! Yuhang
Hi Yuhang, Have you looked in the log file yourself ? If you do, you will see that about half of the failures are because the z library is missing. Eg: /Scr/scr-test-steven/Programs/BinUtils/build_binutils-2.25.1/ld/.libs/lt-ld-new: skipping incompatible /usr/local/lib/libz.a when searching for -lz /Scr/scr-test-steven/Programs/BinUtils/build_binutils-2.25.1/ld/.libs/lt-ld-new: cannot find -lz FAIL: static preinit array The other failures appear to be due to very minor changes in the sections in the output binaries, which are not matching with the expected values. eg: regexp_diff match failure regexp "^ +\[[ 0-9]+\] \.got +PROGBITS +0+804a100 .*$" line " [12] .got PROGBITS 0804a108 002108 000024 04 WA 0 0 4" regexp_diff match failure regexp "^ +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a124 .*$" line " [13] .got.plt PROGBITS 0804a12c 00212c 000010 04 WA 0 0 4" FAIL: TLS -fpic and -fno-pic exec transitions Personally I would consider this a flaw in the test itself, not the linker. The tests should allow for some variations in the section details unless there is good reason to expect exact values. My recommendation - install the zlib package and ignore the other failures. Cheers Nick
Hi Nick, I will compile again with zlib and let you know the results. Thank you for pointing that out. Yuhang
Created attachment 8467 [details] ld/ld.log after adding LDFLAGS and run the "make check" again
Hi Nick, I have add "LDFLAGS=-L/Scr/scr-test-steven/install/zlib/1.2.8/lib" during the configuration phase and the Makefile under ld/ folder is also updated with a new LDFLAGS: LDFLAGS = -static-libstdc++ -static-libgcc -L/Scr/scr-test-steven/install/zlib/1.2.8/lib However, the make check still can't find the correct version the zlib (see the new ld.log). Could you give me some pointers? Thanks! P.S. Here is the new configure option line: ../binutils-2.25.1/configure --prefix=/Scr/scr-test-steven/install/binutils/2.25.1 CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++ LDFLAGS=-L/Scr/scr-test-steven/install/zlib/1.2.8/lib Yuhang
Hi Yuhang, You need to set LD_LIBRARY_PATH rather than LDFLAGS in order to locate libraries when executables are run. So what you need to do is to either set LD_LIBRARY_PATH in your environment, or else add it to the site.exp file pointed to be your DEJAGNU environment variable. Ie, something like this: % export DEJAGNU=`pwd`/site.exp % cat site.exp # Make sure we look in the right place for the board description files. if ![info exists boards_dir] { set boards_dir {} } # Determine target machines for all known targets verbose "Global Config File: target_triplet is $target_triplet" 2 global target_list # Note the following list is alpha sorted in order to help maintain it. case "$target_triplet" in { { i*86-pc-* x86_64-pc-* native i*86-redha4t-linux-gnu } { set LD_LIBRARY_PATH "/usr/local/lib:/Scr/scr-test-steven/install/zlib/1.2.8/lib/" set target_list "unix" } } I hope that this helps. Cheers Nick
FWIW, since the in-tree zlib is enabled on master branch, this problem will go away automatically with binutils 2.26.
Hi Nick, The zlib I mentioned is already in the LD_LIBRARY_PATH. Here is the result of "echo $LD_LIBRARY_PATH": /Scr/scr-test-steven/install/gcc/4.9.2/lib64:/Scr/scr-test-steven/install/gcc/4.9.2/lib:/Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:/Scr/scr-test-steven/install/miniconda/lib I have also created a site.exp file with the content you mentioned at the root of the build folder and also set the DEJAGNU environment variable to `pwd`/site.exp. However, "make check" sill couldn't find the correct version of zlib. Yuhang
Created attachment 8475 [details] ld.log after using the new site.exp with DEJAGNU env variable pointing to it
Hi H. J. Lu, Could you tell me how to get binutils-2.26? I couldn't find it on the release page: http://ftp.gnu.org/gnu/binutils/ Yuhang
(In reply to Yuhang Wang from comment #16) > Hi H. J. Lu, > > Could you tell me how to get binutils-2.26? I couldn't find it on the > release page: http://ftp.gnu.org/gnu/binutils/ The master branch will be called 2.26 when it is released. You can get it via git.
Hi H. J. Lu, Thanks. I cloned the master branch. This new version seems to require python and I got some errors related to PyUnicodeUCS4_Decode (see attached log). Any suggestions on how to fix it? Yuhang
Created attachment 8478 [details] results of make when building the lastest master branch of binutils
(In reply to Yuhang Wang from comment #18) > Hi H. J. Lu, > > Thanks. I cloned the master branch. This new version seems to require python > and I got some errors related to PyUnicodeUCS4_Decode (see attached log). > Any suggestions on how to fix it? Try configure binutils with --enable-plugins --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
Hi, I have compiled the master branch of the binutils. Here is the log file for `make check`. I sill got many errors for ld. Do you think they are significant or can be ignored? === ld Summary === # of expected passes 1144 # of unexpected failures 25 # of expected failures 57 # of untested testcases 1 # of unsupported tests 12
Created attachment 8479 [details] log file for `make check` after compiling the master branch of binutils Here is config command: ../binutils-latest/configure --prefix=/Scr/scr-test-steven/install/binutils/latest CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++ --enable-plugins --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
(In reply to Yuhang Wang from comment #22) > Created attachment 8479 [details] > log file for `make check` after compiling the master branch of binutils > What is in ld.log?
Created attachment 8480 [details] ld/ld.log for the latest master branch of binutils I forgot to attach the ld.log. Here it is.
How did you configure GCC 4.9.2? Did you make any changes to GCC 4.9.2?
I just disabled multi-lib. Here is the config command I used to build gcc-4.9.2: ../gcc-4.9.2/configure --prefix=/Scr/scr-test-steven/install/gcc/4.9.2 --disable-multilib --with-gmp=/Scr/scr-test-steven/install/libgmp/4.3.2 --with-mpfr=/Scr/scr-test-steven/install/libmpfr/2.4.2 --with-mpc=/Scr/scr-test-steven/install/libmpc/0.8.1 --with-cloog=/Scr/scr-test-steven/install/libcloog/0.18.1 --with-isl=/Scr/scr-test-steven/install/libisl/0.12.2 CC=/Scr/scr-test-steven/install/gcc/4.7.4/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.7.4/bin/g++ CPPFLAGS=-I/Scr/scr-test-steven/install/gcc/4.7.4/include LDFLAGS=-L/Scr/scr-test-steven/install/gcc/4.7.4/lib64
(In reply to Yuhang Wang from comment #26) > I just disabled multi-lib. Here is the config command I used to build > gcc-4.9.2: > What is your system GCC? Have you tried it on binutils?
The system gcc version is 4.4. I will try again tomorrow.
With the system gcc (4.4.7 20120313 Red Hat 4.4.7-11), the number of unexpected failures dropped to 18 (from 25). Here is the ld.log. === ld Summary === # of expected passes 1151 # of unexpected failures 18 # of expected failures 57 # of untested testcases 1 # of unsupported tests 12
Created attachment 8481 [details] ld/ld.log compiled using system gcc (4.4.7) === ld Summary === # of expected passes 1151 # of unexpected failures 18 # of expected failures 57 # of untested testcases 1 # of unsupported tests 12
Please run /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -o tmpdir/tlslib.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlslib.s /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -o tmpdir/tlsbinpic.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbinpic.s /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -o tmpdir/tlsbin.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbin.s /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/tlsbin -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -melf_i386 tmpdir/libtlslib.so --no-ld-generated-unwind-info tmpdir/tlsbinpic.o tmpdir/tlsbin.o and upload tmpdir/tlsbin tmpdir/libtlslib.so tmpdir/tlsbinpic.o tmpdir/tlsbin.o
Created attachment 8482 [details] libtlslib.so /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Created attachment 8483 [details] tlsbin /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/tlsbin -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -melf_i386 tmpdir/libtlslib.so --no-ld-generated-unwind-info tmpdir/tlsbinpic.o tmpdir/tlsbin.o
Created attachment 8484 [details] tlsbin.o /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -o tmpdir/tlsbin.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbin.s
Created attachment 8485 [details] tlsbinpic.o /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -o tmpdir/tlsbinpic.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbinpic.s
Created attachment 8486 [details] tlslib.o /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
I have uploaded the binary files as you specified. Let me know whether you need anything else. Thanks.
Please show me # echo $LD_RUN_PATH # echo $LD_LIBRARY_PATH
echo $LD_RUN_PATH returns nothing. echo $LD_LIBRARY_PATH returns the following: /Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
(In reply to Yuhang Wang from comment #39) > echo $LD_RUN_PATH returns nothing. > echo $LD_LIBRARY_PATH returns the following: > /Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/ > 5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/ > lib:/usr/local/lib Please unset LD_LIBRARY_PATH. If it still fails, please upload libtlslib.so from /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
I sill got 18 errors after unsetting LD_LIBRARY_PATH.
Created attachment 8487 [details] libtlslib.so with LD_LIBRARY_PATH unset /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Created attachment 8488 [details] ld/ld.log after unsetting LD_LIBRARY_PATH
(In reply to Yuhang Wang from comment #39) > echo $LD_RUN_PATH returns nothing. Please show me # env | grep LD_RUN_PATH
env | grep LD_RUN_PATH LD_RUN_PATH=
(In reply to Yuhang Wang from comment #45) > env | grep LD_RUN_PATH > LD_RUN_PATH= Please unset LD_RUN_PATH.
No more unexpected failures after "unsetenv LD_RUN_PATH". Could you tell me what is the reason for previous issues? Here is the summary: === ld Summary === # of expected passes 1169 # of expected failures 57 # of untested testcases 1 # of unsupported tests 12 === gas Summary === # of expected passes 937 === binutils Summary === # of expected passes 143 # of unsupported tests 1
Created attachment 8489 [details] ld/ld.log after unsetting LD_RUN_PATH
(In reply to Yuhang Wang from comment #47) > No more unexpected failures after "unsetenv LD_RUN_PATH". > Could you tell me what is the reason for previous issues? > Setting LD_RUN_PATH changes the linker output.
I have just added back LD_LIBRARY_PATH, and all the tests went well (no unexpected failures). So the culprit is indeed LD_RUN_PATH. Do you recommend always leave LD_RUN_PATH unset, or make LD_RUN_PATH the same as LD_LIBARAY_PATH? By the way, why the linker still works fine without LD_RUN_PATH?
(In reply to Yuhang Wang from comment #50) > I have just added back LD_LIBRARY_PATH, and all the tests went well (no > unexpected failures). So the culprit is indeed LD_RUN_PATH. Do you recommend > always leave LD_RUN_PATH unset, or make LD_RUN_PATH the same as > LD_LIBARAY_PATH? By the way, why the linker still works fine without > LD_RUN_PATH? The only thing I can tell you is I don't use LD_RUN_PATH myself.
Thanks H. J. Lu and Nick for helping me out! I appreciate your time and effort.