2021/05/11

Trying to cross-build Haiku with gcc11

This is very quick dirty hack to cross-build Haiku with gcc11.
Host: Ubuntu 20.04
Target Haiku x86-64 master branch

1. Build gcc11 cross compiler with below patch
https://github.com/haikuports/haikuports/pull/5858

2. Edit BuildConfig
2-1 Add elfedit path to HAIKU_ELFEDIT_x86_64 line.
e.g. HAIKU_ELFEDIT_x86_64 ?= /home/haiku/haiku/haiku/generated-gcc11/cross-tools-x86_64/bin/x86_64-unknown-haiku-elfedit ;
2-2 Add -Wno-error to HAIKU_CCFLAGS_x86_64 line.
HAIKU_CCFLAGS_x86_64 ?= -Wno-error ;
2-3 Add -std=gnu++14 -Wno-error to HAIKU_C++FLAGS_x86_64 line.
Note: gcc11's default gnu++17 can't build Haiku, due to dynamic exception specifications.
HAIKU_C++FLAGS_x86_64 ?= -std=gnu++14 -Wno-error ;

3. Patching to Haiku
https://review.haiku-os.org/c/haiku/+/3902
https://review.haiku-os.org/c/haiku/+/3903
https://review.haiku-os.org/c/haiku/+/3904

4. run jam
e.g. jam -a  @release-vmware

5. copy gcc11's avx*.h to build_packages/gcc_syslibs_devel-8.3.0_2019_05_24-7-x86_64/develop/headers/gcc/include

6. Re-run jam

I tried to boot image with VirtualBox, but boot failed...
Have fun!!


0 件のコメント:

コメントを投稿