Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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:1 Changed 13 years ago by ken

As expected, I see this also on x86_64-64. I don't know what has changed, but I'll play with the alternatives to see how they measure up.

comment:2 Changed 13 years ago by ken

Owner: changed from clfs-commits@… to ken
Status: newassigned

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:3 Changed 13 years ago by ken

Resolution: fixed
Status: assignedclosed

fixed in r2294

comment:4 Changed 13 years ago by Jim Gifford

Version: unstable1.0.0
Note: See TracTickets for help on using tickets.