Ticket #80 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Tests failure on Gettext 64 bits due to lack of -fPIC

Reported by: gomoko Assigned to: 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

08/02/06 22:30:36 changed 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.

08/03/06 01:36:24 changed by ken

  • owner changed from clfs-commits@lists.cross-lfs.org. to ken.
  • status changed from new to 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.

08/03/06 21:11:04 changed by ken

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in r2294

09/17/06 18:56:06 changed by jim

  • version changed from unstable to 1.0.0.