Stichting-MINIX-Research-Foundation / minix

Official MINIX sources - Automatically replicated from gerrit.minix3.org
Other
2.99k stars 969 forks source link

[cross-compile] Improve fetching external projects and building speed, and fix compiling with more recent version of GCC #355

Open bvlgah opened 7 months ago

bvlgah commented 7 months ago

Acknowledgements

Thanks petershh for submitting a related PR #322 which fixes multiple strong symbol conflict during linking, I have also included the commit in this PR

Description

So far, I have made three changes:

  1. Fetch external projects (to be specific, gcc and binutils) from ftpmirror.gnu.org rather than www.minix3.org for speed-up (10 MB/s vs ~50 KB/s).

  2. Use as much CPU cores as possible. At least for cross-compiling, the default number (it is 1) of core to use is specified in releasetools/image.defaults.

  3. Fix building with more recent version of GCC (I am compiling Minix on an Ubuntu 22.04 container with GCC 11.4). These fixes are added in the form of *.patch files. Here is my way of generating them:

cd external/gpl3/gcc
mkdir dist.orig
tar -C dist.orig --strip-components=1 gcc-4.8.5.tar.bz2
diff --color -u dist.orig/gcc/reload1.c dist/gcc/reload1.c > patches/0005-fix-gcc-reloads.patch
git add -f patches/0005-fix-gcc-reloads.patch

By the way, patches will be applied by fetch.sh.