The attached patch extends config.guess to distinguish the old ARM ABI from EABI and EABI with hardfloat on NetBSD, as NetBSD uses on ~all modern ARM platforms, and extends config.sub to recognize it.
I extended config-sub.data with examples of platform triples generated by config.guess, and of platform triples used by NetBSD's cross-compiler toolchain and pkgsrc (which omit the release number and say `ARCH--netbsd...' instead of `ARCH-unknown-netbsd...'). I would have extended config-guess.data, but it depends on the hw.machine_arch sysctl, which config-guess.sh does not have a way to furnish. Incidentally, on NetBSD, `uname -p' has been the same as `sysctl -n hw.machine_arch' since the former was introduced in 1998, so I'm not sure why config.guess bothers with sysctl. (The hw.machine_arch sysctl was introduced in 1997.) So I have also attached a collection of test data for NetBSD and a little script to run it: `./nbsd.sh < nbsd.data' (provided config.guess is patched to say `sysctl' instead of `/sbin/sysctl').
>From 46afec7f708db17a93290598d9dc0773f53a215d Mon Sep 17 00:00:00 2001 From: Taylor R Campbell <riastr...@netbsd.org> Date: Sun, 15 Feb 2015 19:18:26 +0000 Subject: [PATCH] Recognize NetBSD ARM EABI platforms. --- config.guess | 25 ++++++++++++++++++++----- config.sub | 2 +- testsuite/config-sub.data | 24 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/config.guess b/config.guess index dbfb978..c6be4d0 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2015-01-01' +timestamp='2015-02-15' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -168,20 +168,28 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`($sysctl 2>/dev/null || \ + $sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*eb) + sed='s,^e\(armv[0-9]\).*$,\1,' + machine=`echo ${UNAME_MACHINE_ARCH} | sed -e "$sed"`eb-unknown + ;; + earmv*) + sed='s,^e\(armv[0-9]\).*$,\1,' + machine=`echo ${UNAME_MACHINE_ARCH} | sed -e "$sed"`-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +205,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + sed='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$sed"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -213,7 +228,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` diff --git a/config.sub b/config.sub index 6d2e94c..20ac69f 100755 --- a/config.sub +++ b/config.sub @@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 5831954..43bfd8e 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -11,6 +11,7 @@ amd64-kfreebsd5.4-gnu x86_64-pc-kfreebsd5.4-gnu amd64-unknown-freebsd5.2 x86_64-unknown-freebsd5.2 arceb-linux arceb-unknown-linux-gnu arc-linux arc-unknown-linux-gnu +arm--netbsdelf arm--netbsdelf arm-cegcc arm-unknown-cegcc arm-coff arm-unknown-coff arm-elf arm-unknown-elf @@ -18,9 +19,32 @@ arm-linux-androideabi arm-unknown-linux-androideabi arm-mingw32ce arm-unknown-mingw32ce arm-riscos arm-unknown-riscos arm-tirtos arm-unknown-tirtos +arm-unknown-netbsdelf7.0 arm-unknown-netbsdelf7.0 arm-unknown-riscos arm-unknown-riscos +armeb--netbsdelf armeb--netbsdelf +armeb-unknown-netbsdelf7.0 armeb-unknown-netbsdelf7.0 +armv6--netbsdelf-eabi armv6--netbsdelf-eabi +armv6--netbsdelf-eabihf armv6--netbsdelf-eabihf armv6-linux-gnu armv6-unknown-linux-gnu +armv6-unknown-netbsdelf7.0 armv6-unknown-netbsdelf7.0 +armv6-unknown-netbsdelf7.0-eabi armv6-unknown-netbsdelf7.0-eabi +armv6-unknown-netbsdelf7.0-eabihf armv6-unknown-netbsdelf7.0-eabihf +armv6eb--netbsdelf-eabi armv6eb--netbsdelf-eabi +armv6eb--netbsdelf-eabihf armv6eb--netbsdelf-eabihf +armv6eb-unknown-netbsdelf7.0 armv6eb-unknown-netbsdelf7.0 +armv6eb-unknown-netbsdelf7.0-eabi armv6eb-unknown-netbsdelf7.0-eabi +armv6eb-unknown-netbsdelf7.0-eabihf armv6eb-unknown-netbsdelf7.0-eabihf +armv7--netbsdelf-eabi armv7--netbsdelf-eabi +armv7--netbsdelf-eabihf armv7--netbsdelf-eabihf +armv7-unknown-netbsdelf7.0 armv7-unknown-netbsdelf7.0 +armv7-unknown-netbsdelf7.0-eabi armv7-unknown-netbsdelf7.0-eabi +armv7-unknown-netbsdelf7.0-eabihf armv7-unknown-netbsdelf7.0-eabihf armv7a-linux-gnueabi armv7a-unknown-linux-gnueabi +armv7eb--netbsdelf-eabi armv7eb--netbsdelf-eabi +armv7eb--netbsdelf-eabihf armv7eb--netbsdelf-eabihf +armv7eb-unknown-netbsdelf7.0 armv7eb-unknown-netbsdelf7.0 +armv7eb-unknown-netbsdelf7.0-eabi armv7eb-unknown-netbsdelf7.0-eabi +armv7eb-unknown-netbsdelf7.0-eabihf armv7eb-unknown-netbsdelf7.0-eabihf armv8b-linux-gnueabi armv8b-unknown-linux-gnueabi aros i386-pc-aros avr32 avr32-unknown-none -- 1.8.3.1
evbarm 7.0 NetBSD ignored arm arm-unknown-netbsdelf7.0 evbarm 7.0 NetBSD ignored armeb armeb-unknown-netbsdelf7.0 evbarm 7.0 NetBSD ignored earmv6 armv6-unknown-netbsdelf7.0-eabi evbarm 7.0 NetBSD ignored earmv6eb armv6eb-unknown-netbsdelf7.0-eabi evbarm 7.0 NetBSD ignored earmv6hf armv6-unknown-netbsdelf7.0-eabihf evbarm 7.0 NetBSD ignored earmv6hfeb armv6eb-unknown-netbsdelf7.0-eabihf evbarm 7.0 NetBSD ignored earmv7 armv7-unknown-netbsdelf7.0-eabi evbarm 7.0 NetBSD ignored earmv7eb armv7eb-unknown-netbsdelf7.0-eabi evbarm 7.0 NetBSD ignored earmv7hf armv7-unknown-netbsdelf7.0-eabihf evbarm 7.0 NetBSD ignored earmv7hfeb armv7eb-unknown-netbsdelf7.0-eabihf
#!/bin/sh set -Ceu PATH=`pwd`:$PATH rc=0 while read m r s v p triplet; do rm -f uname && cat >uname <<EOF #!/bin/sh [ \$# -ne 1 ] && exec sh "\$0" -s [ \$1 = -m ] && echo '$m' && exit 0 [ \$1 = -r ] && echo '$r' && exit 0 [ \$1 = -s ] && echo '$s' && exit 0 [ \$1 = -v ] && echo '$v' && exit 0 [ \$1 = -p ] && echo '$p' && exit 0 EOF rm -f sysctl && cat >sysctl <<EOF #!/bin/sh [ \$# -ne 2 ] && exit 1 [ \$1 = -n -a \$2 = hw.machine_arch ] && echo '$p' && exit 0 exit 1 EOF chmod +x uname sysctl if ! output=`../config.guess 2>>/dev/null`; then echo "FAIL: unable to guess $m:$r:$s:$v:$p" rc=1 continue fi if [ "$output" != "$triplet" ]; then echo "FAIL: $output (expected $triplet)" rc=1 continue fi done exit $rc
_______________________________________________ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches