[v2,09/12] package/glibc: use GCC cross-compiler if Clang is used as cross-compiler
diff mbox series

Message ID 20190907094027.9537-10-romain.naour@smile.fr
State New
Headers show
Series
  • Add the support for Clang cross-compiler
Related show

Commit Message

Romain Naour Sept. 7, 2019, 9:40 a.m. UTC
When BR2_USER_HOST_CLANG_AS_CROSS_COMPILER=y (added in the next patch),
TARGET_CONFIGURE_OPTS contains CC, CPP, CXX set to the path to clang
cross-compiler:

TARGET_CC = $(HOST_DIR)/bin/clang
TARGET_CPP = $(HOST_DIR)/bin/clang-cpp
TARGET_CXX = $(HOST_DIR)/bin/clang++

Since Glibc likely need a GCC toolchain to build, explicitely set theses
variables while configuring glibc package (GLIBC_CONFIGURE_CMDS).

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 package/glibc/glibc.mk | 5 +++++
 1 file changed, 5 insertions(+)

Patch
diff mbox series

diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index 9421f9fd81..131439c593 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -104,11 +104,16 @@  GLIBC_CONF_ENV += ac_cv_prog_MAKE="$(BR2_MAKE)"
 # Note that as mentionned in
 # http://patches.openembedded.org/patch/38849/, glibc must be
 # built with -O2, so we pass our own CFLAGS and CXXFLAGS below.
+# Use GCC cross-compiler if Clang is used as cross-compiler.
 define GLIBC_CONFIGURE_CMDS
 	mkdir -p $(@D)/build
 	# Do the configuration
 	(cd $(@D)/build; \
 		$(TARGET_CONFIGURE_OPTS) \
+		CC="$(TARGET_CROSS)gcc" \
+		GCC="$(TARGET_CROSS)gcc" \
+		CPP="$(TARGET_CROSS)cpp" \
+		CXX="$(TARGET_CROSS)g++" \
 		CFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \
 		CXXFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" \
 		$(GLIBC_CONF_ENV) \