All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nativesdk-openssl: support multlib libdir
@ 2025-08-20 14:37 Hongxu Jia
  2025-08-21  4:19 ` [PATCH v2] " Hongxu Jia
  0 siblings, 1 reply; 5+ messages in thread
From: Hongxu Jia @ 2025-08-20 14:37 UTC (permalink / raw)
  To: openembedded-core

Make nativesdk-openssl to support multlib libdir (such as
sdk-relocation-dir/usr/lib64 or sdk-relocation-dir/usr/lib)
other than hard code `relocation-dir/usr/lib', add environment
variable OPENSSL_LIBDIR in environment-setup.d script for
OPENSSL_CONF, OPENSSL_MODULES and OPENSSL_ENGINES

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../openssl/files/environment.d-openssl.sh             | 10 +++++-----
 meta/recipes-connectivity/openssl/openssl_3.5.2.bb     |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
index 71d378734c2..108937e2cd2 100644
--- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
+++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
@@ -1,6 +1,6 @@
-export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/openssl.cnf"
-export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
-export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
+export OPENSSL_CONF="$OPENSSL_LIBDIR/ssl-3/openssl.cnf"
+export OPENSSL_MODULES="$OPENSSL_LIBDIR/ossl-modules/"
+export OPENSSL_ENGINES="$OPENSSL_LIBDIR/engines-3"
 export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS:-} OPENSSL_CONF OPENSSL_MODULES OPENSSL_ENGINES"
 
 # Respect host env SSL_CERT_FILE/SSL_CERT_DIR first, then auto-detected host cert, then cert in buildtools
@@ -9,7 +9,7 @@ if [ -z "$SSL_CERT_FILE" ]; then
 	if [ -n "$CAFILE" ];then
 		export SSL_CERT_FILE="$CAFILE"
 	elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
-		export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs/ca-certificates.crt"
+		export SSL_CERT_FILE="$OPENSSL_LIBDIR/ssl-3/certs/ca-certificates.crt"
 	fi
 fi
 
@@ -17,7 +17,7 @@ if [ -z "$SSL_CERT_DIR" ]; then
 	if [ -n "$CAPATH" ];then
 		export SSL_CERT_DIR="$CAPATH"
 	elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
-		export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs"
+		export SSL_CERT_DIR="$OPENSSL_LIBDIR/ssl-3/certs"
 	fi
 fi
 
