This note is about x86 (32bit) **native** compiles, but since it effects things being built for posting in this thread . . .
The Ubuntu gcc: 'Ubuntu/Linaro 4.6.1-9ubuntu3'
Has
one bug and one configuration option incorrect.
The bug: Is in the author's source code, not in the compiler.
The configuration error:
The notation: -L/search/path/
is **supposed** to be put first on the library search paths, before the built-in search paths . . .
It is not - it is being put **second** - after the first path to the multi-lib/multi-arch library path.
Hmm...
Which is probably why all of the trouble getting 32bit stuff to run on a 64bit install (it **should** just work - if the compiler wasn't hosed up).
The work-around for that depends on what your trying to build.
For what I am building at the moment, (against libusb), removing the libusb* files from:
/lib/i386-linux-gnu/
So that both the loader and the linker find the ones in /usr/local/lib first may have done the job - until the package manager finds the installed packages "broken" the next time it tries to update libusb*