Re: Trying to build gcc cross compiler from linux to freebsd‏

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

 



18.3.2015, 0:27, Kai Ruottu kirjoitti:
17.3.2015, 21:14, Niccolò Ferrari kirjoitti:
Hello,
I was trying to compile a gcc cross compiler for linux x86_64 (build and host) to freebsd x86_64. I tried to follow this http://marcelog.github.io/articles/articles.html
The steps are :

1. choose a sysroot where to put the C headers and libraries for the target (usually in '/usr/include' and '/usr/lib'
    on the native target system)

2. copy them onto the sysroot, for example '$sysroot/usr/include' and '$sysroot/usr/lib' on the cross host

3. configure the GNU binutils and GCC using '--with-sysroot=$sysroot' to tell where the target stuff is on the cross host system. Build and install them, binutils first, GCC then...

4. be happy and try making a "Hello World" app for the target, compiling it on the cross host...


I looked what the :

http://marcelog.github.io/articles/cross_freebsd_compiler_in_linux.html

told and it seems these instructions are for the "pre-sysroot" time... If one makes one's ow $sysroot to have a 1-to-1 image to the target's native install scheme for the headers and libraries then things should be much easier. Especially when the target is a bi-arch system with separate 64-bit (default) and 32-bit libraries and separate places for the shared libs (.so) and the static archives (.a). Which I expect the x86_64-freebsd* systems
being just like the x86_64-linux-gnu systems are...

My own "standard" place for a $sysroot is '/opt/host-$target', in your case the chosen $sysroot would be :

  /opt/host-x86_64-freebsd10.1

and there those possible 'lib*', 'usr/lib*', 'usr/include' etc directories the target system has as its C library
stuff...




[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