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