Re: Specifying where Binutils is and what it is called

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

 



On 22.04.2020 14:24, R. Diez via Gcc-help wrote:
It looks like the simple solution is to just build and install
binutils twice.  Once into temporary destination and once into
final destination.  Then each compiler will be able to find binutils.
   If you want to optimize this, you might be able to build binutils
once, and install it twice, overriding prefix at install time to put it
in the other install dir.

Finally good advice! Thanks!

That has worked. In case anybody is interested, the result is here:

https://github.com/rdiez/JtagDue/blob/master/Toolchain/Makefile

Search for INSTALL_GCC_PHASE_1_TO_SEPARATE_DIR in there for more information.

Best regards,
   rdiez



I guess it would be a lot easier to create a combined source tree with gcc, binutils and newlib and to everything only once.

Download and unpack binutils,gcc,gmp,mpfr,mpc,isl(optional) and newlib.

$ cd gcc-*
$ ln -s ../gmp-* gmp
$ ln -s ../mpfr-* mpfr
$ ln -s ../mpc-* mpc
$ ln -s ../isl-* isl

$ for i in bfd binutils gas ld opcodes; do ln -s ../binutils-*/$i; done

for newlib
$ ln -s ../newlib-*/newlib
$ ln -s ../newlib-*/libgloss


$ mkdir ${HOME}/obj; cd ${HOME}/obj
$ (TARGET=m68k-elf && ${HOME}/src/gcc-*/configure --prefix=/${TARGET} --libexecdir=/${TARGET}/lib --target=${TARGET} --enable-languages=c,c++ --disable-libstdcxx-pch --with-newlib)

(optional: fix compiler flags)
sed -i 's/\-g /-pipe /' Makefile
sed -i '/^CFLAGS / s/$/ -march=native/' Makefile
sed -i '/^CXXFLAGS / s/$/ -march=native/' Makefile
sed -i '/^CFLAGS_FOR_BUILD/ s/$/ -march=native/' Makefile
sed -i '/^CXXFLAGS_FOR_BUILD/ s/$/ -march=native/' Makefile

Compile and install into staging area
$ make -j$(nproc)
$ make -j2 install-strip DESTDIR=$(pwd)/dest

(install-strip might fail for libgloss, so the workaround I've used is to do a "make install -j2" first, and a "make -j2 install-strip -k" aferwords)

--
chs




[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