Support ARM target

This commit is contained in:
Thomas Pöchtrager 2020-08-15 20:07:54 +02:00
parent 65e7e00e65
commit 261de10511
10 changed files with 182 additions and 71 deletions

View File

@ -5,7 +5,7 @@
# This script requires the OS X SDK and the Clang/LLVM compiler. # This script requires the OS X SDK and the Clang/LLVM compiler.
# #
VERSION=1.2 VERSION=1.3
pushd "${0%/*}" &>/dev/null pushd "${0%/*}" &>/dev/null
@ -29,17 +29,18 @@ esac
case $SDK_VERSION in case $SDK_VERSION in
10.6*) TARGET=darwin10; X86_64H_SUPPORTED=0; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;; 10.6*) TARGET=darwin10; X86_64H_SUPPORTED=0; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;;
10.7*) TARGET=darwin11; X86_64H_SUPPORTED=0; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;; 10.7*) TARGET=darwin11; X86_64H_SUPPORTED=0; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;;
10.8*) TARGET=darwin12; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;; 10.8*) TARGET=darwin12; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;;
10.9*) TARGET=darwin13; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;; 10.9*) TARGET=darwin13; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;;
10.10*) TARGET=darwin14; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;; 10.10*) TARGET=darwin14; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=0; OSX_VERSION_MIN_INT=10.6; ;;
10.11*) TARGET=darwin15; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;; 10.11*) TARGET=darwin15; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;;
10.12*) TARGET=darwin16; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;; 10.12*) TARGET=darwin16; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;;
10.13*) TARGET=darwin17; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;; 10.13*) TARGET=darwin17; X86_64H_SUPPORTED=1; I386_SUPPORTED=1; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.6; ;;
10.14*) TARGET=darwin18; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;; 10.14*) TARGET=darwin18; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;;
10.15*) TARGET=darwin19; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;; 10.15*) TARGET=darwin19; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;;
10.16*) TARGET=darwin20; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;; 10.16*) TARGET=darwin20; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;;
11.0*) TARGET=darwin20; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9; ;;
*) echo "Unsupported SDK"; exit 1 ;; *) echo "Unsupported SDK"; exit 1 ;;
esac esac
@ -147,6 +148,16 @@ if [ $f_res -eq 1 ]; then
create_symlink $CCTOOL $CCTOOL_I386 create_symlink $CCTOOL $CCTOOL_I386
done done
fi fi
if [ $ARM_SUPPORTED -eq 1 ]; then
for CCTOOL in ${CCTOOLS[@]}; do
CCTOOL_ARM64=$(echo "$CCTOOL" | $SED 's/x86_64/arm64/g')
create_symlink $CCTOOL $CCTOOL_ARM64
done
for CCTOOL in ${CCTOOLS[@]}; do
CCTOOL_ARM64E=$(echo "$CCTOOL" | $SED 's/x86_64/arm64e/g')
create_symlink $CCTOOL $CCTOOL_ARM64E
done
fi
# For unpatched dsymutil. There is currently no way around it. # For unpatched dsymutil. There is currently no way around it.
create_symlink x86_64-apple-$TARGET-lipo lipo create_symlink x86_64-apple-$TARGET-lipo lipo
popd &>/dev/null popd &>/dev/null
@ -225,6 +236,7 @@ export LIBLTO_PATH
export LINKER_VERSION export LINKER_VERSION
export X86_64H_SUPPORTED export X86_64H_SUPPORTED
export I386_SUPPORTED export I386_SUPPORTED
export ARM_SUPPORTED
export TOP_BUILD_SCRIPT=1 export TOP_BUILD_SCRIPT=1
$BASE_DIR/wrapper/build_wrapper.sh $BASE_DIR/wrapper/build_wrapper.sh
@ -284,20 +296,36 @@ if [ $(osxcross-cmp $SDK_VERSION ">=" 10.7) -eq 1 ]; then
popd &>/dev/null popd &>/dev/null
echo "" echo ""
if [ $I386_SUPPORTED -eq 1 ]; then if [ $I386_SUPPORTED -eq 1 ]; then
test_compiler_cxx11 o32-clang++ $BASE_DIR/oclang/test_libcxx.cpp test_compiler_cxx11 i386-apple-$TARGET-clang++ $BASE_DIR/oclang/test_libcxx.cpp
fi fi
test_compiler_cxx11 o64-clang++ $BASE_DIR/oclang/test_libcxx.cpp test_compiler_cxx11 x86_64-apple-$TARGET-clang++ $BASE_DIR/oclang/test_libcxx.cpp
echo "" echo ""
fi fi
if [ $I386_SUPPORTED -eq 1 ]; then if [ $I386_SUPPORTED -eq 1 ]; then
test_compiler o32-clang $BASE_DIR/oclang/test.c test_compiler i386-apple-$TARGET-clang $BASE_DIR/oclang/test.c "required"
test_compiler o32-clang++ $BASE_DIR/oclang/test.cpp test_compiler i386-apple-$TARGET-clang++ $BASE_DIR/oclang/test.cpp "required"
echo "" echo ""
fi fi
test_compiler o64-clang $BASE_DIR/oclang/test.c if [ $X86_64H_SUPPORTED -eq 1 ]; then
test_compiler o64-clang++ $BASE_DIR/oclang/test.cpp test_compiler x86_64h-apple-$TARGET-clang $BASE_DIR/oclang/test.c
test_compiler x86_64h-apple-$TARGET-clang++ $BASE_DIR/oclang/test.cpp
echo ""
fi
if [ $ARM_SUPPORTED -eq 1 ]; then
test_compiler arm64-apple-$TARGET-clang $BASE_DIR/oclang/test.c
test_compiler arm64-apple-$TARGET-clang++ $BASE_DIR/oclang/test.cpp
echo ""
test_compiler arm64e-apple-$TARGET-clang $BASE_DIR/oclang/test.c
test_compiler arm64e-apple-$TARGET-clang++ $BASE_DIR/oclang/test.cpp
echo ""
fi
test_compiler x86_64-apple-$TARGET-clang $BASE_DIR/oclang/test.c "required"
test_compiler x86_64-apple-$TARGET-clang++ $BASE_DIR/oclang/test.cpp "required"
echo "" echo ""
echo "Do not forget to add" echo "Do not forget to add"

