Skip to contentSkip to conversation

package/systemd: fix build on toolchain without C++

PATCH New james.hilliard1 at gmail.com 4 participants 4 messages Dec 29, 2018 – Jan 24, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/systemd: fix build on toolchain without C++

From: James Hilliard <[email protected]>

This is a backport from upstream.

---
Changes v1 -> v2:
- Fixup patch and change commit message

---
 ...-use-cross-compilation-compatible-c-check.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch
package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch new file +59 -0
new file mode 100644
index 0000000..b33e054
@@ -0,0 +1,59 @@
+From 180a940333c84495015bd5b24d41c1dbfff509f2 Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 27 Dec 2018 09:16:20 +0800
+Subject: [PATCH] meson: use cross compilation compatible c++ check
+
+[james.hilliard1 at gmail.com: backport from upstream]
+Signed-off-by: James Hilliard <[email protected]>
+---
+ meson.build             | 4 +---
+ src/systemd/meson.build | 3 +--
+ src/test/meson.build    | 2 +-
+ 3 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b338886..1964b1a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -287,10 +287,8 @@ want_tests = get_option('tests')
+ slow_tests = want_tests != 'false' and get_option('slow-tests')
+ install_tests = get_option('install-tests')
+ 
+-cxx = find_program('c++', required : fuzzer_build)
+-if cxx.found()
++if add_languages('cpp', required : fuzzer_build)
+         #  Used only for tests
+-        add_languages('cpp')
+         cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
+ else
+         cxx_cmd = ''
+diff --git a/src/systemd/meson.build b/src/systemd/meson.build
+index e0c967e..75c48b0 100644
+--- a/src/systemd/meson.build
++++ b/src/systemd/meson.build
+@@ -52,8 +52,7 @@ if cc.has_argument('-std=iso9899:2017')
+         opts += [['c', '-std=iso9899:2017']]
+ endif
+ 
+-cxx = find_program('c++', required : false)
+-if cxx.found()
++if add_languages('cpp', required : false)
+         opts += [['c++'],
+                  ['c++', '-std=c++98'],
+                  ['c++', '-std=c++11']]
+diff --git a/src/test/meson.build b/src/test/meson.build
+index ea049a6..d9d87e0 100644
+--- a/src/test/meson.build
++++ b/src/test/meson.build
+@@ -957,7 +957,7 @@ tests += [
+ 
+ ]
+ 
+-if cxx.found()
++if cxx_cmd != ''
+         tests += [
+                 [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
+                  [],
+-- 
+2.7.4
+
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 package/systemd: fix build on toolchain without C++

James, All,

On 2018-12-30 06:03 +0800, james.hilliard1 at gmail.com spake thusly:

Quoted 5 lines

From: James Hilliard <[email protected]>

This is a backport from upstream.

Better, thanks! :-)

Quoted 14 lines

---
Changes v1 -> v2:
- Fixup patch and change commit message

---
 ...-use-cross-compilation-compatible-c-check.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch
package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch new file +0 -0
new file mode 100644
index 0000000..b33e054

package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch line 6

Quoted 6 lines
package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch new file +6 -0
@@ -0,0 +1,59 @@
+From 180a940333c84495015bd5b24d41c1dbfff509f2 Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 27 Dec 2018 09:16:20 +0800
+Subject: [PATCH] meson: use cross compilation compatible c++ check
+
+[james.hilliard1 at gmail.com: backport from upstream]

Minor nit I forgot to mention: since you actually cgherry-picked it over the v240 tag, then the sha1 above it no longer the same as the one that was applied upstream, so it is customary to note the original upstream sha1 in this case. Sorry for the omission. :-/

[james.hilliard1 at gmail.com:
- backport from upstream 46e63a2a3ed46ce97430ce38e4cc0798c57900eb
]

With this fixed (which can be done by a maintainer before applying, no need to resend):

Regards,
Yann E. MORIN.

Quoted 56 lines
package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch new file +53 -0
+Signed-off-by: James Hilliard <[email protected]>
+---
+ meson.build             | 4 +---
+ src/systemd/meson.build | 3 +--
+ src/test/meson.build    | 2 +-
+ 3 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b338886..1964b1a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -287,10 +287,8 @@ want_tests = get_option('tests')
+ slow_tests = want_tests != 'false' and get_option('slow-tests')
+ install_tests = get_option('install-tests')
+ 
+-cxx = find_program('c++', required : fuzzer_build)
+-if cxx.found()
++if add_languages('cpp', required : fuzzer_build)
+         #  Used only for tests
+-        add_languages('cpp')
+         cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
+ else
+         cxx_cmd = ''
+diff --git a/src/systemd/meson.build b/src/systemd/meson.build
+index e0c967e..75c48b0 100644
+--- a/src/systemd/meson.build
++++ b/src/systemd/meson.build
+@@ -52,8 +52,7 @@ if cc.has_argument('-std=iso9899:2017')
+         opts += [['c', '-std=iso9899:2017']]
+ endif
+ 
+-cxx = find_program('c++', required : false)
+-if cxx.found()
++if add_languages('cpp', required : false)
+         opts += [['c++'],
+                  ['c++', '-std=c++98'],
+                  ['c++', '-std=c++11']]
+diff --git a/src/test/meson.build b/src/test/meson.build
+index ea049a6..d9d87e0 100644
+--- a/src/test/meson.build
++++ b/src/test/meson.build
+@@ -957,7 +957,7 @@ tests += [
+ 
+ ]
+ 
+-if cxx.found()
++if cxx_cmd != ''
+         tests += [
+                 [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
+                  [],
+-- 
+2.7.4
+
Signature · 1 line
2.7.4
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v2 1/1 package/systemd: fix build on toolchain without C++

In reply to james.hilliard1 at gmail.com

Hello,

Quoted 6 lines · On Sun, 30 Dec 2018 06:03:14 +0800, james.hilliard1 at gmail.com wrote:

From: James Hilliard <[email protected]>

This is a backport from upstream.

Quoted 7 lines

---
Changes v1 -> v2:
- Fixup patch and change commit message

---
 ...-use-cross-compilation-compatible-c-check.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 package/systemd/0003-meson-use-cross-compilation-compatible-c-check.patch

Applied to master after adjusting the patch description as suggested by Yann. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 1/1 package/systemd: fix build on toolchain without C++

In reply to james.hilliard1 at gmail.com
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"james" == james hilliard1 <[email protected]> writes:

From: James Hilliard <[email protected]>
This is a backport from upstream.

---
Changes v1 -> v2:
- Fixup patch and change commit message

Committed to 2018.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard