#80 closed defect (fixed)
Tests failure on Gettext 64 bits due to lack of -fPIC
Reported by: | gomoko | Owned by: | ken |
---|---|---|---|
Priority: | major | Milestone: | CLFS Standard 1.0.0 |
Component: | BOOK | Version: | CLFS Standard 1.0.0 |
Keywords: | Gettext fPIC check | Cc: |
Description
Problem: While running "make check" in section 10.42. Gettext-0.14.5 64 Bit of CLFS Version 1.0.0rc3-x86_64-Multilib, a number of tests failed with this error:
/usr/bin/ld: cannot find -lrpathy collect2: ld returned 1 exit status make[4]: *** [usey] Error 1
It appears to be all of the tests that end in a "c" or a "g". All of the others are either skipped or they pass. There were no failures on the 32-bit tests, just the 64-bit ones.
Solution: It's a problem linked to the -fPIC parameter which is not correctly set during the compilation of the tests. The book give a sed command to skip bad tests, but it is not sufficient. There is two solutions to force the -fPIC option:
- after the configure command, use:
sed -i 's/gcc -m64/gcc -m64 -fPIC/g' autoconf-lib-link/tests/Makefile
It forces -fPIC only for the checks.
- in the configure command, use:
CC="gcc ${BUILD64} -fPIC" CXX="g++ ${BUILD64} -fPIC" \ ./configure --prefix=/usr --libdir=/usr/lib64
It uses -fPIC for all the package, including the installed libraries and programs.
With that, all the tests passed without any error.
In addition, the line:
sed -i -e '2iexit 77' autoconf-lib-link/tests/rpath-3*[ef]
can be suppressed from the book.
Change History (4)
comment:2 by , 18 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
The following changes the TESTS_ENVIRONMENT part of the tests so that -fPIC is used, and does not alter the normal compile, so that e.g. bindtextdom is still compiled without -fPIC. Once again, all tests pass.
sed -i "s/CC='@CC@' CFLAGS='@CFLAGS@'/CC='@CC@' CFLAGS='@CFLAGS@ -fPIC'/" \ autoconf-lib-link/tests/Makefile.in
For x86_64 and x86_64-64 only. This replaces the existing sed.
comment:4 by , 18 years ago
Version: | unstable → 1.0.0 |
---|