On Wednesday 16 April 2008 17:43, Daniel Jacobowitz wrote:
> On Wed, Apr 16, 2008 at 05:21:55PM +0200, Denys Vlasenko wrote:
> > Maybe gcc can use paths relative to executable's location?
> > readlink("/proc/self/exe") and all that.
> > It will make gcc installation movable without rebuilding.
>
> It already does. That's exactly what the code causing you a problem
> is for. So if you don't try to work around the lack of a feature
> which is in fact present, everything will just work :-)
>
> It's configured to live in /usr/bin. So from there it searches
> ../app*/lib/gcc/wherever to find cc1. When it discovers that you ran
> it from /usr/app*/bin instead (by following the symlink to the real
> binary), it searches /usr/app*/bin/../app*/lib/gcc/wherever. But
> cc1's not there.
Cool! Giving it a try...
Meanwhile: I decided to get rid of paths in as/ld invocations
by specifying as/ld names without any paths:
--with-gnu-ld \
--with-ld="$CROSS-ld" \
--with-gnu-as \
--with-as="$CROSS-as" \
and it works, I only need to patch configure to not "test x $with_ld"
as that won't work.
I tested in and it works.
The patch is below. Do you think it makes sense?
--
vda
--- gcc-4.2.3.org/gcc/configure Sun Sep 23 23:08:04 2007
+++ gcc-4.2.3/gcc/configure Tue Apr 15 07:35:57 2008
@@ -1751,11 +1751,7 @@
DEFAULT_LINKER="$with_ld"
fi;
if test x"${DEFAULT_LINKER+set}" = x"set"; then
- if test ! -x "$DEFAULT_LINKER"; then
- { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&5
-echo "$as_me: error: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&2;}
- { (exit 1); exit 1; }; }
- elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
+ if $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
gnu_ld_flag=yes
fi
@@ -1811,11 +1807,7 @@
DEFAULT_ASSEMBLER="$with_as"
fi;
if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
- if test ! -x "$DEFAULT_ASSEMBLER"; then
- { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&5
-echo "$as_me: error: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&2;}
- { (exit 1); exit 1; }; }
- elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
+ if $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
gas_flag=yes
fi