diff options
author | midipix <writeonce@midipix.org> | 2021-05-31 09:19:57 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-31 09:58:19 +0000 |
commit | e8a4b3c981e7586a8a18ac0544f5abc4f9224c48 (patch) | |
tree | 2b5eea4f26cca03f54e339374e613a89b18f5bf6 | |
parent | abba2da03337a194d418497d25deea1a6cb9c762 (diff) | |
download | tpax-e8a4b3c981e7586a8a18ac0544f5abc4f9224c48.tar.bz2 tpax-e8a4b3c981e7586a8a18ac0544f5abc4f9224c48.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 |