View File

@ -92,8 +92,6 @@ if [ $f_res -eq 1 ]; then
EXTRA_MAKE_FLAGS+="VERBOSE=1 " EXTRA_MAKE_FLAGS+="VERBOSE=1 "
fi fi
export OSXCROSS_NO_X86_64H_DEPLOYMENT_TARGET_WARNING=1
if [ $USE_CMAKE -eq 1 ]; then if [ $USE_CMAKE -eq 1 ]; then
### CMAKE ### ### CMAKE ###

View File

@ -148,7 +148,7 @@ else
fi fi
fi fi
SDKS=$(ls | grep "^MacOSX10.*" | grep -v "Patch") SDKS=$(ls | grep -E "^MacOSX11.*|^MacOSX10.*" | grep -v "Patch")
if [ -z "$SDKS" ]; then if [ -z "$SDKS" ]; then
echo "No SDK found" 1>&2 echo "No SDK found" 1>&2

View File

@ -433,10 +433,23 @@ function verbose_cmd()
function test_compiler() function test_compiler()
{ {
if [ "$3" != "required" ]; then
set +e
fi
echo -ne "testing $1 ... " echo -ne "testing $1 ... "
$1 $2 -O2 -Wall -o test $1 $2 -O2 -Wall -o test
if [ $? -eq 0 ]; then
rm test rm test
echo "works" echo "works"
else
echo "failed (ignored)"
fi
if [ "$3" != "required" ]; then
set -e
fi
} }
function test_compiler_cxx11() function test_compiler_cxx11()

View File

