I'm trying to install GNU C 3.4.6 on Solaris 10 x86 in a non-standard
location with all libraries correctly linked. I don't want to use
LD_LIBRARY_PATH.
The make fails with this message:
[...]
/tmp/gcc-3.4.6/objdir/gcc/xgcc -B/tmp/gcc-3.4.6/objdir/gcc/ -B/share/
app/gnu/gcc/3.4.6/i386-pc-solaris2.10/bin/ -B/share/app/gnu/gcc/3.4.6/
i386
-pc-solaris2.10/lib/ -isystem /share/app/gnu/gcc/3.4.6/i386-pc-
solaris2.10/include -isystem /share/app/gnu/gcc/3.4.6/i386-pc-
solaris2.10/sys-in
clude -c -DHAVE_CONFIG_H -O2 -O2 -g -fPIC -Wall -Wl,-R/share/app/gnu/
lib,-L/share/app/gnu/lib -I. -I../../../libiberty/../include -W -Wall
-Wt
raditional -pedantic ../../../libiberty/fibheap.c -o fibheap.o
../../../libiberty/fibheap.c: In function `fibheap_union':
../../../libiberty/fibheap.c:166: warning: implicit declaration of
function `free'
../../../libiberty/fibheap.c: In function `fibheap_delete_node':
../../../libiberty/fibheap.c:285: error: `LONG_MIN' undeclared (first
use in this function)
../../../libiberty/fibheap.c:285: error: (Each undeclared identifier
is reported only once
../../../libiberty/fibheap.c:285: error: for each function it appears
in.)
../../../libiberty/fibheap.c: In function `fibheap_consolidate':
../../../libiberty/fibheap.c:395: warning: implicit declaration of
function `memset'
make[1]: *** [fibheap.o] Error 1
make[1]: Leaving directory `/tmp/gcc-3.4.6/objdir/i386-pc-solaris2.10/
libiberty'
make: *** [all-target-libiberty] Error 2
Any ideas which magic compiler options I forgot?
Thanks in advance.
Regards,
Bernd
System info:
$ uname -a
SunOS myhost 5.10 Generic_120012-14 i86pc i386 i86pc Solaris
$ isainfo -v
32-bit i386 applications
pause sse2 sse fxsr mmx cmov sep cx8 tsc fpu
$ cat /etc/release
Solaris 10 8/07 s10x_u4wos_12b X86
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 16 August 2007
Compile steps:
### Install these packages from www.sunfreeware.com into /usr/local
application SMCautoc autoconf
application SMCautom automake
application SMCbinut binutils
application SMCbzip2 bzip2
application SMCcoreu coreutils
application SMCcvs cvs
application SMCgcc gcc
application SMCgmp gmp
application SMCgnats gnats
application SMCgzip gzip
application SMCliconv libiconv
application SMCmake make
application SMCpopt popt
application SMCtar tar
application SMCtop top
### Compiler environment variables:
PATH=/usr/local/bin:/share/app/gnu/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
CC=gcc
CXX=g++
CFLAGS="-O2 -g -fPIC -Wall -Wl,-R/share/app/gnu/lib,-L/share/app/gnu/
lib"
CXXFLAGS="$CFLAGS"
CPPFLAGS="-I/share/app/gnu/include"
LDFLAGS="-L/share/app/gnu/lib -R/share/app/gnu/lib"
LD_OPTIONS="-R /share/app/gnu/lib -L /share/app/gnu/lib"
unset LD_LIBRARY_PATH
export PATH CC CFLAGS CXX CXXFLAGS LDFLAGS CPPFLAGS LD_LIBRARY_PATH
# For each package create symlinks in /share/app/gnu/bin,
# /share/app/gnu/include and /share/app/gnu/lib to the current
version.
# Create a symlink for libgcc_s.so.1 in /share/app/gnu/lib to /usr/
local/lib
# until gcc is compiled.
### Compile gmp:
tar -xvzf gmp-4.2.2.tar.gz
cd gmp-4.2.2
./configure --prefix=/share/app/gnu/gmp/4.2.2 ABI=32
make
make check
make install
### Compile mpfr:
tar -xvzf mpfr-2.3.0.tar.gz
cd mpfr-2.3.0
./configure --prefix=/share/app/gnu/mpfr/2.3.0 --with-gmp=/share/app/
gnu/gmp/4.2.2
make
make install
### Compile binutils:
tar -xvzf binutils-2.18.tar.gz
cd binutils-2.18
./configure --prefix=/share/app/gnu/binutils/2.18 --with-gmp=/share/
app/gnu --with-mpfr=/share/app/gnu
### Compile libiconv:
tar -xvzf libiconv-1.12.tar.gz
cd libiconv-1.12
./configure --prefix=/share/app/gnu/libiconv/1.12
make
make install
### Compile texinfo:
tar -xvzf /share/app/gnu/src/texinfo-4.9.tar.gz
cd texinfo-4.9
./configure --prefix=/share/app/gnu/texinfo/4.9 --with-libiconv-
prefix=/share/app/gnu/libiconv/1.12
make
make install
### Compile gnats:
tar -xvzf /share/app/gnu/src/gnats-4.1.0.tar.gz
cd gnats-4.1.0
./configure --prefix=/share/app/gnu/gnats/4.1.0
make
make install
### Compile gzip:
tar -xvzf /share/app/gnu/src/gzip-1.3.9.tar.gz
cd gzip-1.3.9
./configure --prefix=/share/app/gnu/gzip/1.3.9
### Compile bzip2:
tar -xvzf /share/app/gnu/src/bzip2-1.0.4.tar.gz
cd bzip2-1.0.4
make
make install PREFIX=/share/app/gnu/bzip2/1.0.4
### Compile make:
tar -xvzf /share/app/gnu/src/make-3.81.tar.gz
cd make-3.81
./configure --prefix=/share/app/gnu/make/3.81 --with-libiconv-prefix=/
share/app/gnu --with-libintl-prefix=/share/app/gnu
make
make install
### Compile tar
tar -xvzf /share/app/gnu/src/tar-1.19.tar.gz
cd tar-1.19
./configure --prefix=/share/app/gnu/tar/1.19 --with-libiconv-prefix=/
share/app/gnu --with-libintl-prefix=/share/app/gnu
make
make install
### Compile m4
tar -xvzf /share/app/gnu/src/m4-1.4.10.tar.gz
cd m4-1.4.10
./configure --prefix=/share/app/gnu/m4/1.4.10
make
make install
### Compile autoconf
tar -xvzf /share/app/gnu/src/autoconf-2.61.tar.gz
cd autoconf-2.61
./configure --prefix=/share/app/gnu/autoconf/2.61
make
make install
### automake
PATH=/share/app/gnu/bin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
tar -xvzf /share/app/gnu/src/automake-1.10.1.tar.gz
cd automake-1.10.1
./configure --prefix=/share/app/gnu/automake/1.10.1
make
make install
### coreutils
tar -xvzf /share/app/gnu/src/coreutils-6.10.tar.gz
cd coreutils-6.10
./configure --prefix=/share/app/gnu/coreutils/6.10 --with-libiconv-
prefix=/share/app/gnu
make
make install
### Compile gcc:
cd /tmp
tar -xvzf /share/app/gnu/src/gcc-3.4.6.tar.gz
cd gcc-3.4.6
mkdir objdir
cd objdir
../configure --prefix=/share/app/gnu/gcc/3.4.6 --with-local-prefix=/
share/app/gnu
make
[...]
/tmp/gcc-3.4.6/objdir/gcc/xgcc -B/tmp/gcc-3.4.6/objdir/gcc/ -B/share/
app/gnu/gcc/3.4.6/i386-pc-solaris2.10/bin/ -B/share/app/gnu/gcc/3.4.6/
i386
-pc-solaris2.10/lib/ -isystem /share/app/gnu/gcc/3.4.6/i386-pc-
solaris2.10/include -isystem /share/app/gnu/gcc/3.4.6/i386-pc-
solaris2.10/sys-in
clude -c -DHAVE_CONFIG_H -O2 -O2 -g -fPIC -Wall -Wl,-R/share/app/gnu/
lib,-L/share/app/gnu/lib -I. -I../../../libiberty/../include -W -Wall
-Wt
raditional -pedantic ../../../libiberty/fibheap.c -o fibheap.o
../../../libiberty/fibheap.c: In function `fibheap_union':
../../../libiberty/fibheap.c:166: warning: implicit declaration of
function `free'
../../../libiberty/fibheap.c: In function `fibheap_delete_node':
../../../libiberty/fibheap.c:285: error: `LONG_MIN' undeclared (first
use in this function)
../../../libiberty/fibheap.c:285: error: (Each undeclared identifier
is reported only once
../../../libiberty/fibheap.c:285: error: for each function it appears
in.)
../../../libiberty/fibheap.c: In function `fibheap_consolidate':
../../../libiberty/fibheap.c:395: warning: implicit declaration of
function `memset'
make[1]: *** [fibheap.o] Error 1
make[1]: Leaving directory `/tmp/gcc-3.4.6/objdir/i386-pc-solaris2.10/
libiberty'
make: *** [all-target-libiberty] Error 2
CFLAGS="-O2 -g -fPIC -Wall"
../configure --prefix=/share/app/gnu/gcc/3.4.6
it compiles through but then libiconv.so.2 is not linked from the
directory where it should be take according to LDFLAGS:
myhost:/share/app/gnu/gcc/3.4.6/bin>$ ldd gcc
libiconv.so.2 => (file not found)
libc.so.1 => /lib/libc.so.1
libm.so.2 => /lib/libm.so.2
Yes, I know that LD_LIBRARY_PATH can be set to solve that but I want
the location compiled into the binary and not rely on environment
variables that the user has to set.
Bye
Bernd
/tmp/gcc-4.2.2/objdir/./gcc/xgcc -B/tmp/gcc-4.2.2/objdir/./gcc/ -B/
share/app/gnu/gcc/4.2.2/i386-pc-solaris2.10/bin/ -B/share/app/gnu/gcc/
4.2.2/i386-pc-solaris2.10/lib/ -isystem /share/app/gnu/gcc/4.2.2/i386-
pc-solaris2.10/include -isystem /share/app/gnu/gcc/4.2.2/i386-pc-
solaris2.10/sys-include -O2 -O2 -O2 -g -fPIC -Wall -Wl,-R/share/app/
gnu/lib -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -
Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -
g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -
I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../
gcc/../libcpp/include -I../../gcc/../libdecnumber -I../libdecnumber -
m64 -fexceptions -c ../../gcc/unwind-dw2.c -o libgcc/amd64/unwind-
dw2.o
Assembler: unwind-dw2.c
"/var/tmp//ccZ7oqsG.s", line 396 : Warning: Illegal
subtraction - symbols from different sections: ".L63", ".L73"
"/var/tmp//ccZ7oqsG.s", line 397 : Warning: Illegal
subtraction - symbols from different sections: ".L63", ".L73"
"/var/tmp//ccZ7oqsG.s", line 398 : Warning: Illegal
subtraction - symbols from different sections: ".L63", ".L73"
"/var/tmp//ccZ7oqsG.s", line 399 : Warning: Illegal
subtraction - symbols from different sections: ".L63", ".L73"
"/var/tmp//ccZ7oqsG.s", line 840 : Warning: Illegal
subtraction - symbols from different sections: ".L111", ".L141"
"/var/tmp//ccZ7oqsG.s", line 863 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 864 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 865 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 866 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 867 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 868 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 869 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 870 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 871 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 872 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 873 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 874 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 875 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 876 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 877 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 878 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 879 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 880 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 881 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 882 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 883 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 884 : Warning: Illegal
subtraction - symbols from different sections: ".L116", ".L141"
"/var/tmp//ccZ7oqsG.s", line 2058 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2059 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2061 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2078 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2199 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2201 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2203 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L261"
"/var/tmp//ccZ7oqsG.s", line 2397 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L344"
"/var/tmp//ccZ7oqsG.s", line 2398 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L344"
"/var/tmp//ccZ7oqsG.s", line 2401 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L344"
"/var/tmp//ccZ7oqsG.s", line 2406 : Warning: Illegal
subtraction - symbols from different sections: ".L351", ".L344"
"/var/tmp//ccZ7oqsG.s", line 5668 : Warning: Illegal
subtraction - symbols from different sections: ".LFB4", ".DOT-33"
"/var/tmp//ccZ7oqsG.s", line 5677 : Warning: Illegal
subtraction - symbols from different sections: ".LFB5", ".DOT-34"
"/var/tmp//ccZ7oqsG.s", line 5686 : Warning: Illegal
subtraction - symbols from different sections: ".LFB11", ".DOT-35"
"/var/tmp//ccZ7oqsG.s", line 5695 : Warning: Illegal
subtraction - symbols from different sections: ".LFB39", ".DOT-36"
"/var/tmp//ccZ7oqsG.s", line 5704 : Warning: Illegal
subtraction - symbols from different sections: ".LFB45", ".DOT-37"
"/var/tmp//ccZ7oqsG.s", line 5713 : Warning: Illegal
subtraction - symbols from different sections: ".LFB47", ".DOT-38"
"/var/tmp//ccZ7oqsG.s", line 5722 : Warning: Illegal
subtraction - symbols from different sections: ".LFB48", ".DOT-39"
"/var/tmp//ccZ7oqsG.s", line 5731 : Warning: Illegal
subtraction - symbols from different sections: ".LFB49", ".DOT-40"
"/var/tmp//ccZ7oqsG.s", line 5740 : Warning: Illegal
subtraction - symbols from different sections: ".LFB51", ".DOT-41"
"/var/tmp//ccZ7oqsG.s", line 5749 : Warning: Illegal
subtraction - symbols from different sections: ".LFB52", ".DOT-42"
"/var/tmp//ccZ7oqsG.s", line 5758 : Warning: Illegal
subtraction - symbols from different sections: ".LFB72", ".DOT-43"
"/var/tmp//ccZ7oqsG.s", line 5767 : Warning: Illegal
subtraction - symbols from different sections: ".LFB40", ".DOT-44"
"/var/tmp//ccZ7oqsG.s", line 5786 : Warning: Illegal
subtraction - symbols from different sections: ".LFB37", ".DOT-45"
"/var/tmp//ccZ7oqsG.s", line 5805 : Warning: Illegal
subtraction - symbols from different sections: ".LFB6", ".DOT-46"
"/var/tmp//ccZ7oqsG.s", line 5840 : Warning: Illegal
subtraction - symbols from different sections: ".LFB3", ".DOT-47"
"/var/tmp//ccZ7oqsG.s", line 5859 : Warning: Illegal
subtraction - symbols from different sections: ".LFB62", ".DOT-48"
"/var/tmp//ccZ7oqsG.s", line 5868 : Warning: Illegal
subtraction - symbols from different sections: ".LFB50", ".DOT-49"
"/var/tmp//ccZ7oqsG.s", line 5887 : Warning: Illegal
subtraction - symbols from different sections: ".LFB46", ".DOT-50"
"/var/tmp//ccZ7oqsG.s", line 5896 : Warning: Illegal
subtraction - symbols from different sections: ".LFB55", ".DOT-51"
"/var/tmp//ccZ7oqsG.s", line 5935 : Warning: Illegal
subtraction - symbols from different sections: ".LFB56", ".DOT-52"
"/var/tmp//ccZ7oqsG.s", line 5968 : Warning: Illegal
subtraction - symbols from different sections: ".LFB57", ".DOT-53"
"/var/tmp//ccZ7oqsG.s", line 5999 : Warning: Illegal
subtraction - symbols from different sections: ".LFB54", ".DOT-54"
"/var/tmp//ccZ7oqsG.s", line 6034 : Warning: Illegal
subtraction - symbols from different sections: ".LFB59", ".DOT-55"
"/var/tmp//ccZ7oqsG.s", line 6067 : Warning: Illegal
subtraction - symbols from different sections: ".LFB63", ".DOT-56"
"/var/tmp//ccZ7oqsG.s", line 6098 : Warning: Illegal
subtraction - symbols from different sections: ".LFB64", ".DOT-57"
"/var/tmp//ccZ7oqsG.s", line 6131 : Warning: Illegal
subtraction - symbols from different sections: ".LFB60", ".DOT-58"
"/var/tmp//ccZ7oqsG.s", line 6156 : Warning: Illegal
subtraction - symbols from different sections: ".LFB73", ".DOT-59"
"/var/tmp//ccZ7oqsG.s", line 6187 : Warning: Illegal
subtraction - symbols from different sections: ".LFB66", ".DOT-60"
"/var/tmp//ccZ7oqsG.s", line 6222 : Warning: Illegal
subtraction - symbols from different sections: ".LFB67", ".DOT-61"
"/var/tmp//ccZ7oqsG.s", line 6259 : Warning: Illegal
subtraction - symbols from different sections: ".LFB68", ".DOT-62"
"/var/tmp//ccZ7oqsG.s", line 6294 : Warning: Illegal
subtraction - symbols from different sections: ".LFB71", ".DOT-63"
"/var/tmp//ccZ7oqsG.s", line 6329 : Warning: Illegal
subtraction - symbols from different sections: ".LFB70", ".DOT-64"
"/var/tmp//ccZ7oqsG.s", line 6366 : Warning: Illegal
subtraction - symbols from different sections: ".LFB69", ".DOT-65"
"/var/tmp//ccZ7oqsG.s", line 391 : Illegal subtraction -
symbols from different sections: ".L72", ".L73"
make[4]: *** [libgcc/amd64/unwind-dw2.o] Error 1
make[4]: Leaving directory `/tmp/gcc-4.2.2/objdir/gcc'
make[3]: *** [stmp-multilib] Error 2
make[3]: Leaving directory `/tmp/gcc-4.2.2/objdir/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/tmp/gcc-4.2.2/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc-4.2.2/objdir'
make: *** [all] Error 2