Sitemap — — — Webring — — — Repositories — — — About
Abstract:
J. Marino's notes
See http://www.dragonlace.net/wiki/xcompile/index.html
- Install NetBSD-current-aarch64.
- Copy
/usr/lib
and/usr/include
out of the system. - Take binutils from NetBSD's source code. It is located under
src/external/gpl3/binutils/dist
. The reason for using the integrated binutils and not upstream is that NetBSD's binutils are heavily patched. Allowconfigure
to be executable.- Make sure
isl
,gmp
,mpfr
andmpc
(mpcomplex
) are installed under/usr/pkg
, sincebinutils
will make use of them. - Build binutils
- Make sure
- Copy
gcc10-aux
's patched source code from pkgsrc (work/gcc-10.3.0
).- REVIEW: The
gmp
,mpfr
andmpcomplex
directories are prefixed with.devel.
. Move them so that they do not have such prefix. - Create a new folder to build
gcc
. In this casebuild-gcc
.
- REVIEW: The
Notes
Once gcc10-aux builds successfully in NetBSD x8664, it is time to make it work in other platforms! Steps:
- Make sure that the Makefile.rtl in gcc/ada contains an entry for the OS/arch pair that you are cross-compiling to. For the time being, arm and arm64 have been added.
- Clone the NetBSD src into /usr/src (canonical place).
- NetBSD has stripped everything-ada from its source code and entries, so we need to re-enable it.
- Enable the compilation of Ada as part of GCC. Add
ada
to the entryGCC_LANGUAGES=c c++ objc
in/src/tools/gcc/Makefile
. - Add
configure-target-libada
toMKNATIVE_CONFIG_TARGET_LIBS+
in the same file as above. - Add
--enable-languages="${GCC_LANGUAGES}"
inNATIVE_CONFIGURE_ARGS+=
before the.native/.configure_done
target. - TODO CLEAN: change these two lines
ALL_TARGET= all-gcc all-target-libgcc INSTALL_TARGET= install-gcc install-target-libgcc
- Enable
ada/gcc-interface
in/src/external/gpl3/gcc/usr.bin/frontend/Makefile
at the bottom loop. This will fix an include error that would happen if not added to the"#include \"$$f/lang-specs.h\""
line. - Copy the
gcc/ada
folder from the patchedpkgsrc
"work" directory fromgcc10-aux
into/src/external/gpl3/gcc/dist/gcc
. - Copy the
libada
andgnattools
folders from the patched sources into/src/external/gpl3/gcc/dist
. - TODO See https://github.com/NetBSD/src/tree/trunk/external/gpl3/gcc/lib
- TODO See https://github.com/NetBSD/src/tree/trunk/external/gpl3/gcc/usr.bin (gnattools?)
- TODO See https://github.com/NetBSD/src/blob/a56a355f5aa95b831d219d32d678431153490f6e/tools/gcc/mknative-gcc and enable ada.
- Enable the compilation of Ada as part of GCC. Add
- Compile a release of NetBSD. For 32-bit systems run:
./build.sh -m evbarm -a earmv7hf -j6 -u release
. For 64-bit systems (RPi 3 and above) run./build.sh -m evbarm -a aarch64 -j6 -u release
specs.h: Makefile for f in cp lto objc objcp ada/gcc-interface; do \ echo "#include \"$$f/lang-specs.h\""; \ done > specs.h