Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88079 - eclasses updates for gcc building on g/fbsd
Summary: eclasses updates for gcc building on g/fbsd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All All
: High normal
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-05 13:56 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2006-04-12 10:50 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
toolchain-eclass.patch (toolchain-eclass.patch,2.15 KB, patch)
2005-04-05 13:57 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
eutils-eclass.patch (eutils-eclass.patch,569 bytes, patch)
2005-04-05 13:57 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
toolchain-eclass2.patch (toolchain-eclass2.patch,411 bytes, patch)
2005-04-06 06:12 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
eutils-eclass2.patch (eutils-eclass2.patch,507 bytes, patch)
2005-04-06 06:35 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
toolchain-eclass3.patch (toolchain-eclass3.patch,840 bytes, patch)
2005-04-06 06:58 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
toolchain eclass patch (toolchain.patch,846 bytes, patch)
2005-04-27 10:36 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
eutils eclass patch (eutils.patch,900 bytes, patch)
2005-04-27 10:37 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
mktemp-bsd-eutils.patch (mktemp-bsd-eutils.patch,1.21 KB, patch)
2005-04-27 16:35 UTC, SpanKY
Details | Diff
eutils.eclass-linux-bsd.patch (eutils.eclass-linux-bsd.patch,531 bytes, patch)
2006-02-17 01:20 UTC, Benigno B. Junior (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-05 13:56:48 UTC
The attached patch applied over toolchain and eutils eclasses allows compilation of gcc on g/fbsd (at least i hope, i'm building it right now, anyway they are prerequisites). They don't hurt linux systems as they simply add a case for x86-fbsd useflag, uses gmake instead of make (which is available everywhere to the same executable), and changes the way --enable-clocale is passed. That's the main problem of building gcc (better, libstdc++) on fbsd's libc.

HTH, Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-05 13:57:24 UTC
Created attachment 55399 [details, diff]
toolchain-eclass.patch
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-05 13:57:40 UTC
Created attachment 55400 [details, diff]
eutils-eclass.patch
Comment 3 SpanKY gentoo-dev 2005-04-05 16:59:25 UTC
the first few hunks for toolchain.eclass are ok, the part where make is changed to gmake is not ok

many many other packages execute `make` so you're going to have to come up with a transparent fix for that

the get_number_of_jobs function shouldnt be used anymore ... i think just gcc/glibc still use it (which should be changed)
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-06 03:18:44 UTC
There should be an alias which tells make=gmake on fbsd profile iirc.
This make it completely transparent to quite every ebuild.

GCC, instead, seems to loose the alias somewhere during the build process, and then uses ${MAKE} to call it, calling BSD-make.
That's why I changed make -> gmake.
Comment 5 Otavio Piske (RETIRED) gentoo-dev 2005-04-06 04:25:56 UTC
Yeah, there is an make=gmake alias in our profile [1], unfortunately some packages insists in ignoring it causing us a few troubles. SpanKY, would it be ok to use gmake only when on x86-fbsd and leave make as default to the other systems? 

1. http://www.gentoo.org/cgi-bin/viewcvs.cgi/bsd/fbsd/overlay/profiles/default-bsd/fbsd/5.3/profile.bashrc?root=gentoo-projects&view=markup
Comment 6 SpanKY gentoo-dev 2005-04-06 05:44:00 UTC
i would prefer we figure out why the alias disappears ;)
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-06 05:59:26 UTC
That's not so bad.. it could be done intentionally to avoid some strange aliased make combinations.

gmake is the official name anyway, so moving everything pace-by-pace to use gmake instead of make is a way to resolve the problems.
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-06 06:12:52 UTC
Created attachment 55460 [details, diff]
toolchain-eclass2.patch

Another patch needed to toolchain-eclass.patch, note that cp -a doesn't exists
on bsd cp, so we need to change it to the options which are aliased by -a.
Also -d option is not usable on bsd cp, but that's not a problem, as usually
-pPR is enough.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-06 06:35:18 UTC
Created attachment 55461 [details, diff]
eutils-eclass2.patch

That is also needed, it makes emktemp know about bsd mktemp command which is
slightly different from the debian's one.
Sorry for the style of the patch but i forgot to do a copy of the eclass before
change it and i've diffed it against the old revision in my svn rep.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-06 06:58:51 UTC
Created attachment 55466 [details, diff]
toolchain-eclass3.patch

Hope this is the last :)
This removes the use of env -uRESTRICT, using env RESTRICT="" as -u is not
POSIX compliant and fails on bsd, and chown to root:wheel instead of root:root
which is not valid on bsd.
Comment 11 SpanKY gentoo-dev 2005-04-06 17:43:15 UTC
ive merged the fixes for 'cp -a' and 'env -u' ...

i changed the profile-bootstrap logic to look at arch (if arch is x86, then attempt a profile bootstrap)

i also changed the MAKE_COMMAND stuff ... emake is always used now, but if you're doing a profiled bootstrap, we append -j1 to MAKEOPTS

for the locale/gnu thing, wouldnt this work better ?
[[ ${CTARGET} == *-gnu ]] && confgcc="${confgcc} --enable-clocale=gnu"
i dont know what CHOST bsd and osx use ... but i assume it doesnt end in '-gnu' ?
Comment 12 SpanKY gentoo-dev 2005-04-06 19:20:17 UTC
the mktemp() patch for eutils.eclass looks wrong ...

