Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [EAPI 7] Cross-compile improvements (BDEPEND, BROOT, sysroot)
Date: Tue, 15 Dec 2015 05:28:00
Message-Id: 20151215052749.GM11489@vapier.lan
In Reply to: Re: [gentoo-dev] [EAPI 7] Cross-compile improvements (BDEPEND, BROOT, sysroot) by James Le Cuirot
1 On 02 Dec 2015 23:20, James Le Cuirot wrote:
2 > On reflection, I'm now thinking that we should call it something less
3 > generic. I also found that the Qt build uses SYSROOT for its own
4 > purposes so you cannot rely on it in toolchain wrappers. ROOT is
5 > probably just as unreliable. For that reason, I ended up using
6 > CB_SYSROOT in cross-boss.
7
8 it should be SYSROOT. we've been using it for years in Chromium OS w/out
9 problems, it's in the base cross-compiling logic already, it's the obvious
10 logical name, and it's used by a few ebuilds and upstream packages.
11
12 no matter what name you pick you run the risk of colloding with upstream
13 packages using it for something else. we've already seen that with the
14 vars in the spec like ABI, ROOT, and D.
15
16 > I forgot to mention earlier that if ROOT were used, PMS actually
17 > forbids it from being referenced in the src_* phases so this
18 > restriction would need to be lifted. Relying on the toolchain's
19 > internal sysroot is not sufficient.
20
21 sounds fine to forbid it
22
23 > > > gcc and friends support a --sysroot argument. It used to be the case
24 > > > that this didn't work on a toolchain configured without a sysroot,
25 > > > possibly creating issues for #4, but I've tested and it now works
26 > > > regardless.
27 > >
28 > > $ gcc --sysroot=/tmp/foo -I/usr/include foo.c
29 > > /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
30 > > this linker was not configured to use sysroots
31 > > collect2: error: ld returned 1 exit status
32 > >
33 > > Two problems here:
34 > > 1. link fails
35 > > 2. gcc doesn't warn for -I/usr/include with sysroot (iirc crossdev's
36 > > gcc do)
37 >
38 > Yeah, turns out my hello.c test was not sufficient. It seems gcc is
39 > fine with it but binutils isn't. This seems silly to me so maybe this
40 > could be patched out or perhaps building the native binutils with
41 > --with-sysroot=/ would work?
42
43 i vaguely recall older versions misbehaving, but should be fixed in the
44 latest ones. which is why i haven't enabled it for all builds -- wanted
45 to make sure things didn't break first w/native.
46
47 > I know about -Wpoison-system-directories. We only enable it for
48 > cross-compilers but I think it only triggers when cross-compiling
49 > anyway. It's a shame they didn't make it dependent on --sysroot
50 > instead.
51
52 the eclass enables it only when creating cross-compilers. i could rework
53 the code to be available all the time and work off of sysroot. i was going
54 for conservative on the first pass.
55 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature