Installing GCC tools for linux cross-compile on amd64

Michael Hopkins michael.hopkins at hopkins-research.com
Thu Mar 31 05:20:53 PST 2005



Hi all

I have been installing a few Linux environments from the ports in the last
few days to try and establish a cross-compiler for 32-bit Linux on amd64.

I have established that the Redhat 8, SUSE 9.2 and Debian Woody ports
install OK.  I've been told that Slackware 10 can also be installed manually
(see my other post for more details on all of the above).

The next step is to get a working set of gcc tools.  Unfortunately, the
linux_devtools port is broken and so is the gentoo port which I believe
would bootstrap itself and then install everything (including gcc tools, I
assume) from source.  Gentoo was also my preference because portage would
seem to be the most port-like way of system maintenance.

With the above working Linux environments I seem to have the following
options for installing the gcc toolset.

1) binary RPMs

2) tarballs

3) apt-get/dpkg/dselect

Although the first two are a bit of a fiddle to carry out that is not a real
problem.  I have done (1) for the SUSE port, but when I use gcc I get this:

cc: installation problem, cannot exec `cc1': No such file or directory
make: *** [LD_search.o] Error 1

Checking cc -v gives:

Using built-in specs.
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada
--disable-checking --libdir=/usr/lib --enable-libgcj
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.4 (pre 3.3.5 20040809)

So I guess it is looking in all the wrong places for it's libraries. I have
tried to alleviate that in the makefile C flags with:

CC = /compat/linux/usr/bin/cc -B/usr/compat/linux/usr
-B/usr/compat/linux/usr/local -B/usr/compat/linux/lib
-B/usr/compat/linux/usr/lib   -I/usr/compat/linux/usr/include/g++

But it doesn't change anything.

I haven't tried (2) because I couldn't successfully install slackware yet.
I'm not clear whether the problem of hard-coded directories mentioned above
would be alleviated or not.  Maybe someone has already produced a tarball or
RPM which contains the gcc tools set up correctly for /compat/linux/?

I like (3) - which is probably the default method in Debian - because it is
automatic and would handle dependencies, but I am worried that the automatic
tools could install stuff all over my / directory rather than inside
/compat/linux/ where I want it all to stay.  Also not sure whether they
would/should store their databases inside /compat/linux or on /.


Any thoughts or tips that lead to a safe and effective solution for this
much appreciated and a great help to the software development community on
FreeBSD who want to target Linux.  If I can get it working and learn enough
about port makefiles then I could try to automate it and make it available.

TIA

Michael


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        _/    _/   _/_/_/             Hopkins Research Ltd
       _/    _/   _/    _/
      _/_/_/_/   _/_/_/          http://www.hopkins-research.com/
     _/    _/   _/   _/
    _/    _/   _/     _/               'touch the future'
                   
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/




More information about the freebsd-emulation mailing list