diff mbox series

[v2] nativesdk-openssl: support multlib libdir

Message ID 20250821041909.1693041-1-hongxu.jia@windriver.com
State New
Headers show
Series [v2] nativesdk-openssl: support multlib libdir | expand

Commit Message

Hongxu Jia Aug. 21, 2025, 4:19 a.m. UTC
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(-)

Comments

Alexander Kanavin Aug. 24, 2025, 8:21 a.m. UTC | #1
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]
> -=-=-=-=-=-=-=-=-=-=-=-
>
hongxu Aug. 26, 2025, 3:09 a.m. UTC | #2
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
Randy MacLeod Sept. 8, 2025, 8 p.m. UTC | #3
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]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

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"