﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
80	Tests failure on Gettext 64 bits due to lack of -fPIC	gomoko	ken	"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."	defect	closed	major	CLFS Standard 1.0.0	BOOK	CLFS Standard 1.0.0	fixed	Gettext fPIC check	