diff --git a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
index 396e69d7e7f..b650767f4c3 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
@@ -201,7 +201,9 @@ do_install:append:class-native () {
 
 do_install:append:class-nativesdk () {
 	mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
-	install -m 644 ${UNPACKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+	echo "export OPENSSL_LIBDIR=\"${libdir}\"" > ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+	cat ${UNPACKDIR}/environment.d-openssl.sh >> ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+	chmod 0644 ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
 }
 
 PTEST_BUILD_HOST_FILES += "configdata.pm"
-- 
2.34.1



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

* [PATCH v2] nativesdk-openssl: support multlib libdir
  2025-08-20 14:37 [PATCH] nativesdk-openssl: support multlib libdir Hongxu Jia
@ 2025-08-21  4:19 ` Hongxu Jia
  2025-08-24  8:21   ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 5+ messages in thread
From: Hongxu Jia @ 2025-08-21  4:19 UTC (permalink / raw)
  To: openembedded-core

Make nativesdk-openssl to support multlib libdir (such as
sdk-relocation-dir/usr/lib64 or sdk-relocation-dir/usr/lib)
other than hard code `relocation-dir/usr/lib', add environment
variable OPENSSL_LIBDIR in environment-setup.d script for
OPENSSL_CONF, OPENSSL_MODULES and OPENSSL_ENGINES

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../openssl/files/environment.d-openssl.sh            | 11 ++++++-----
 meta/recipes-connectivity/openssl/openssl_3.5.2.bb    |  1 +
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
index 71d378734c2..945151e1e2c 100644
--- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
+++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
@@ -1,6 +1,7 @@
-export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/openssl.cnf"
-export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
-export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
+export OPENSSL_LIBDIR="@OPENSSL_LIBDIR@"
+export OPENSSL_CONF="$OPENSSL_LIBDIR/ssl-3/openssl.cnf"
+export OPENSSL_MODULES="$OPENSSL_LIBDIR/ossl-modules/"
+export OPENSSL_ENGINES="$OPENSSL_LIBDIR/engines-3"
 export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS:-} OPENSSL_CONF OPENSSL_MODULES OPENSSL_ENGINES"
 
 # Respect host env SSL_CERT_FILE/SSL_CERT_DIR first, then auto-detected host cert, then cert in buildtools
@@ -9,7 +10,7 @@ if [ -z "$SSL_CERT_FILE" ]; then
 	if [ -n "$CAFILE" ];then
 		export SSL_CERT_FILE="$CAFILE"
 	elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
-		export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs/ca-certificates.crt"
+		export SSL_CERT_FILE="$OPENSSL_LIBDIR/ssl-3/certs/ca-certificates.crt"
 	fi
 fi
 
@@ -17,7 +18,7 @@ if [ -z "$SSL_CERT_DIR" ]; then
 	if [ -n "$CAPATH" ];then
 		export SSL_CERT_DIR="$CAPATH"
 	elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
-		export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs"
+		export SSL_CERT_DIR="$OPENSSL_LIBDIR/ssl-3/certs"
 	fi
 fi
 
diff --git a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
index 396e69d7e7f..23cc9b6f450 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
@@ -202,6 +202,7 @@ do_install:append:class-native () {
 do_install:append:class-nativesdk () {
 	mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
 	install -m 644 ${UNPACKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+	sed -i 's#@OPENSSL_LIBDIR@#${libdir}#g' ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
 }
 
 PTEST_BUILD_HOST_FILES += "configdata.pm"
-- 
2.34.1



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

* Re: [OE-core] [PATCH v2] nativesdk-openssl: support multlib libdir
  2025-08-21  4:19 ` [PATCH v2] " Hongxu Jia
@ 2025-08-24  8:21   ` Alexander Kanavin
  2025-08-26  3:09     ` hongxu
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2025-08-24  8:21 UTC (permalink / raw)
  To: hongxu.jia; +Cc: openembedded-core

I don't understand. Why and when would nativesdk openssl need to be
supporting multilib? It always installs and uses a single libdir.

Alex

On Thu, 21 Aug 2025 at 06:19, hongxu via lists.openembedded.org
<hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
>
> Make nativesdk-openssl to support multlib libdir (such as
> sdk-relocation-dir/usr/lib64 or sdk-relocation-dir/usr/lib)
> other than hard code `relocation-dir/usr/lib', add environment
> variable OPENSSL_LIBDIR in environment-setup.d script for
> OPENSSL_CONF, OPENSSL_MODULES and OPENSSL_ENGINES
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  .../openssl/files/environment.d-openssl.sh            | 11 ++++++-----
>  meta/recipes-connectivity/openssl/openssl_3.5.2.bb    |  1 +
>  2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> index 71d378734c2..945151e1e2c 100644
> --- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> +++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> @@ -1,6 +1,7 @@
> -export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/openssl.cnf"
> -export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
> -export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
> +export OPENSSL_LIBDIR="@OPENSSL_LIBDIR@"
> +export OPENSSL_CONF="$OPENSSL_LIBDIR/ssl-3/openssl.cnf"
> +export OPENSSL_MODULES="$OPENSSL_LIBDIR/ossl-modules/"
> +export OPENSSL_ENGINES="$OPENSSL_LIBDIR/engines-3"
>  export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS:-} OPENSSL_CONF OPENSSL_MODULES OPENSSL_ENGINES"
>
>  # Respect host env SSL_CERT_FILE/SSL_CERT_DIR first, then auto-detected host cert, then cert in buildtools
> @@ -9,7 +10,7 @@ if [ -z "$SSL_CERT_FILE" ]; then
>         if [ -n "$CAFILE" ];then
>                 export SSL_CERT_FILE="$CAFILE"
>         elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
> -               export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs/ca-certificates.crt"
> +               export SSL_CERT_FILE="$OPENSSL_LIBDIR/ssl-3/certs/ca-certificates.crt"
>         fi
>  fi
>
> @@ -17,7 +18,7 @@ if [ -z "$SSL_CERT_DIR" ]; then
>         if [ -n "$CAPATH" ];then
>                 export SSL_CERT_DIR="$CAPATH"
>         elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
> -               export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs"
> +               export SSL_CERT_DIR="$OPENSSL_LIBDIR/ssl-3/certs"
>         fi
>  fi
>
> diff --git a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
> index 396e69d7e7f..23cc9b6f450 100644
> --- a/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
> +++ b/meta/recipes-connectivity/openssl/openssl_3.5.2.bb
> @@ -202,6 +202,7 @@ do_install:append:class-native () {
>  do_install:append:class-nativesdk () {
>         mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
>         install -m 644 ${UNPACKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
> +       sed -i 's#@OPENSSL_LIBDIR@#${libdir}#g' ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
>  }
>
>  PTEST_BUILD_HOST_FILES += "configdata.pm"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#222203): https://lists.openembedded.org/g/openembedded-core/message/222203
> Mute This Topic: https://lists.openembedded.org/mt/114812592/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

* Re: [PATCH v2] nativesdk-openssl: support multlib libdir
  2025-08-24  8:21   ` [OE-core] " Alexander Kanavin
@ 2025-08-26  3:09     ` hongxu
  2025-09-08 20:00       ` [OE-core] " Randy MacLeod
  0 siblings, 1 reply; 5+ messages in thread
From: hongxu @ 2025-08-26  3:09 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

It is customized locally, such as use 64 bit nativesdk-gcc to build 32bit application

I have sent the patches months ago [1], but it is not suitable for Yocto, because the implement is complicated and the scope of use is small
So we support it locally, but we need Yocto SDK to support the ability of multilib extension

Commit  [2]  is the similar patch to support the ability of multilib extension

[1] https://lists.openembedded.org/g/openembedded-core/topic/110767332#msg210201
[2] https://git.openembedded.org/openembedded-core/commit/?id=703187755244b1a45dd9f90aeaf620d4c92a6757

//Hongxu

[-- Attachment #2: Type: text/html, Size: 1028 bytes --]

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

* Re: [OE-core] [PATCH v2] nativesdk-openssl: support multlib libdir
  2025-08-26  3:09     ` hongxu
@ 2025-09-08 20:00       ` Randy MacLeod
  0 siblings, 0 replies; 5+ messages in thread
From: Randy MacLeod @ 2025-09-08 20:00 UTC (permalink / raw)
  To: hongxu.jia, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

On 2025-08-25 11:09 p.m., hongxu via lists.openembedded.org wrote:
> It is customized locally, such as use 64 bit nativesdk-gcc to build 
> 32bit application
> I have sent the patches months ago [1], but it is not suitable for 
> Yocto, because the implement is complicated and the scope of use is small


Right. Yocto does not and will not support this.


WR should continue to send patches but they should be marked at RFC or 
FYI with a
comment that the feature is not supported in oe-core but other users 
might find the

patch useful.


../Randy




> So we support it locally, but we need Yocto SDK to support the ability 
> of multilib extension
> Commit  [2]  is the similar patch to support the ability of multilib 
> extension
> [1] 
> https://lists.openembedded.org/g/openembedded-core/topic/110767332#msg210201
> [2] 
> https://git.openembedded.org/openembedded-core/commit/?id=703187755244b1a45dd9f90aeaf620d4c92a6757
> //Hongxu
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#222429):https://lists.openembedded.org/g/openembedded-core/message/222429
> Mute This Topic:https://lists.openembedded.org/mt/114812592/3616765
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

-- 
# Randy MacLeod
# Wind River Linux

[-- Attachment #2: Type: text/html, Size: 3244 bytes --]

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

end of thread, other threads:[~2025-09-08 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 14:37 [PATCH] nativesdk-openssl: support multlib libdir Hongxu Jia
2025-08-21  4:19 ` [PATCH v2] " Hongxu Jia
2025-08-24  8:21   ` [OE-core] " Alexander Kanavin
2025-08-26  3:09     ` hongxu
2025-09-08 20:00       ` [OE-core] " Randy MacLeod

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.