meson: fix building host binaries with ccache 10984/head
authorAndre Heider <a.heider@gmail.com>
Sat, 11 Jan 2020 17:40:41 +0000 (18:40 +0100)
committerAndre Heider <a.heider@gmail.com>
Sat, 11 Jan 2020 17:49:17 +0000 (18:49 +0100)
With CONFIG_CCACHE, $HOSTCC is 'ccache gcc' while $TARGET_CC points to a
single wrapper script. Compiling target binaries with ccache works, but
doesn't for host binaries, because we need to supply an argv array for
argc > 1 in the meson cross file.

Always pass an array for the c and c++ compiler, and while at it, do it
for the target as well - just to be on the safe side if that ever
changes.

Fixes #10982.

Signed-off-by: Andre Heider <a.heider@gmail.com>
devel/meson/meson.mk
devel/meson/src/openwrt-cross.txt.in
devel/meson/src/openwrt-native.txt.in

index 7645284acdd1df3d4c04170b52e65d93ef04a6f9..16c6b16685fed136d14435c93cf67d2910e38178 100644 (file)
@@ -42,8 +42,8 @@ endef
 
 define Meson/CreateNativeFile
        $(STAGING_DIR_HOST)/bin/sed \
-               -e "s|@CC@|$(HOSTCC)|" \
-               -e "s|@CXX@|$(HOSTCXX)|" \
+               -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \
+               -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \
                -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
                -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
                -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
@@ -55,8 +55,8 @@ endef
 
 define Meson/CreateCrossFile
        $(STAGING_DIR_HOST)/bin/sed \
-               -e "s|@CC@|$(TARGET_CC)|" \
-               -e "s|@CXX@|$(TARGET_CXX)|" \
+               -e "s|@CC@|$(foreach BIN,$(TARGET_CC),'$(BIN)',)|" \
+               -e "s|@CXX@|$(foreach BIN,$(TARGET_CXX),'$(BIN)',)|" \
                -e "s|@AR@|$(TARGET_AR)|" \
                -e "s|@STRIP@|$(TARGET_CROSS)strip|" \
                -e "s|@NM@|$(TARGET_NM)|" \
index 63640585ff431eb6f6365e6054f38b18a569c626..f8c2db9dc0f68b10d3b5c197e1f2fe404bcf1ae8 100644 (file)
@@ -1,6 +1,6 @@
 [binaries]
-c = '@CC@'
-cpp = '@CXX@'
+c = [@CC@]
+cpp = [@CXX@]
 ar = '@AR@'
 strip = '@STRIP@'
 nm = '@NM@'
index 30990eb3c16b7efc6857ec5a5959b4356564b6c2..e5d5a26179cfefdc0fb3e05172c397946db952d6 100644 (file)
@@ -1,6 +1,6 @@
 [binaries]
-c = '@CC@'
-cpp = '@CXX@'
+c = [@CC@]
+cpp = [@CXX@]
 pkgconfig = '@PKGCONFIG@'
 
 [properties]