old behavior:
if exe == touch then exe = -p

new behavior:
if exe == touch && userland == bsd then exe = -p
if exe == touch && userland != bsd then exe = -t

so if we look at the GNU userland, the behavior is now to pass '-t' instead of '-p' ...
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-07 03:50:24 UTC
Sorry about the emktemp patch, I wrote a version here and one on the g/fbsd box and I inverted the logico.

About checking for CHOST, actually the problem there is with GNU/kFBSD which uses glibc under FreeBSD kernel. I don't know which CHOST uses for it.
CHOST for FBSD on an Athlon is i686-unknown-freebsd.
Maybe we could make it "autotest" for the locale, as it does on non-gnu systems right now. It should work well.
Comment 14 Stephen Bennett (RETIRED) gentoo-dev 2005-04-10 05:18:13 UTC
CHOST for x86-fbsd is currently i686-unknown-freebsd5.3. AFAIK the GNU/kFreeBSD system would use something along the lines of i686-unknown-freebsd-gnu; IIRC absinthe would probably be the one to tell you that. That would be using glibc though, so the gnu locales would presumably be correct in that case.
Comment 15 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-27 10:36:45 UTC
Created attachment 57406 [details, diff]
toolchain eclass patch
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-27 10:37:46 UTC
Created attachment 57407 [details, diff]
eutils eclass patch

Ok I'm now trying to build gcc 4.0.0 (as 3.4 ICEs out) and that's the current
status:

get_number_of_jobs is still fooled up, should that be removed from gcc?

I've changed the locale part to check if in CTARGET there's -gnu so that it
doesn't rely on fbsd/ppc-macos.
I've fixed emktemp call.
The root:root -> root:wheel change is still needed.
Comment 17 SpanKY gentoo-dev 2005-04-27 16:35:51 UTC
Created attachment 57440 [details, diff]
mktemp-bsd-eutils.patch

make sure this mktemp still works please
Comment 18 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-05 02:03:05 UTC
emktemp now gives a strange error... the problem is that I can't find where is getting called during emerge gcc.
Comment 19 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-11 03:37:18 UTC
Yuhu? Now that gcc and libstdc++ dependency are fixed (thanks SpanKY to allow me to do that :) ) we really need to merge at least all the fix but emktemp (which still fails with latest patch but doesn't change the fact that it works fine... don't know where on earth it's called anyway).

Actually get_number_of_jobs can check for "${KERNEL}" == "FreeBSD" instead of "${ARCH}" == "x86-fbsd" so we are safe for eventual amd64-fbsd and following.
Comment 20 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-14 18:46:40 UTC
Actually, FreeBSD doesn't require /proc filesystem to be mounted, in spite of linux, so get_number_of_jobs is simply broken.

SpanKY, can you remove it soon?
Comment 21 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-07-13 14:07:18 UTC
Considering this fixed at this point. 
Comment 22 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2006-01-24 19:31:15 UTC
At least the emktemp fixed for eutils isn't applied to the eutils.class .
Reopening, this breaks configuration of mysql on my machine.
Comment 23 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2006-01-24 19:52:00 UTC
Manually editing the changes from "eutils eclass patch" into my eutils.eclass fixes the problem.
Comment 24 SpanKY gentoo-dev 2006-01-24 19:59:56 UTC
Diego can handle the -t/-p issue on CHOST==*bsd* systems
Comment 25 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-02-15 15:40:53 UTC
Okay fixed.
Comment 26 Joel Martin (RETIRED) gentoo-dev 2006-02-16 19:36:04 UTC
Don't think this is quite closed yet. I was cross-compiling baselayout 1.11.14-r3 to a mips64el TARGET and emktemp busted.

I get: mktemp: cannot make temp dir tmp: Invalid argument

Doing a little instrumentation I find that the actual command begin executed is:
TMPDIR="/local/nightly/20060216/build/roots/mips64el//tmp/devnodes.XXXXXXXXX" mktemp -d tmp

Manually changing it to:
TMPDIR="/local/nightly/20060216/build/roots/mips64el//tmp" mktemp -dt devnodes.XXXXXXXXX
does what I expect is intended.

This a Linux system with debianutils-2.14.1-r1
Comment 27 Benigno B. Junior (RETIRED) gentoo-dev 2006-02-17 01:20:26 UTC
Created attachment 79994 [details, diff]
eutils.eclass-linux-bsd.patch

I could reproduce the problem by changing the ROOT variable. In fact, I was trying to find a way to use only one command for them all (changing only one parameter), but it's seems to be a bit hard. Please, try the patch, which come back the Linux way and keep the BSD way.
Comment 28 Joel Martin (RETIRED) gentoo-dev 2006-02-17 04:37:09 UTC
Works for me both cross-compiling and native emerge on Linux
Comment 29 Benigno B. Junior (RETIRED) gentoo-dev 2006-02-17 15:07:11 UTC
If there's no problem with the patch, can someone put this in the portage so more people won't have problems, please?
Thanks.
Comment 30 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-02-18 02:50:59 UTC
Committed now.