History

configure: fix ELF interpreter path on armhf systems

Even though cpu is detected to be "arm", chance is high it's a hard-float CPU, which is further deduced by looking at the compiler triplet. In this case, interpreter is also supposed to include "hf" suffix. On Alpine/armv7 this fixes both suggestion to use "--config-musl" during ./configure step and the tests.

Sigrid Solveig Haflínudóttir committed 10 months ago

Commit 0d5ce061 parent ac338691 file · +23 −9Browse files

Unified · Split

configure+23−9
@@ -487,14 +487,6 @@ if test -z "$build_cross"; then · 486 unmodified lines
487487 fi
488488 esac
489489 fi
490− if test "$suggest" = "yes"; then
491− if test -f "/lib/ld-uClibc.so.0" ; then
492− echo "Perhaps you want ./configure --config-uClibc"
493− fi
494− if test -f "/lib/ld-musl-${cpu}.so.1"; then
495− echo "Perhaps you want ./configure --config-musl"
496− fi
497− fi
498490 fi
499491 else
500492 # can only make guesses about compiler and target
@@ -511,14 +503,17 @@ if test "$bigendian" = "yes" ; then · 10 unmodified lines
511503 confvars_set BIGENDIAN
512504 fi
513505
506+cpuinterp="$cpu"
514507 if test "$cpu" = "arm"; then
515508 if test "${triplet%eabihf}" != "$triplet" ; then
516509 confvars_set arm_eabihf arm_vfp
510+ cpuinterp=armhf
517511 elif test "${triplet%eabi}" != "$triplet" ; then
518512 confvars_set arm_eabi arm_vfp
519513 elif test -z "$build_cross"; then
520514 if test "${_triplet%eabihf}" != "$_triplet" ; then
521515 confvars_set arm_eabihf arm_vfp
516+ cpuinterp=armhf
522517 elif test "${_triplet%eabi}" != "$_triplet" ; then
523518 confvars_set arm_eabi arm_vfp
524519 elif grep -s -q "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo ; then
@@ -532,6 +527,25 @@ if test "$cpu" = "arm"; then · 7 unmodified lines
532527 fi
533528 fi
534529
530+case "$cpuinterp" in
531+ arm64) cpuinterp=aarch64;;
532+esac
533+
534+if test -z "$build_cross"; then
535+ if test "$mingw32" = "no" ; then
536+ if test "$suggest" = "yes"; then
537+ if test "$suggest" = "yes"; then
538+ if test -f "/lib/ld-uClibc.so.0" ; then
539+ echo "Perhaps you want ./configure --config-uClibc"
540+ fi
541+ if test -f "/lib/ld-musl-${cpuinterp}.so.1"; then
542+ echo "Perhaps you want ./configure --config-musl"
543+ fi
544+ fi
545+ fi
546+ fi
547+fi
548+
535549 # a final configuration tuning
536550 if test "$cc_name" != "tcc"; then
537551 OPT1="-Wdeclaration-after-statement" #-fno-strict-aliasing
@@ -697,7 +711,7 @@ for v in $cpu $confvars ; do · 159 unmodified lines
697711 CONFIG_musl=yes) print_num CONFIG_TCC_MUSL 1
698712 case "$cpu" in
699713 arm64) default tcc_elfinterp "/lib/ld-musl-aarch64.so.1";;
700− *) default tcc_elfinterp "/lib/ld-musl-${cpu}.so.1";;
714+ *) default tcc_elfinterp "/lib/ld-musl-${cpuinterp}.so.1";;
701715 esac
702716 ;;
703717 # other

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t