Re: GCC build issues - struggling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29 December 2010 13:09, Dan Track wrote:
> On Wed, Dec 29, 2010 at 12:20 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
>> On 29 December 2010 11:11, Dan Track wrote:
>>>
>>> --with-gmp="/opt/gcc"
>>> --with-gmp-include="/opt/gcc/include"
>> ...
>>> -L/opt/gcc/lib -lmpc -lmpfr -lgmp -rdynamic -ldl  -lz
>>>
>>> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld:
>>> cannot find -lgmp
>> ...
>>> I have gmp installed in
>>> /app/gcc/usr/lib.
>>
>> Use the right --with-gmp option.
>>
>
> Hi,
>
> Thanks for your suggestion, I made the recommended change and removed
> the old config. However I’ve still got the same error, is there
> something else required?
>
> Here’s what I’ve been doing
>
> cd /opt/mon
> tar –xzf gcc-4.5.2.tar.gz
> cd gcc-4.5.2
>
> then the following commands
>
>
> Configure:
>
> ./configure --enable-threads=posix --prefix=/opt/gcc

The installation instructions strongly recommend NOT configuring in
the source tree, but in a separate directory. That allows you to just
remove the build directory and start again if you mess up the config
or want to change it. The source tree will be untouched
e.g.
cd /opt/mon
tar –xzf gcc-4.5.2.tar.gz
mkdir objdir
cd objdir
../gcc-4.5.2/configure ...

--enable-threads=posix is the default for GNU/Linux, it's not
necessary to request it explicitly (but harmless)


> --with-local-prefix=/opt/gcc/usr/local
> --infodir=/opt/gcc/usr/share/info --mandir=/opt/gcc/usr/share/man
> --libdir=/opt/gcc/usr/lib64 --libexecdir=/opt/gcc/usr/lib64
> --enable-languages=c,c++,objc,obj-c++ --enable-checking=release
> --with-gxx-include-dir=/opt/gcc/usr/include/c++/4.1.2 --enable-ssp

Why are you giving the cxx-include-dir as 4.1.2 for a 4.5.2 installation?

> --disable-libssp --disable-libgcj --with-slibdir=/opt/gcc/lib64
> --with-system-zlib --enable-shared --enable-__cxa_atexit
> --enable-libstdcxx-allocator=new --program-suffix=
> --enable-version-specific-runtime-libs --without-system-libunwind
> --with-cpu=generic --host=x86_64-suse-linux --enable-bootstrap
> --enable-shared --enable-threads=posix --enable-checking=release
> --with-system-zlib --enable-__cxa_atexit

Most of these options are redundant

> --disable-libunwind-exceptions --enable-gnu-unique-object
> --enable-linker-build-id LDFLAGS="-L/opt/gcc/lib  -L/opt/gcc/usr/lib
> -L/opt/utils/lib -L/opt/utils/usr/lib"
> CPPFLAGS="-I/opt/utils/usr/include" --host=x86_64-suse-linux
> --target=x86_64-suse-linux --build=x86_64-suse-linux
> --with-tune=generic --with-arch_32=i686 --with-gmp="/opt/gcc"

I thought you said you have gmp in /app/gcc/usr/lib ?

Why are you still using --with-gmp=/opt/gcc ?

Are the installed libgmp.so libraries the right architecture for the
gcc build you're trying, i.e. 64-bit?

> CC=/opt/utils/usr/bin/gcc CXX=/opt/utils/usr/bin/g++ CFLAGS="-g3 -O0
> -I/opt/utils/usr/include" BOOT_LDFLAGS="-L/opt/gcc/lib
> -L/opt/gcc/usr/lib -L/opt/utils/lib -L/opt/utils/usr/lib"

Do you actually need all these environment variables?
I suggest keeping it simple instead of giving dozens of redundant or
unnecessary options.

You probably only need half those configure options, if that.

Set LD_LIBRARY_PATH so libgmp.so can be found at build time:
export LD_LIBRARY_PATH=/app/gcc/usr/lib

Try a much simpler configure:
./configure --enable-threads=posix --prefix=/opt/gcc
--enable-languages=c,c++,objc,obj-c++ --enable-ssp
--disable-libssp --disable-libgcj
--enable-libstdcxx-allocator=new --without-system-libunwind
--with-cpu=generic --host=x86_64-suse-linux
--with-system-zlib
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--host=x86_64-suse-linux
--target=x86_64-suse-linux --build=x86_64-suse-linux
--with-tune=generic --with-arch_32=i686 --with-gmp="/app/gcc/usr"
CC=/opt/utils/usr/bin/gcc CXX=/opt/utils/usr/bin/g++ CFLAGS="-g3 -O0"

Unless you're really messed your system up, you don't need to set
CFLAGS to find headers in /opt/utils/include

If you're still struggling, I'd suggest simply downloading my makefile from
http://www.kayari.plus.com/gcc/config-gcc.mk

then saying "gmake -n -f config-gcc.mk PREFIX=/opt/gcc"
The -n flag will cause make to print out all the commands I consider
necessary to configure gcc (with C and C++ support) - you should be
able to figure out the extra steps needed to include ObjC and add
whatever extra configure options you want.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux