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
487 fi487 fi
488 esac488 esac
489 fi489 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
498 fi490 fi
499else491else
500 # can only make guesses about compiler and target492 # can only make guesses about compiler and target
@@ -511,14 +503,17 @@ if test "$bigendian" = "yes" ; then · 10 unmodified lines
511 confvars_set BIGENDIAN503 confvars_set BIGENDIAN
512fi504fi
513 505
506cpuinterp="$cpu"
514if test "$cpu" = "arm"; then507if test "$cpu" = "arm"; then
515 if test "${triplet%eabihf}" != "$triplet" ; then508 if test "${triplet%eabihf}" != "$triplet" ; then
516 confvars_set arm_eabihf arm_vfp509 confvars_set arm_eabihf arm_vfp
510 cpuinterp=armhf
517 elif test "${triplet%eabi}" != "$triplet" ; then511 elif test "${triplet%eabi}" != "$triplet" ; then
518 confvars_set arm_eabi arm_vfp512 confvars_set arm_eabi arm_vfp
519 elif test -z "$build_cross"; then513 elif test -z "$build_cross"; then
520 if test "${_triplet%eabihf}" != "$_triplet" ; then514 if test "${_triplet%eabihf}" != "$_triplet" ; then
521 confvars_set arm_eabihf arm_vfp515 confvars_set arm_eabihf arm_vfp
516 cpuinterp=armhf
522 elif test "${_triplet%eabi}" != "$_triplet" ; then517 elif test "${_triplet%eabi}" != "$_triplet" ; then
523 confvars_set arm_eabi arm_vfp518 confvars_set arm_eabi arm_vfp
524 elif grep -s -q "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo ; then519 elif grep -s -q "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo ; then
@@ -532,6 +527,25 @@ if test "$cpu" = "arm"; then · 7 unmodified lines
532 fi527 fi
533fi528fi
534 529
530case "$cpuinterp" in
531 arm64) cpuinterp=aarch64;;
532esac
533
534if 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
547fi
548
535# a final configuration tuning549# a final configuration tuning
536if test "$cc_name" != "tcc"; then550if test "$cc_name" != "tcc"; then
537 OPT1="-Wdeclaration-after-statement" #-fno-strict-aliasing551 OPT1="-Wdeclaration-after-statement" #-fno-strict-aliasing
@@ -697,7 +711,7 @@ for v in $cpu $confvars ; do · 159 unmodified lines
697 CONFIG_musl=yes) print_num CONFIG_TCC_MUSL 1711 CONFIG_musl=yes) print_num CONFIG_TCC_MUSL 1
698 case "$cpu" in712 case "$cpu" in
699 arm64) default tcc_elfinterp "/lib/ld-musl-aarch64.so.1";;713 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";;
701 esac715 esac
702 ;;716 ;;
703 # other717 # 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