crossgcc: Add buildgcc support for Apple M1/M2 devices
GMP and IASL don't compile with the default compiler and linker flags: - GMP's check for the MacOS architecture hard coded x86_64 but it also needs to know about arm64. - iasl does some trickery on pointer alignment to save space(?), so we need to tell clang about it. Change-Id: If4cca9d3e55051a6121d992e5320bee1df17af9f Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80435 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
e9fd562a83
commit
a295ac1d44
|
@ -847,10 +847,11 @@ build_IASL() {
|
||||||
cd ../$IASL_DIR/generate/unix || exit 1
|
cd ../$IASL_DIR/generate/unix || exit 1
|
||||||
CFLAGS="$HOSTCFLAGS"
|
CFLAGS="$HOSTCFLAGS"
|
||||||
HOST="_LINUX"
|
HOST="_LINUX"
|
||||||
test "$UNAME" = "Darwin" && HOST="_APPLE"
|
test "$UNAME" = "Darwin" && HOST="_APPLE" && OPT_LDFLAGS="-Wl,-no_fixup_chains"
|
||||||
test "$UNAME" = "FreeBSD" && HOST="_FreeBSD"
|
test "$UNAME" = "FreeBSD" && HOST="_FreeBSD"
|
||||||
test "$UNAME" = "Cygwin" && HOST="_CYGWIN"
|
test "$UNAME" = "Cygwin" && HOST="_CYGWIN"
|
||||||
HOST="$HOST" CFLAGS="$CFLAGS" \
|
HOST="$HOST" CFLAGS="$CFLAGS" \
|
||||||
|
OPT_LDFLAGS="$OPT_LDFLAGS" \
|
||||||
OPT_CFLAGS="-O -D_FORTIFY_SOURCE=2 -D COREBOOT_TOOLCHAIN_VERSION='\"coreboot toolchain v$CROSSGCC_VERSION\"' " \
|
OPT_CFLAGS="-O -D_FORTIFY_SOURCE=2 -D COREBOOT_TOOLCHAIN_VERSION='\"coreboot toolchain v$CROSSGCC_VERSION\"' " \
|
||||||
$MAKE $JOBS CC="$(hostcc host)" iasl acpibin acpidump acpiexec acpihelp acpisrc acpixtract
|
$MAKE $JOBS CC="$(hostcc host)" iasl acpibin acpidump acpiexec acpihelp acpisrc acpixtract
|
||||||
mkdir -p "$DESTDIR$TARGETDIR/bin/"
|
mkdir -p "$DESTDIR$TARGETDIR/bin/"
|
||||||
|
@ -1143,6 +1144,8 @@ if [ "$UNAME" = "Darwin" ]; then
|
||||||
# so we're setting the ABI explicitly here.
|
# so we're setting the ABI explicitly here.
|
||||||
if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" -eq 1 ] 2>/dev/null; then
|
if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" -eq 1 ] 2>/dev/null; then
|
||||||
OPTIONS="ABI=64"
|
OPTIONS="ABI=64"
|
||||||
|
elif [ "$(sysctl -n hw.optional.arm64 2>/dev/null)" -eq 1 ] 2>/dev/null; then
|
||||||
|
OPTIONS="ABI=64"
|
||||||
else
|
else
|
||||||
OPTIONS="ABI=32"
|
OPTIONS="ABI=32"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue