All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler
@ 2021-03-23 16:30 Jörg Krause
  2021-03-23 16:30 ` [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName" Jörg Krause
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jörg Krause @ 2021-03-23 16:30 UTC (permalink / raw)
  To: buildroot

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>
---
 package/pkg-meson.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index aafb441fae..a57820d4d2 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -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 \
-- 
2.31.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName"
  2021-03-23 16:30 [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Jörg Krause
@ 2021-03-23 16:30 ` Jörg Krause
  2021-04-03  9:05   ` Peter Korsgaard
  2021-03-28 20:56 ` [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Thomas Petazzoni
  2021-04-03  9:04 ` Peter Korsgaard
  2 siblings, 1 reply; 5+ messages in thread
From: Jörg Krause @ 2021-03-23 16:30 UTC (permalink / raw)
  To: buildroot

This reverts commit 9783c04aaf5e4fc94099772f1dc699a974ee6538.

This commit is actually a workaround to get Meson passing `-libstdc++`
to the C linker. The correct fix is to pass the host C++ compiler to
Meson instead of the host C compiler using the `CXX_FOR_BUILD` variable.

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 ...meson.build-fix-GenParseName-linking.patch | 38 -------------------
 1 file changed, 38 deletions(-)
 delete mode 100644 package/mpd/0002-src-tag-meson.build-fix-GenParseName-linking.patch

diff --git a/package/mpd/0002-src-tag-meson.build-fix-GenParseName-linking.patch b/package/mpd/0002-src-tag-meson.build-fix-GenParseName-linking.patch
deleted file mode 100644
index e120b3e4ea..0000000000
--- a/package/mpd/0002-src-tag-meson.build-fix-GenParseName-linking.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 4c37d0b316a15213381bd7e07c5dee7526471fc8 Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Mon, 1 Feb 2021 08:10:45 +0100
-Subject: [PATCH] src/tag/meson.build: fix GenParseName linking
-
-Set link_language to cpp for GenParseName to avoid the following build
-failure due to gcc being used to link a C and C++ source file:
-
-FAILED: src/tag/GenParseName
-/usr/bin/gcc  -o src/tag/GenParseName src/tag/GenParseName.p/GenParseName.cxx.o src/tag/GenParseName.p/Names.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1
-/usr/bin/ld: src/tag/GenParseName.p/GenParseName.cxx.o: in function `std::_Rb_tree<std::basic_string_view<char, std::char_traits<char> >, std::pair<std::basic_string_view<char, std::char_traits<char> > const, TagType>, std::_Select1st<std::pair<std::basic_string_view<char, std::char_traits<char> > const, TagType> >, std::less<std::basic_string_view<char, std::char_traits<char> > >, std::allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, TagType> > >::_M_erase(std::_Rb_tree_node<std::pair<std::basic_string_view<char, std::char_traits<char> > const, TagType> >*)':
-GenParseName.cxx:
-(.text._ZNSt8_Rb_treeISt17basic_string_viewIcSt11char_traitsIcEESt4pairIKS3_7TagTypeESt10_Select1stIS7_ESt4lessIS3_ESaIS7_EE8_M_eraseEPSt13_Rb_tree_nodeIS7_E[_ZNSt8_Rb_treeISt17basic_string_viewIcSt11char_traitsIcEESt4pairIKS3_7TagTypeESt10_Select1stIS7_ESt4lessIS3_ESaIS7_EE8_M_eraseEPSt13_Rb_tree_nodeIS7_E]+0x23): undefined reference to `operator delete(void*)'
-
-Fixes:
- - http://autobuild.buildroot.org/results/871e1362c44e5b68a149e6a5dd3caf99ea0d904a
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Upstream status: https://github.com/MusicPlayerDaemon/MPD/pull/1068]
----
- src/tag/meson.build | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/tag/meson.build b/src/tag/meson.build
-index 064eada18..4fda35e52 100644
---- a/src/tag/meson.build
-+++ b/src/tag/meson.build
-@@ -2,6 +2,7 @@ generate_parse_name = executable(
-   'GenParseName',
-   'GenParseName.cxx',
-   'Names.c',
-+  link_language: 'cpp',
-   native: true,
- )
- 
--- 
-2.29.2
-
-- 
2.31.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler
  2021-03-23 16:30 [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Jörg Krause
  2021-03-23 16:30 ` [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName" Jörg Krause
@ 2021-03-28 20:56 ` Thomas Petazzoni
  2021-04-03  9:04 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2021-03-28 20:56 UTC (permalink / raw)
  To: buildroot

On Tue, 23 Mar 2021 17:30:50 +0100
J?rg Krause <joerg.krause@embedded.rocks> wrote:

> 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>
> ---
>  package/pkg-meson.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, both applied!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler
  2021-03-23 16:30 [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Jörg Krause
  2021-03-23 16:30 ` [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName" Jörg Krause
  2021-03-28 20:56 ` [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Thomas Petazzoni
@ 2021-04-03  9:04 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-04-03  9:04 UTC (permalink / raw)
  To: buildroot

>>>>> "J?rg" == J?rg Krause <joerg.krause@embedded.rocks> writes:

 > 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>

Committed to 2020.02.x, 2020.11.x and 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName"
  2021-03-23 16:30 ` [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName" Jörg Krause
@ 2021-04-03  9:05   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-04-03  9:05 UTC (permalink / raw)
  To: buildroot

>>>>> "J?rg" == J?rg Krause <joerg.krause@embedded.rocks> writes:

 > This reverts commit 9783c04aaf5e4fc94099772f1dc699a974ee6538.
 > This commit is actually a workaround to get Meson passing `-libstdc++`
 > to the C linker. The correct fix is to pass the host C++ compiler to
 > Meson instead of the host C compiler using the `CXX_FOR_BUILD` variable.

 > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-03  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 16:30 [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Jörg Krause
2021-03-23 16:30 ` [Buildroot] [PATCH 2/2] Revert "package/mpd: fix build of GenParseName" Jörg Krause
2021-04-03  9:05   ` Peter Korsgaard
2021-03-28 20:56 ` [Buildroot] [PATCH 1/2] package/pkg-meson.mk: fix setting host C++ compiler Thomas Petazzoni
2021-04-03  9:04 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.