@ -6,9 +6,7 @@ source ./tools/tools.sh
popd &>/dev/null popd &>/dev/null
set +e set +e
if [ -z "$VERSION" ]; then if [ -n "$VERSION" ]; then
eval $(${TARGET_DIR}/bin/osxcross-conf 2>/dev/null)
if [ -n "$SDK_VERSION" ]; then if [ -n "$SDK_VERSION" ]; then
if [ -z "$X86_64H_SUPPORTED" ]; then if [ -z "$X86_64H_SUPPORTED" ]; then
if [ $(osxcross-cmp $SDK_VERSION ">=" 10.8) -eq 1 ]; then if [ $(osxcross-cmp $SDK_VERSION ">=" 10.8) -eq 1 ]; then
@ -24,6 +22,13 @@ if [ -z "$VERSION" ]; then
I386_SUPPORTED=0 I386_SUPPORTED=0
fi fi
fi fi
if [ -z "$ARM_SUPPORTED" ]; then
if [ $(osxcross-cmp $SDK_VERSION ">=" 11.0) -eq 1 ]; then
ARM_SUPPORTED=1
else
ARM_SUPPORTED=0
fi
fi
fi fi
fi fi
set -e set -e
@ -36,6 +41,9 @@ if [ -z "$X86_64H_SUPPORTED" ]; then
X86_64H_SUPPORTED=0 X86_64H_SUPPORTED=0
fi fi
if [ -z "$ARM_SUPPORTED" ]; then
ARM_SUPPORTED=0
fi
function create_wrapper_link function create_wrapper_link
{ {
@ -67,12 +75,20 @@ function create_wrapper_link
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \ verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"x86_64-apple-${TARGET}-${1}" "x86_64-apple-${TARGET}-${1}"
if [ $X86_64H_SUPPORTED -eq 1 ] && if ([[ $1 != gcc* ]] && [[ $1 != g++* ]] && [[ $1 != *gstdc++ ]]); then
([[ $1 != gcc* ]] && [[ $1 != g++* ]] && [[ $1 != *gstdc++ ]]); then if [ $X86_64H_SUPPORTED -eq 1 ]; then
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \ verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"x86_64h-apple-${TARGET}-${1}" "x86_64h-apple-${TARGET}-${1}"
fi fi
if [ $ARM_SUPPORTED -eq 1 ]; then
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"arm64-apple-${TARGET}-${1}"
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"arm64e-apple-${TARGET}-${1}"
fi
fi
if [ $# -ge 2 ] && [ $2 -eq 2 ]; then if [ $# -ge 2 ] && [ $2 -eq 2 ]; then
if [ $I386_SUPPORTED -eq 1 ]; then if [ $I386_SUPPORTED -eq 1 ]; then
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \ verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
@ -87,6 +103,13 @@ function create_wrapper_link
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \ verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"o64h-${1}" "o64h-${1}"
fi fi
if [ $ARM_SUPPORTED -eq 1 ]; then
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"oa64-${1}"
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper" \
"oa64e-${1}"
fi
fi fi
} }
@ -104,11 +127,9 @@ if [ -n "$BWPLATFORM" ]; then
#CXX=$(xcrun -f g++) #CXX=$(xcrun -f g++)
FLAGS+="-fvisibility-inlines-hidden " FLAGS+="-fvisibility-inlines-hidden "
elif [ $PLATFORM = "FreeBSD" -a $(uname -s) != "FreeBSD" ]; then elif [ $PLATFORM = "FreeBSD" -a $(uname -s) != "FreeBSD" ]; then
CXX=amd64-pc-freebsd10.1-clang++ CXX=amd64-pc-freebsd13.0-clang++
#CXX=amd64-pc-freebsd10.1-g++
elif [ $PLATFORM = "NetBSD" -a $(uname -s) != "NetBSD" ]; then elif [ $PLATFORM = "NetBSD" -a $(uname -s) != "NetBSD" ]; then
CXX=amd64-pc-netbsd6.1.3-clang++ CXX=amd64-pc-netbsd6.1.3-clang++
#CXX=amd64-pc-netbsd6.1.3-g++
fi fi
[ -z "$BWCOMPILEONLY" ] && BWCOMPILEONLY=1 [ -z "$BWCOMPILEONLY" ] && BWCOMPILEONLY=1

View File

@ -439,6 +439,10 @@ bool detectTarget(int argc, char **argv, Target &target) {
target.arch = Arch::x86_64h; target.arch = Arch::x86_64h;
else if (!strncmp(cmd, "o64", 3)) else if (!strncmp(cmd, "o64", 3))
target.arch = Arch::x86_64; target.arch = Arch::x86_64;
else if (!strncmp(cmd, "oa64", 4))
target.arch = Arch::arm64;
else if (!strncmp(cmd, "oa64e", 4))
target.arch = Arch::arm64e;
else else
return false; return false;

View File

@ -72,6 +72,10 @@ OSVersion Target::getSDKOSNum() const {
return OSVersion(); return OSVersion();
int n = atoi(target.c_str() + 6); int n = atoi(target.c_str() + 6);
if (n >= 20)
return OSVersion(11, n - 20);
else
return OSVersion(10, 4 + (n - 8)); return OSVersion(10, 4 + (n - 8));
} }
} }
@ -133,25 +137,30 @@ void Target::overrideDefaultSDKPath(const char *SDKSearchDir) {
} }
} }
bool Target::getSDKPath(std::string &path) const { bool Target::getSDKPath(std::string &path, bool MacOSX10_16Fix) const {
OSVersion SDKVer = getSDKOSNum();
if (SDK) { if (SDK) {
path = SDK; path = SDK;
} else { } else {
OSVersion SDKVer = getSDKOSNum(); if (MacOSX10_16Fix)
SDKVer = OSVersion(10, 16);
path = execpath; path = execpath;
path += "/../SDK/MacOSX"; path += "/../SDK/MacOSX";
path += SDKVer.shortStr(); path += SDKVer.shortStr();
if (SDKVer <= OSVersion(10, 4)) if (SDKVer <= OSVersion(10, 4))
path += "u"; path += "u";
path += ".sdk"; path += ".sdk";
} }
if (!dirExists(path)) { if (!dirExists(path)) {
// Some early 11.0 SDKs are misnamed as 10.16
if (SDKVer == OSVersion(11, 0) && !MacOSX10_16Fix)
return getSDKPath(path, true);
err << "cannot find Mac OS X SDK (expected in: " << path << ")" err << "cannot find Mac OS X SDK (expected in: " << path << ")"
<< err.endl(); << err.endl();
return false; return false;
} }
@ -505,35 +514,59 @@ bool Target::setup() {
setCompilerPath(); setCompilerPath();
if (!OSNum.Num()) { constexpr struct {
if (haveArch(Arch::x86_64h)) { Arch arch;
// Default to >= 10.8 for x86_64h OSVersion SDKVer;
OSVersion defaultMinTarget = getDefaultMinTarget(); bool lower;
OSNum = std::max(defaultMinTarget, OSVersion(10, 8)); } RequiredSDKVersion[] = {
if (SDKOSNum < OSNum) { { Arch::i386, {10, 13}, true },
err << "'" << getArchName(arch) << "' requires Mac OS X SDK " { Arch::x86_64h, {10, 8} },
<< OSNum.shortStr() << " (or later)" << err.endl(); { Arch::arm64, {11, 0} },
{ Arch::arm64e, {11, 0} },
};
for (auto &RequiredSDK : RequiredSDKVersion) {
if (haveArch(RequiredSDK.arch)) {
if (RequiredSDK.lower) {
if (SDKOSNum > RequiredSDK.SDKVer) {
err << "Architecture '" << getArchName(RequiredSDK.arch) << "' requires "
<< "Mac OS X <= '" << RequiredSDK.SDKVer.shortStr() << "' SDK"
<< err.endl();
return false; return false;
} }
} else if (stdlib == StdLib::libcxx) {
// Default to >= 10.7 for libc++
OSVersion defaultMinTarget = getDefaultMinTarget();
OSNum = std::max(defaultMinTarget, OSVersion(10, 7));
} else { } else {
OSNum = getDefaultMinTarget(); if (SDKOSNum < RequiredSDK.SDKVer) {
err << "Architecture '" << getArchName(RequiredSDK.arch) << "' requires "
<< "Mac OS X >= '" << RequiredSDK.SDKVer.shortStr() << "' SDK"
<< err.endl();
return false;
} }
} }
if (haveArch(Arch::x86_64h) && OSNum < OSVersion(10, 8)) { }
// -mmacosx-version-min= < 10.8 in combination with '-arch x86_64h' }
// may cause linker errors.
// Erroring here is really annoying, better risk linking errors instead if (!OSNum.Num()) {
// of enforcing '-mmacosx-version-min= >= 10.8'. OSVersion defaultMinTarget = getDefaultMinTarget();
if (!getenv("OSXCROSS_NO_X86_64H_DEPLOYMENT_TARGET_WARNING")) if (haveArch(Arch::arm64) || haveArch(Arch::arm64e)) {
warn << "'-mmacosx-version-min=' should be '>= 10.8' for architecture " // Default to >= 11.0 for arm64
<< "'" << getArchName(Arch::x86_64h) << "'" << warn.endl(); OSNum = std::max(defaultMinTarget, OSVersion(11, 0));
}
if (haveArch(Arch::x86_64h)) {
// Default to >= 10.8 for x86_64h
OSNum = std::max(OSNum, std::max(defaultMinTarget, OSVersion(10, 8)));
}
if (stdlib == StdLib::libcxx) {
// Default to >= 10.7 for libc++
OSNum = std::max(OSNum, std::max(defaultMinTarget, OSVersion(10, 7)));
}
if (!OSNum.Num())
OSNum = defaultMinTarget;
} }
if (stdlib == StdLib::unset) { if (stdlib == StdLib::unset) {
@ -776,12 +809,18 @@ bool Target::setup() {
if (OSNum.Num()) { if (OSNum.Num()) {
std::string tmp; std::string tmp;
tmp = "-mmacosx-version-min="; tmp = "-mmacosx-version-min=";
if (OSNum >= OSVersion(11, 0)) {
// Fix this once clang is able to parse 11.x
tmp += "10.16";
} else {
tmp += OSNum.Str(); tmp += OSNum.Str();
}
fargs.push_back(tmp); fargs.push_back(tmp);
} }
for (auto arch : targetarch) { for (auto arch : targetarch) {
bool is32bit = false; bool is32bit = false;
bool isArm = false;
switch (arch) { switch (arch) {
case Arch::i386: case Arch::i386:
@ -790,10 +829,16 @@ bool Target::setup() {
case Arch::i686: case Arch::i686:
is32bit = true; is32bit = true;
// falls through // falls through
case Arch::arm64:
isArm = true;
// falls through
case Arch::arm64e:
isArm = true;
// falls through
case Arch::x86_64: case Arch::x86_64:
case Arch::x86_64h: case Arch::x86_64h:
if (isGCC()) { if (isGCC()) {
if (arch == Arch::x86_64h) { if (arch != Arch::x86_64 && arch != Arch::i386) {
err << "gcc does not support architecture '" << getArchName(arch) err << "gcc does not support architecture '" << getArchName(arch)
<< "'" << err.endl(); << "'" << err.endl();
return false; return false;
@ -802,6 +847,7 @@ bool Target::setup() {
if (targetarch.size() > 1) if (targetarch.size() > 1)
break; break;
if (!isArm)
fargs.push_back(is32bit ? "-m32" : "-m64"); fargs.push_back(is32bit ? "-m32" : "-m64");
} else if (isClang()) { } else if (isClang()) {
if (usegcclibs && targetarch.size() > 1) if (usegcclibs && targetarch.size() > 1)

View File

@ -96,7 +96,7 @@ struct Target {
OSVersion getSDKOSNum() const; OSVersion getSDKOSNum() const;
void overrideDefaultSDKPath(const char *SDKSearchDir); void overrideDefaultSDKPath(const char *SDKSearchDir);
bool getSDKPath(std::string &path) const; bool getSDKPath(std::string &path, bool MacOSX10_16Fix = false) const;
bool getMacPortsDir(std::string &path) const; bool getMacPortsDir(std::string &path) const;
bool getMacPortsSysRootDir(std::string &path) const; bool getMacPortsSysRootDir(std::string &path) const;

View File

@ -392,6 +392,7 @@ enum Arch {
armv8, armv8,
arm64, arm64,
arm64v8, arm64v8,
arm64e,
i386, i386,
i486, i486,
i586, i586,
@ -405,9 +406,9 @@ enum Arch {
constexpr const char *ArchNames[] = { constexpr const char *ArchNames[] = {
"armv4t", "armv5", "armv6", "armv7", "armv7f", "armv7k", "armv7s", "armv4t", "armv5", "armv6", "armv7", "armv7f", "armv7k", "armv7s",
"amrv6m", "armv7m", "armv7em", "armv8", "arm64", "arm64v8", "i386", "amrv6m", "armv7m", "armv7em", "armv8", "arm64", "arm64v8", "arm64e",
"i486", "i586", "i686", "x86_64", "x86_64h", "ppc", "ppc64", "i386", "i486", "i586", "i686", "x86_64", "x86_64h", "ppc",
"unknown" "ppc64", "unknown"
}; };
constexpr const char *getArchName(Arch arch) { return ArchNames[arch]; } constexpr const char *getArchName(Arch arch) { return ArchNames[arch]; }