All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] meson.bbclass: compile with --buildtype plain
@ 2018-01-17 19:22 Martin Kelly
  2018-01-17 19:22 ` [PATCH 2/3] meson.bbclass: include C{, XX}FLAGS in cross args Martin Kelly
  2018-01-17 19:22 ` [PATCH 3/3] meson.bbclass: add MESON_LINK_ARGS to vardeps Martin Kelly
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Kelly @ 2018-01-17 19:22 UTC (permalink / raw)
  To: openembedded-core

OE manages all the compile flags, so we don't want meson to inject its
own flags. Currently, it's injecting -O0 and causing build breaks when
security flags are enabled (because _FORTIFY_SOURCE requires an
optimized build and meson defaults to a debug -O0 build).

Add --buildtype plain so meson will not add its own optimization flags.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 meta/classes/meson.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 4a4c51f840..f9cee00c07 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -13,6 +13,7 @@ def noprefix(var, d):
     return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)

 MESONOPTS = " --prefix ${prefix} \
+              --buildtype plain \
               --bindir ${@noprefix('bindir', d)} \
               --sbindir ${@noprefix('sbindir', d)} \
               --datadir ${@noprefix('datadir', d)} \
--
2.11.0



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

* [PATCH 2/3] meson.bbclass: include C{, XX}FLAGS in cross args
  2018-01-17 19:22 [PATCH 1/3] meson.bbclass: compile with --buildtype plain Martin Kelly
@ 2018-01-17 19:22 ` Martin Kelly
  2018-01-17 19:22 ` [PATCH 3/3] meson.bbclass: add MESON_LINK_ARGS to vardeps Martin Kelly
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Kelly @ 2018-01-17 19:22 UTC (permalink / raw)
  To: openembedded-core

Currently, CFLAGS and CXXFLAGS are not making it into the compile line.
This is because meson appends CFLAGS/CXXFLAGS from the environment only
for native but not for cross builds (probably to keep cross-builds more
isolated). As a result, we need to make sure these vars goes into
meson.cross. This is similar to what cmake.bbclass does with
OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS.

Change c_args and cpp_args in meson.cross to include these vars, and
update write_config[vardeps] accordingly.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 meta/classes/meson.bbclass | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index f9cee00c07..4ab242dcfd 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -26,8 +26,10 @@ MESONOPTS = " --prefix ${prefix} \
               --localstatedir ${localstatedir} \
               --sharedstatedir ${sharedstatedir}"
 
-MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
-MESON_LINK_ARGS = "${MESON_C_ARGS} ${LDFLAGS}"
+MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
+MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
+MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
 
 # both are required but not used by meson
 MESON_HOST_ENDIAN = "bogus-endian"
@@ -42,7 +44,7 @@ def meson_array(var, d):
     return "', '".join(d.getVar(var).split()).join(("'", "'"))
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "MESON_C_ARGS TOOLCHAIN_OPTIONS"
+do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS TOOLCHAIN_OPTIONS"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
@@ -59,7 +61,7 @@ pkgconfig = 'pkg-config'
 needs_exe_wrapper = true
 c_args = [${@meson_array('MESON_C_ARGS', d)}]
 c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
-cpp_args = [${@meson_array('MESON_C_ARGS', d)}]
+cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}]
 cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
 gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
 
-- 
2.11.0



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

* [PATCH 3/3] meson.bbclass: add MESON_LINK_ARGS to vardeps
  2018-01-17 19:22 [PATCH 1/3] meson.bbclass: compile with --buildtype plain Martin Kelly
  2018-01-17 19:22 ` [PATCH 2/3] meson.bbclass: include C{, XX}FLAGS in cross args Martin Kelly
@ 2018-01-17 19:22 ` Martin Kelly
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Kelly @ 2018-01-17 19:22 UTC (permalink / raw)
  To: openembedded-core

Currently, we include MESON_C_ARGS in write_config[vardeps], but we
don't include MESON_LINK_ARGS, which also affects meson.cross. In
addition, we include TOOLCHAIN_OPTIONS, from which both are derived.

Add MESON_LINK_ARGS, and remove TOOLCHAIN_OPTIONS, which does not
directly appear in meson.cross and should be pulled in indirectly by
MESON_C_ARGS and MESON_LINK_ARGS.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 4ab242dcfd..91ac652651 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -44,7 +44,7 @@ def meson_array(var, d):
     return "', '".join(d.getVar(var).split()).join(("'", "'"))
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS TOOLCHAIN_OPTIONS"
+do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
-- 
2.11.0



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

end of thread, other threads:[~2018-01-17 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 19:22 [PATCH 1/3] meson.bbclass: compile with --buildtype plain Martin Kelly
2018-01-17 19:22 ` [PATCH 2/3] meson.bbclass: include C{, XX}FLAGS in cross args Martin Kelly
2018-01-17 19:22 ` [PATCH 3/3] meson.bbclass: add MESON_LINK_ARGS to vardeps Martin Kelly

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.