How to compile and install only one compile in GCC?

Kai Ruottu kai.ruottu@wippies.com
Mon Sep 7 09:56:00 GMT 2009


Peng Yu wrote:
> On Sat, Sep 5, 2009 at 4:35 AM, Dr. David Kirkby<david.kirkby@onetel.net> wrote:
>
>> Peng Yu wrote:
 >>> I still get some errors. And I checked that ld does not have the
 >>> options -Wl,-rpath. Can somebody let me know what the problem is?
 >>> /home/pengy/utility/linux//x86_64-unknown-linux-gnu/bin/ld:
 >>> unrecognized option '-Wl,-rpath'
 >>> /home/pengy/utility/linux//x86_64-unknown-linux-gnu/bin/ld: use the
 >>> --help option for usage information
 >>> collect2: ld returned 1 exit status
 >>> make[3]: *** [jv-convert] Error 1
 >>
>> -Wl,-foobar is a *compiler* option which passes -foobar directly to the
>> *linker*. (There is also an option -Wa,-foobar which would pass -foobar to
>> the *assembler*).
>>
>> So if you compile with -Wl,-rpath, the linker will see only -rpath, without
>> the -Wl,
>>
>> I'm not sure what your problem is - I think building gcc on some systems is
>> a bit of a black art. But you need to know that -Wl,-rpath is not something
>> the linker will see - it will only see the -rpath.
> 
> My OS is of the following. I don't think that it is an exotic system.
> 
> $ cat  /etc/redhat-release
> CentOS release 5 (Final)
>
> Can somebody let me know how to compile gcc on my machine? To
> rephrase, I have used the following commands.
> 
> $ mkdir build
> $ cd build
> $ /path/to/gcc-source-code/configure --enable-languages="c java"
> --prefix=/path/to/install

I tried the same on my Fedora 8 (32-bit) and there it succeeded. After
the build I searched where that '-Wl,-rpath' would be given related to
the given 'jv-convert' and it was in the
'$BUILD/$target/libjava/jv-convert' script :

------ clip ----
#! /bin/sh

# jv-convert - temporary wrapper script for .libs/jv-convert
# Generated by ltmain.sh (GNU libtool 1.2435 2007/03/18 18:44:42) 2.1a
------ clip ----

In it the option would be given to the produced 'gcj', the Java
compiler driver, and it should handle it in the same way as 'gcc'
would do: to strip the '-Wl,' away and give only '-rpath ...' to
the linker, 'ld'...

So my advice would be to look at the produced script and what on
earth could be wrong in it... Here is the link command in my one:

relink_command="(cd /home/src/gnu/build/i686-pc-linux-gnu/libjava; { 
test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { 
LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z 
\"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; 
export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || 
unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; 
}; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { 
LD_RUN_PATH=; export LD_RUN_PATH; }; }; 
LD_LIBRARY_PATH=/home/src/gnu/build/./gmp/.libs:/home/src/gnu/build/./prev-gmp/.libs:/home/src/gnu/build/./mpfr/.libs:/home/src/gnu/build/./prev-mpfr/.libs:/home/src/gnu/build/i686-pc-linux-gnu/libstdc++-v3/.libs:/home/src/gnu/build/i686-pc-linux-gnu/libmudflap/.libs:/home/src/gnu/build/i686-pc-linux-gnu/libssp/.libs:/home/src/gnu/build/i686-pc-linux-gnu/libgomp/.libs:/home/src/gnu/build/./gcc:/home/src/gnu/build/./prev-gcc; 
export LD_LIBRARY_PATH; 
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin; 
export PATH; /home/src/gnu/build/gcc/gcj 
-B/home/src/gnu/build/i686-pc-linux-gnu/libjava/ 
-B/home/src/gnu/build/gcc/ -ffloat-store -fomit-frame-pointer -Usun -g 
-O2 -o \$progdir/\$file --main=gnu.gcj.convert.Convert -shared-libgcc 
-L/home/src/gnu/build/i686-pc-linux-gnu/libjava/.libs 
-L/home/src/gnu/build/i686-pc-linux-gnu/libjava ./.libs/libgcj.so 
-lpthread -lrt -ldl -Wl,-rpath 
-Wl,/home/src/gnu/build/i686-pc-linux-gnu/libjava/.libs -Wl,-rpath 
-Wl,/usr/local/lib)"



More information about the Gcc-help mailing list