This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Cross compiling and multiple sysroot question
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 12 Jan 2015 10:05:08 -0800
- Subject: Re: Cross compiling and multiple sysroot question
- Authentication-results: sourceware.org; auth=none
- References: <023c43de-da14-4832-a95c-38ff7601a439 at BAMAIL02 dot ba dot imgtec dot org> <alpine dot DEB dot 2 dot 10 dot 1501082203560 dot 22036 at digraph dot polyomino dot org dot uk>
- Reply-to: <sellcey at imgtec dot com>
On Thu, 2015-01-08 at 22:12 +0000, Joseph Myers wrote:
> On Thu, 8 Jan 2015, Steve Ellcey wrote:
>
> > So I set these macros and SPECs:
> > # m32 and be are defaults
> > MULTILIB_OPTIONS = m64 mel # In makefile fragment
> > MULTILIB_DIRNAMES = 64 el # In makefile fragment
> > MULTILIB_OSDIRNAMES = m64=../lib64 # In makefile fragment
>
> In my experience, for such cases it's best to list all multilibs
> explicitly in MULTILIB_OSDIRNAMES, and then to specify
> STARTFILE_PREFIX_SPEC as well along the lines of:
>
> #define STARTFILE_PREFIX_SPEC \
> "%{mabi=32: /usr/local/lib/ /lib/ /usr/lib/} \
> %{mabi=n32: /usr/local/lib32/ /lib32/ /usr/lib32/} \
> %{mabi=64: /usr/local/lib64/ /lib64/ /usr/lib64/}"
Thanks for the help Joseph, this combination worked and I was able to
build a working GCC using this setup.
> GCC never installs anything inside the sysroot (it could be a read-only
> mount of the target's root filesystem, for example). Listing all
> multilibs explicitly (multilib=dir or multilib=!dir) in
> MULTILIB_OSDIRNAMES allows you to ensure they don't overwrite each other.
GCC never installs anything inside sysroot's but some tools that people
have developed to build cross compiler toolchains copy the shared libgcc
libraries (libgcc_s, libstdc++, etc) from the GCC install area into
sysroot as part of the build of a cross compiler toolchain.
I was wondering if I could use the explicit list of MULTILIB_OSDIRNAMES
entries to layout those libraries in a way that would make it easy to
copy them into a sysroot if I wanted to. The only thing I am not sure
about if there is a way to specify where I want the default (no option)
libraries to go.
I.e. I can use:
MULTILIB_OSDIRNAMES += mips64r2=mipsr2/lib32
MULTILIB_OSDIRNAMES += mips64r2/mabi.64=mipsr2/lib64
To create a mipsr2/lib32 and mipsr2/lib64 directory under <target>/lib
for libgcc_s but I would like the default libraries in
<target>/lib/mipsr2/lib instead of directly in <target>/lib. That way I
could use a single copy to put all of <target>/lib/mipsr2 into my
sysroot. Do you know if either of these would work:
MULTILIB_OSDIRNAMES += mips32r2=mipsr2/lib
MULTILIB_OSDIRNAMES += .=mipsr2/lib
I don't think the first one would work because -mips32r2 is the default
architecture and is not explicitly listed in MULTILIB_OPTIONS and I
don't think the second form is supported at all, but maybe there is some
other way to specify the location of the default libraries?
Steve Ellcey
sellcey@imgtec.com