From 96185e1ac0ea9b07656040b6fa025c90a6f34ed4 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 28 Nov 2023 22:31:51 -0800 Subject: [PATCH] Fix MODE=aarch64 cross-compiling This change fixes a regression that happened some time ago when building for AARCH64 using the vendored toolchain rather than cosmocc. The errors that would show up `Relocations in generic ELF (EM: 62)` have been fixed --- build/definitions.mk | 2 ++ third_party/python/BUILD.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/definitions.mk b/build/definitions.mk index 0fd70885f..fa29c5094 100644 --- a/build/definitions.mk +++ b/build/definitions.mk @@ -92,6 +92,8 @@ ARCH = x86_64 HOSTS ?= freebsd rhel7 xnu win10 openbsd netbsd endif +ZIPOBJ_FLAGS += -a$(ARCH) + ifeq ($(PREFIX),) ifeq ($(USE_SYSTEM_TOOLCHAIN),) ifeq ($(ARCH),x86_64) diff --git a/third_party/python/BUILD.mk b/third_party/python/BUILD.mk index dcaf2d867..055d7d46a 100644 --- a/third_party/python/BUILD.mk +++ b/third_party/python/BUILD.mk @@ -4193,7 +4193,7 @@ $(THIRD_PARTY_PYTHON_HELLO_OBJS): private PYFLAGS += -C2 -m # this directory entry is at the tip of the tree # therefore building it requires special care o/$(MODE)/third_party/python/Lib/.zip.o: third_party/python/.python - @$(COMPILE) -wAZIPOBJ $(ZIPOBJ) -C2 $(OUTPUT_OPTION) third_party/python/.python + @$(COMPILE) -wAZIPOBJ $(ZIPOBJ) -a$(ARCH) -C2 $(OUTPUT_OPTION) third_party/python/.python # these need to be explictly defined because landlock make won't sandbox # prerequisites with a trailing slash.