Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Böh via buildroot" <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: "Martin Böh" <contact@martb.dev>,
	"Gwenhael Goavec-Merou" <gwenhael.goavec-merou@trabucayre.com>
Subject: [Buildroot] [PATCH 2/2] package/gnuradio: remove pybind target suffix when crosscompiling
Date: Thu, 23 Feb 2023 21:15:11 +0100	[thread overview]
Message-ID: <20230223201511.217372-2-contact@martb.dev> (raw)
In-Reply-To: <20230223201511.217372-1-contact@martb.dev>

This is required as pybind11 uses host python3 and therefore the host platform suffixes.
Without this change gnuradio and all plugins relying on its GrPybind macros, use the wrong suffixes.
This leads to module load failures when crosscompiling.

See:
- https://github.com/gnuradio/gnuradio/issues/5455
- https://github.com/pybind/pybind11/issues/3640

Signed-off-by: Martin Böh <contact@martb.dev>
---
 ...nd-remove-suffix-when-crosscompiling.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/gnuradio/0001-grPyBind-remove-suffix-when-crosscompiling.patch

diff --git a/package/gnuradio/0001-grPyBind-remove-suffix-when-crosscompiling.patch b/package/gnuradio/0001-grPyBind-remove-suffix-when-crosscompiling.patch
new file mode 100644
index 0000000000..0ac4395e58
--- /dev/null
+++ b/package/gnuradio/0001-grPyBind-remove-suffix-when-crosscompiling.patch
@@ -0,0 +1,56 @@
+From c58760b002c1a954a9ab628352900fcd8e6e199c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20B=C3=B6h?= <contact@martb.dev>
+Date: Wed, 22 Feb 2023 03:05:08 +0100
+Subject: [PATCH] grPyBind: fix invalid suffix
+
+This is required as pybind11 uses host python3 and therefore the host platform suffixes.
+---
+ cmake/Modules/GrPybind.cmake | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/cmake/Modules/GrPybind.cmake b/cmake/Modules/GrPybind.cmake
+index 5a6fb7633..c2df17c2d 100644
+--- a/cmake/Modules/GrPybind.cmake
++++ b/cmake/Modules/GrPybind.cmake
+@@ -8,6 +8,12 @@ macro(GR_PYBIND_MAKE name updir filter files)
+                    ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ 
+     pybind11_add_module(${name}_python ${files})
++    
++    # Use normal .so suffix when crosscompiling
++    # See https://github.com/gnuradio/gnuradio/issues/5455
++    if (CMAKE_CROSSCOMPILING)
++        set_target_properties(${name}_python PROPERTIES SUFFIX ".so")
++    endif()
+ 
+     set(MODULE_NAME ${name})
+     if(${name} STREQUAL gr)
+@@ -135,6 +141,12 @@ macro(GR_PYBIND_MAKE_CHECK_HASH name updir filter files)
+ 
+     pybind11_add_module(${name}_python ${files})
+ 
++    # Use normal .so suffix when crosscompiling
++    # See https://github.com/gnuradio/gnuradio/issues/5455
++    if (CMAKE_CROSSCOMPILING)
++        set_target_properties(${name}_python PROPERTIES SUFFIX ".so")
++    endif()
++
+     set(MODULE_NAME ${name})
+     if(${name} STREQUAL gr)
+         set(MODULE_NAME "runtime")
+@@ -286,6 +298,12 @@ macro(GR_PYBIND_MAKE_OOT name updir filter files)
+ 
+     pybind11_add_module(${name}_python ${files})
+ 
++    # Use normal .so suffix when crosscompiling
++    # See https://github.com/gnuradio/gnuradio/issues/5455
++    if (CMAKE_CROSSCOMPILING)
++        set_target_properties(${name}_python PROPERTIES SUFFIX ".so")
++    endif()
++
+     set(MODULE_NAME ${name})
+     if(${name} STREQUAL gr)
+         set(MODULE_NAME "runtime")
+-- 
+2.39.1
+
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-02-23 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 20:15 [Buildroot] [PATCH 1/2] package/gnuradio: bump to 3.10.5.1 Martin Böh via buildroot
2023-02-23 20:15 ` Martin Böh via buildroot [this message]
2023-02-23 22:12   ` [Buildroot] [PATCH 2/2] package/gnuradio: remove pybind target suffix when crosscompiling Thomas Petazzoni via buildroot
2023-07-31 22:21     ` Thomas Petazzoni via buildroot
2023-07-31 22:20 ` [Buildroot] [PATCH 1/2] package/gnuradio: bump to 3.10.5.1 Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223201511.217372-2-contact@martb.dev \
    --to=buildroot@buildroot.org \
    --cc=contact@martb.dev \
    --cc=gwenhael.goavec-merou@trabucayre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox