Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 346391

Summary: sys-devel/gdb-7.0.1 fails to cross compile with USE="expat"
Product: Gentoo Linux Reporter: Christopher Friedt <chrisfriedt>
Component: [OLD] DevelopmentAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log of sys-devel/gdb-7.0.1
armv4tl-softfloat-linux-gnueabi-emerge --info
gdb-7.0.1/gdb/config.log

Description Christopher Friedt 2010-11-22 00:13:38 UTC
the problem is that configure searches for libexpat in /lib, /usr/lib, etc (the 'normal' library paths), and completely ignores /usr/${CHOST}/usr/lib ... actually the best solution is to remove the searching routines and just use '-lexpat', which lets the compiler decide which shared library / archive to link against. It should be no trouble to put a patch together, I'll see what I can do. 

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2010-11-24 01:31:54 UTC
no actual information as to what problem you're having.  the expat check in gdb is using the perfectly standard autoconf code.
Comment 2 Christopher Friedt 2010-11-24 12:38:51 UTC
Created attachment 255317 [details]
build.log of sys-devel/gdb-7.0.1
Comment 3 Christopher Friedt 2010-11-24 12:40:09 UTC
Created attachment 255319 [details]
armv4tl-softfloat-linux-gnueabi-emerge --info
Comment 4 Christopher Friedt 2010-11-24 12:43:09 UTC
=== configuring in common
...
checking for libexpat... no
configure: error: expat is missing or unusable
...

config.log says that it's trying to use /usr/lib/libexpat.so rather than the one that the linker would choose to use in /usr/${CHOST}/usr/lib. It works fine when building for the same architecture, but for cross compiling, it's broken. 
Comment 5 Christopher Friedt 2010-11-24 12:45:13 UTC
Created attachment 255321 [details]
gdb-7.0.1/gdb/config.log
Comment 6 Christopher Friedt 2010-11-24 12:48:12 UTC
my solution was to patch the autoconf scripts to use LIBEXPAT='-lexpat' rather than the first one that it found via a search in /lib /usr/lib, etc. Maybe this could be solve by setting PKG_CONFIG_PATH... I haven't checked. 
Comment 7 SpanKY gentoo-dev 2010-11-24 23:49:24 UTC
expat doesnt provide a pkg-config .pc file, nor does the code use pkg-config to discover expat, so it wouldnt work

i cant see any place where that /usr/lib/... is coming from.  all my local tests show it doing the right thing and only using -lexpat, and the autoconf code looks correct to me too.

you'll have to go into the gdb-7.0.1/gdb/ subdir and manually run configure through `bash -x` and see if you have the same problem.  and if you do, post that output as an attachment.