From fa54a1661a70724772f47add88ece12432cafc39 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 12 Oct 2020 20:47:47 +0100 Subject: [PATCH] depends: Add multilib paths for Linux cross-compile --- depends/hosts/linux.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index be6525e2c..fb2db9b76 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -15,3 +15,11 @@ i686_linux_CC=$(default_host_CC) -m32 i686_linux_CXX=$(default_host_CXX) -m32 x86_64_linux_CC=$(default_host_CC) -m64 x86_64_linux_CXX=$(default_host_CXX) -m64 + +# Clang doesn't appear to find these multilib paths by default, +# so help it out if we are cross-compiling. +ifneq ($(canonical_host),$(build)) + # CFLAGS is copied to CXXFLAGS after it is fully-evaluated. + linux_CFLAGS += -idirafter /usr/$(host)/include + linux_LDFLAGS += -L/usr/$(host)/lib +endif