package/pkg-meson.mk: fix setting host C++ compiler
authorJörg Krause <joerg.krause@embedded.rocks>
Tue, 23 Mar 2021 16:30:50 +0000 (17:30 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 28 Mar 2021 20:56:26 +0000 (22:56 +0200)
Commit f4a61d1ae23ec7729af3a8a165bbee45b6b9ef75 introduced CC_FOR_BUILD and
CXX_FOR_BUILD to avoid detecting ccache.

Both values are set to `HOSTCC`. This causes issues where C++ files are
compiled with the C compiler without passing the `stdc++` flag to the
linker, too.

Therefore, switch to pass the C++ compiler to CXX_FOR_BUILD.

Correctly fixes:
http://autobuild.buildroot.org/results/871e1362c44e5b68a149e6a5dd3caf99ea0d904a

Commit 9783c04aaf5e4fc94099772f1dc699a974ee6538 proposed a fix which in
fact is a workaround to get Meson to pass the `stdc++` flag to the C
linker.

A fellow-up commit will revert this commit, as it is no longer
needed.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/pkg-meson.mk

index aafb441fae4442b2ff376b1a26a2981166364014..a57820d4d296d6e7cb4e22d17399c5dfb0d0d4f3 100644 (file)
@@ -83,7 +83,7 @@ define $(2)_CONFIGURE_CMDS
            > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
        PATH=$$(BR_PATH) \
        CC_FOR_BUILD="$$(HOSTCC)" \
-       CXX_FOR_BUILD="$$(HOSTCC)" \
+       CXX_FOR_BUILD="$$(HOSTCXX)" \
        $$($$(PKG)_CONF_ENV) \
        $$(MESON) \
                --prefix=/usr \