All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fix environmemt files in SDK
@ 2021-10-25  3:37 Hsia-Jun Li
  2021-10-25  3:37 ` [PATCH v2 1/2] meson: move lang args to the right section Hsia-Jun Li
  2021-10-25  3:37 ` [PATCH v2 2/2] meson: install native file in sdk Hsia-Jun Li
  0 siblings, 2 replies; 3+ messages in thread
From: Hsia-Jun Li @ 2021-10-25  3:37 UTC (permalink / raw)
  To: openembedded-core; +Cc: Hsia-Jun(Randy) Li

From: "Hsia-Jun(Randy) Li" <randy.li@synaptics.com>

I am sorry I am very busy recently, so I don't have time
to add an QA test class this time. Thoses patches were
verified two days from mail last time, I just don't have
time to send them.

Changelog:
v2
The script generates native file in nativesdk should work now.

Hsia-Jun(Randy) Li (1):
  meson: install native file in sdk

Randy Li (1):
  meson: move lang args to the right section

 meta/recipes-devtools/meson/meson/meson-setup.py   |  8 ++++
 meta/recipes-devtools/meson/meson/meson-wrapper    |  1 +
 .../meson/nativesdk-meson_0.59.2.bb                | 52 +++++++++++++++++++++-
 3 files changed, 59 insertions(+), 2 deletions(-)

-- 
2.7.4



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

* [PATCH v2 1/2] meson: move lang args to the right section
  2021-10-25  3:37 [PATCH v2 0/2] fix environmemt files in SDK Hsia-Jun Li
@ 2021-10-25  3:37 ` Hsia-Jun Li
  2021-10-25  3:37 ` [PATCH v2 2/2] meson: install native file in sdk Hsia-Jun Li
  1 sibling, 0 replies; 3+ messages in thread
From: Hsia-Jun Li @ 2021-10-25  3:37 UTC (permalink / raw)
  To: openembedded-core; +Cc: Randy Li, Hsia-Jun Li

From: Randy Li <ayaka@soulik.info>

After meson 0.56.0, <lang>_args and <lang>_link_args would be
regarded as meson built-in options.

Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com>
---
 meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
index 0e76cc7..5657397 100644
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
+++ b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
@@ -24,12 +24,14 @@ nm = @NM
 strip = @STRIP
 pkgconfig = 'pkg-config'
 
-[properties]
-needs_exe_wrapper = true
+[built-in options]
 c_args = @CFLAGS
 c_link_args = @LDFLAGS
 cpp_args = @CPPFLAGS
 cpp_link_args = @LDFLAGS
+
+[properties]
+needs_exe_wrapper = true
 sys_root = @OECORE_TARGET_SYSROOT
 
 [host_machine]
-- 
2.7.4



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

* [PATCH v2 2/2] meson: install native file in sdk
  2021-10-25  3:37 [PATCH v2 0/2] fix environmemt files in SDK Hsia-Jun Li
  2021-10-25  3:37 ` [PATCH v2 1/2] meson: move lang args to the right section Hsia-Jun Li
@ 2021-10-25  3:37 ` Hsia-Jun Li
  1 sibling, 0 replies; 3+ messages in thread
From: Hsia-Jun Li @ 2021-10-25  3:37 UTC (permalink / raw)
  To: openembedded-core; +Cc: Hsia-Jun(Randy) Li

From: "Hsia-Jun(Randy) Li" <randy.li@synaptics.com>

Without a native environment file, find_program() can't
locate the native program inside SDK.

That stops wayland compositor using wayland scanner.

Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com>
---
 meta/recipes-devtools/meson/meson/meson-setup.py   |  8 ++++
 meta/recipes-devtools/meson/meson/meson-wrapper    |  1 +
 .../meson/nativesdk-meson_0.59.2.bb                | 46 ++++++++++++++++++++++
 3 files changed, 55 insertions(+)

diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py
index 7ac4e3a..daaa551 100755
--- a/meta/recipes-devtools/meson/meson/meson-setup.py
+++ b/meta/recipes-devtools/meson/meson/meson-setup.py
@@ -27,9 +27,17 @@ except KeyError:
 
 template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
 cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
+native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template')
+native_file = os.path.join(sysroot, 'usr/share/meson/meson.native')
 
 with open(template_file) as in_file:
     template = in_file.read()
     output = Template(template).substitute(Environ())
     with open(cross_file, "w") as out_file:
         out_file.write(output)
+
+with open(native_template_file) as in_file:
+    template = in_file.read()
+    output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']})
+    with open(native_file, "w") as out_file:
+        out_file.write(output)
diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index d4ffe60..d4b5187 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -11,4 +11,5 @@ unset CC CXX CPP LD AR NM STRIP
 
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
      --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
      "$@"
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
index 5657397..7b77041 100644
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
+++ b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
@@ -13,8 +13,54 @@ SRC_URI += "file://meson-setup.py \
 #   real paths by meson-setup.sh when the SDK is extracted.
 # - Some overrides aren't needed, since the SDK injects paths that take care of
 #   them.
+def var_list2str(var, d):
+    items = d.getVar(var).split()
+    return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items)
+
+def generate_native_link_template(d):
+    val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}',
+           '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
+           '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}',
+           '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
+           '-Wl,--allow-shlib-undefined'
+        ]
+    build_arch = d.getVar('BUILD_ARCH')
+    if 'x86_64' in build_arch:
+        loader = 'ld-linux-x86-64.so.2'
+    elif 'i686' in build_arch:
+        loader = 'ld-linux.so.2'
+    elif 'aarch64' in build_arch:
+        loader = 'ld-linux-aarch64.so.1'
+    elif 'ppc64le' in build_arch:
+        loader = 'ld64.so.2'
+
+    if loader:
+        val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader]
+
+    return repr(val)
+
 do_install:append() {
     install -d ${D}${datadir}/meson
+
+    cat >${D}${datadir}/meson/meson.native.template <<EOF
+[binaries]
+c = ${@meson_array('BUILD_CC', d)}
+cpp = ${@meson_array('BUILD_CXX', d)}
+ar = ${@meson_array('BUILD_AR', d)}
+nm = ${@meson_array('BUILD_NM', d)}
+strip = ${@meson_array('BUILD_STRIP', d)}
+readelf = ${@meson_array('BUILD_READELF', d)}
+pkgconfig = 'pkg-config-native'
+
+[built-in options]
+c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
+c_link_args = ${@generate_native_link_template(d)}
+cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
+cpp_link_args = ${@generate_native_link_template(d)}
+[properties]
+sys_root = '@OECORE_NATIVE_SYSROOT'
+EOF
+
     cat >${D}${datadir}/meson/meson.cross.template <<EOF
 [binaries]
 c = @CC
-- 
2.7.4



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

end of thread, other threads:[~2021-10-25  3:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25  3:37 [PATCH v2 0/2] fix environmemt files in SDK Hsia-Jun Li
2021-10-25  3:37 ` [PATCH v2 1/2] meson: move lang args to the right section Hsia-Jun Li
2021-10-25  3:37 ` [PATCH v2 2/2] meson: install native file in sdk Hsia-Jun Li

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.