Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203869 - gcc-config - refersh all targets after bump
Summary: gcc-config - refersh all targets after bump
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
Depends on:
Reported: 2007-12-31 10:25 UTC by Alon Bar-Lev (RETIRED)
Modified: 2009-12-20 19:52 UTC (History)
2 users (show)

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

gcc-config-1.4.0-r4.ebuild.diff (gcc-config-1.4.0-r4.ebuild.diff,842 bytes, patch)
2007-12-31 18:45 UTC, Alon Bar-Lev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 10:25:56 UTC
SCons resets the PATH.
So gcc-config cannot find whatever it is looking for (the exports are my prints).

scons: done reading SConscript files.
scons: Building targets ...
/tmp/mingw32-gcc -o build/release/AdvSplash/advsplash.o -c -Os -Wall -fno-strict-aliasing -Ibuild/release/AdvSplash -IContrib/AdvSplash Contrib/AdvSplash/advsplash.c
export OLDPWD
export PATH="/usr/local/bin:/opt/bin:/bin:/usr/bin"
export PWD="/var/tmp/portage/dev-util/nsis-2.33/work/nsis-2.33-src"
export SHLVL="2"
export _="/tmp/mingw32-gcc"
gcc-config error: Could not run/locate "mingw32-gcc"
scons: *** [build/release/AdvSplash/advsplash.o] Error 1


The nsis scripts tries to add the path of mingw32-gcc to the PATH, but on Gentoo it needs to add something like: /usr/i686-pc-linux-gnu/mingw32/gcc-bin/4.2.2

Or more correctly the output of:
gcc-config --print-environ mingw32-4.2.2

I am not sure what is the best way to achieve this.
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 10:49:47 UTC
nsis search for any mingw32 compiler found in PATH, as long as it has a well known name. These names are {,i{6,5,4,3}86-}mingw32-gcc.

What crossdev command you used to install mingw32? For instance, I used crossdev i686-mingw32 and, as a result, I have a /usr/bin/i686-mingw32-gcc executable.
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 10:59:16 UTC
I use:
[I--] [  ] sys-devel/crossdev-0.9.18-r6 (0)
[I--] [  ] sys-devel/gcc-config-1.4.0-r4 (0)
[I--] [ ~] cross-mingw32/binutils-2.18-r1 (mingw32)
[I--] [ ~] cross-mingw32/gcc-4.2.2 (mingw32-4.2)
[I--] [ ~] cross-mingw32/mingw-runtime-3.13 (0)
[I--] [ ~] cross-mingw32/w32api-3.10 (0)

I do have /usr/bin/mingw32-gcc, but apparently this is not enough.
Notice that from the output I sent, it DO find the mingw32-gcc, but then some Gentoo configuration complains.
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 11:20:22 UTC
All I see from your original comment is that scons try to run /tmp/mingw32-gcc (?!?) while on my box the first line after "Building targets..." begins (as it should) with "i686-mingw32-gcc -o ...".
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 11:29:35 UTC
Sorry, I modified the script to run /tmp/ so I can print out the environment.
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 11:31:43 UTC
Well, I still don't understand why it doesn't find mingw32-gcc since you obviously have /usr/bin in your PATH.
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 11:35:26 UTC
It does find...

Please try the following:

$ PATH="/usr/bin:/bin" mingw32-gcc
gcc-config error: Could not run/locate "mingw32-gcc"

BTW: Which gcc-config do you use?
Comment 7 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 11:39:26 UTC
I have sys-devel/gcc-config-1.3.15-r1.

Time to call heavy cavalry... :P
Comment 8 SpanKY gentoo-dev 2007-12-31 16:00:29 UTC
works fine for me

make sure you run `gcc-config -f` on the mingw toolchain first to make sure it has the most recent version
Comment 9 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 16:07:21 UTC
It was solved.

Anyway I should have known to run it?
Maybe on some upgrade it should have done automatically?
Comment 10 SpanKY gentoo-dev 2007-12-31 17:37:20 UTC
gcc-config already does for the native compiler, but not for any other targets
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 17:50:57 UTC
Why not do a simple loop for all installed configurations?
I guess I am not the only one who have this issue...
Comment 12 SpanKY gentoo-dev 2007-12-31 18:26:57 UTC
it's easy to say "just make a simple loop" when you havent tried coding it

feel free to submit a patch
Comment 13 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 18:45:27 UTC
Created attachment 139757 [details, diff]

What do you think about this one?
Comment 14 SpanKY gentoo-dev 2007-12-31 19:47:47 UTC
that isnt ok ... that will temporarily screw with the system compiler which will break other things which will be running at the same time ... it's also wasteful as you only need to refresh the wrappers once per target, not for every version
Comment 15 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 19:51:36 UTC
One time event can be wasteful.

Maybe you can add a parameter to gcc-config to refresh without switch?
Comment 16 SpanKY gentoo-dev 2007-12-31 20:03:23 UTC
"it only gets run once" is not a valid reason to make it crappy
Comment 17 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-31 20:26:54 UTC
Whatever you think...
But it is better than breaking people machines...
Comment 18 paulo 2008-08-06 04:46:08 UTC
I also have the same problem
In my case i did 
root> gcc-config -f i686-mingw32-4.3.1

but it still doesn't work.
But it works normally as root.

i686-mingw32-gcc: no input files

gcc-config error: Could not run/locate "i686-mingw32-gcc"

I have /usr/bin on my $PATH.
Comment 19 paulo 2008-08-06 10:52:23 UTC
Well don't know how, I just reinstalled and it started working. 
no comments...
Comment 20 Mark Loeser (RETIRED) gentoo-dev 2009-04-20 21:49:08 UTC
This hasn't gone anywhere, and doesn't look like it will.
Comment 21 SpanKY gentoo-dev 2009-04-29 21:44:09 UTC
i plan on doing it at some point
Comment 22 SpanKY gentoo-dev 2009-12-20 19:52:05 UTC
this is fixed in gcc-config-1.5