I need to build a GCC cross-compiler targeting i386-pc-elf. I'm running into problems with the build on OpenBSD 6.3.

I've already successfully built a binutils-2.31.1 for i386-pc-elf.

Trying to use the GCC 4.9.4 package (as GCC 4.2 is too old to build GCC 8), my configure is:

CC=egcc CXX=eg++ ../gcc-8.2.0/configure --prefix=/usr/local/gcc-i386 --target=i386-pc-elf --with-gmp=/usr/local

And I'm just running gmake -j7. The error I get is in this build log: https://pastebin.com/k0ygAN5t

***
/usr/bin/ld: build/genmodes.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
***

If I use the clang that's built into OpenBSD, I get a bunch of C errors that presumably mean that you can't do it with clang. Here is the build log: https://pastebin.com/Dv5gQ4aS

My configure for that is:

CC=clang CXX=clang ../gcc-8.2.0/configure --prefix=/usr/local/gcc-i386 --target=i386-pc-elf --with-gmp=/usr/local

Has anyone ran into this problem before, and if so, what do I need to do to build my cross-compiler on OpenBSD? Apologies if this is not the right place to ask.

Reply via email to