Install $prefix and $prefix/$target Directory Clarifications

Kyle Burge
Fri Mar 9 02:08:00 GMT 2018


I apologize if this is a duplicate thread but I've searched high and low
through the mailing lists for information on this subject with no success.
I'm currently trying to build a cross compiler and toolchain and I've
gotten everything almost worked out. The only issue now is that the
packages I built for the target system (with my cross compiler) do not seem
to be receiving the correct paths for includes, the dynamic linker,
libraries, etc. Even if I check the paths and they seem correct, I'll still
get dynamic linker or shared library errors related errors. Or when I try
to build the target coreutils, the build fails because of an incorrect
MB_LEN_MAX (multi-byte character size) definition in header files. This
surely has something to do with the compiler finding the wrong limits.h
files or the files were built incorrectly in the first place.
Getting to the point then, I feel like I have some fundamental
misunderstandings with the cross compiler directories relating to prefix
flags, with-local-prefix flags, sysroot/build-sysroot flags, etc.
Why exactly does binutils and GCC install one set of tools in the $prefix
directory and another in the $prefix/$target directory? I seem to need both
sets of tools.
I've been trying to install my target packages in the $prefix/$target, is
this correct?
How does sysroot flags relate to all of this and when exactly should I use
them? When the system libraries and headers are in a different place than
$prefix right?
But now doesn't the -with-local-prefix flag do something similar as per:
If you guys could just give me a few pointers that would be fantastic.


More information about the Binutils mailing list