This Time Self-Hosted
dark mode light mode Search

Updates on Gentoo/FreeBSD and crosscompilers

Gentoo/FreeBSD logo by Marius Morawski

Okay, some updates on the status of creating a crosscompiler between FreeBSD and Linux are needed, as I have news, not exactly the best news ever, but at least news.

First before, I want to thanks David Xu from FreeBSD for being so kind when I asked him about the freebsd-lib patch to build with binutils 2.16.92, he also pointed me how to submit the patches to kernel sources and the rest. I hope this can be the start of a collaboration between projects that will lead to a general improvement 🙂

Anyway returning on the crosscompile issues, yesterday I fixed kernel-2.eclass and linux-headers ebuild so that they can be built on Gentoo/FreeBSD, and I got a stage1 crosscompiler working.

Unfortunately the libstdc++ build script sets LD_LIBRARY_PATH also when crosscompiling to the just built libraries, so when anything is run, or at least tried to, the runtime loader tries to load the libgcc_s.so.1 from the LD_LIBRARY_PATH, but that file is a PowerPC ELF binary in my case, so the loader can’t recognise it, and bails out.

There are two solutions to this problem: the first is to change FreeBSD’s rtld to behave like GNU’s, and fallback to the next library when one fails to load, but that requires hacking the sources a bit, although I’d like such a feature and I’ll probably be working on that in the next days; the second way is to fix gcc to not set LD_LIBRARY_PATH when building a crosscompiler, and this might be simpler and can go directly upstream.

As soon as that’s resolved I suppose the crosscompile will work (after fixing crossdev, that I still have to submit the patches to vapier for).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.