summaryrefslogtreecommitdiff
path: root/sofort/cfgtest
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-05 15:06:16 +0000
committermidipix <writeonce@midipix.org>2021-06-05 15:11:54 +0000
commit9f90d02613a2badfd4d14ba18f6b0e2620e24fbc (patch)
treeb9be3c176e117b9f681efefa8f536d778ce1051a /sofort/cfgtest
parent2752f570477c580619921f90a81cce19f30023a8 (diff)
downloadperk-9f90d02613a2badfd4d14ba18f6b0e2620e24fbc.tar.bz2
perk-9f90d02613a2badfd4d14ba18f6b0e2620e24fbc.tar.xz
build system: cfgtest_compiler_switch(): ldflag: added freestanding support.
Diffstat (limited to 'sofort/cfgtest')
-rw-r--r--sofort/cfgtest/cfgtest.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index f66dde5..46c431f 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -39,6 +39,7 @@ cfgtest_host_section()
mb_cfgtest_cc="$ccenv_host_cc"
mb_cfgtest_cfgtype='host'
mb_cfgtest_stdin_input=${ccenv_host_stdin_input:-}
+ mb_cfgtest_environment=${ccenv_host_cc_environment:-}
mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \
OS_DSO_EXRULES=default \
@@ -64,6 +65,7 @@ cfgtest_native_section()
mb_cfgtest_cc="$ccenv_native_cc"
mb_cfgtest_cfgtype='native'
mb_cfgtest_stdin_input=${ccenv_native_stdin_input:-}
+ mb_cfgtest_environment=${ccenv_native_cc_environment:-}
mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \
OS_DSO_EXRULES=default \
@@ -600,7 +602,18 @@ cfgtest_compiler_switch()
case "${1}" in
-Wl,*)
- cfgtest_code_snippet='int main(void){return 0;}'
+ if [ "$mb_cfgtest_environment" = 'freestanding' ]; then
+ cfgtest_switches="$cfgtest_switches -nostdlib -nostartfiles"
+
+ if [ -z "ccenv_cc_underscore" ]; then
+ cfgtest_code_snippet='int start(void){return 0;}'
+ else
+ cfgtest_code_snippet='int _start(void){return 0;}'
+ fi
+ else
+ cfgtest_code_snippet='int main(void){return 0;}'
+ fi
+
cfgtest_common_init 'ldflag'
;;