[CentOS] building on x86_64 (was: Problem compiling freeradius on x86_64)

Sun Mar 9 11:24:13 UTC 2008
Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg at imag.fr>


Johnny Hughes wrote:
<snip>
> First thing is that building on x86_64 is quite a PITA.
> 
> You will need to either use mock with the appropriate configuration file 
>   or you will need to create a build machine that has only x86_64 RPMS 
> (otherwise you will either try (and fail) to link to i386 libraries ... 
> or if you have enough i386 software actually installed (binutils, 
> libgcc, glibc and glibc-devel) then you will actually link against i386 
> libraries).

Hi,

I've seen several posts like Johnny's here saying that i386 libs are 
preferentially linked instead of x86_64 libs on x86_64 systems.

However I can't reproduce this, and seem to observe the opposite. See:
http://lists.centos.org/pipermail/centos/2008-March/095576.html

Also, on a centos5 x86_64 machine ldd --verbose has:
SEARCH_DIR("/usr/x86_64-redhat-linux/lib64"); 
SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); 
SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-redhat-linux/lib"); 
SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib"); 
SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
which I understand as giving higher priority to x86_64 libs?


In the thread concerning snmppd linked above, the problem seemed to be 
caused by the Makefile, which specified -L/usr/lib hence imposing the 
highest priority for i386 libs.

I guess either I'm missing / misunderstanding something, or there's a 
widespread use of inappropriate -L directives in makefiles, maybe 
autogenerated ones eg by automake? In which case it's an automake bug 
and should be reported.

thanks,
Nicolas