diff options
author | midipix <writeonce@midipix.org> | 2021-05-31 09:19:57 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-31 09:58:17 +0000 |
commit | ef2867bc8ef2a4bff9ab05b1548f78874280e85d (patch) | |
tree | 3d34305503d403fa072392acd91c4523c57e335a | |
parent | baa9bea758eeb959b37c9c0a8a8fe6a1c5b57738 (diff) | |
download | perk-ef2867bc8ef2a4bff9ab05b1548f78874280e85d.tar.bz2 perk-ef2867bc8ef2a4bff9ab05b1548f78874280e85d.tar.xz |
build system: configure: config_host(): added freestanding environment support.
-rwxr-xr-x | configure | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -859,8 +859,22 @@ config_host() mb_cfghost_cflags="${mb_cfghost_cflags#*: }" - printf 'int main(void){return 0;}' \ - > "$mb_cfghost_tmpname" + if [ $mb_cc_environment = 'freestanding' ]; then + if [ -z "mb_cc_underscore" ]; then + mb_cfghost_start_fn='_start' + else + mb_cfghost_start_fn='start' + fi + + printf 'int %s(void){return 0;}' "$mb_cfghost_start_fn" \ + > "$mb_cfghost_tmpname" + + mb_cfghost_cflags="$mb_cfghost_cflags -ffreestanding" + mb_cfghost_cflags="$mb_cfghost_cflags -nostdlib" + else + printf 'int main(void){return 0;}' \ + > "$mb_cfghost_tmpname" + fi # log printf '\n' >&3 |