Skip to contentSkip to conversation

openssl: support for building nativesdk of mingw

PATCH In review Changqing Li 3 participants 4 messages Jan 4, 2021 – Jan 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: support for building nativesdk of mingw

* add support for mingw32
* Engines are installed in a slightly different path, which is urgly, patch it to make the path shorter

---
 ...ile.tmpl-don-t-add-prefix-for-libdir.patch | 32 +++++++++++++++++++
 .../openssl/openssl_1.1.1i.bb                 |  9 ++++--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl-don-t-add-prefix-for-libdir.patch
meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl-don-t-add-prefix-for-libdir.patch new file +32 -0
new file mode 100644
index 0000000000..028431b1b2
@@ -0,0 +1,32 @@
+From 8fe5c9421acfaff35b637e7ad55d1df598bb7081 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Tue, 22 Dec 2020 09:22:10 +0800
+Subject: [PATCH] unix-Makefile.tmpl: don't add prefix for libdir
+
+we pass libdir to Configure, don't use prefix again to
+avoid engineer dir set to:
+/opt/poky/3.2+snapshot/sysroots/x86_64-w64-mingw32/usr/opt/poky/3.2+snapshot/sysroots/x86_64-w64-mingw32/usr/lib/engines-1_1
+
+Upstream-Status: Inappropriate[oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Configurations/unix-Makefile.tmpl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
+index bbafb98..eecb63e 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -244,7 +244,7 @@ LIBDIR={- our $libdir = $config{libdir} || "lib";
+           File::Spec::Win32->file_name_is_absolute($libdir) ? "" : $libdir -}
+ ENGINESDIR_dev={- use File::Spec::Win32;
+                   our $enginesdir =
+-                      File::Spec::Win32->catdir($prefix,$libdir,
++                      File::Spec::Win32->catdir($libdir,
+                                                 "engines-$sover_dirname");
+                   our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
+                       File::Spec::Win32->splitpath($enginesdir, 1);
+-- 
+2.17.1
+
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +7 -2
index c63ba3c8e7..9465166ab1 100644
@@ -22,6 +22,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
 SRC_URI_append_class-nativesdk = " \
            file://environment.d-openssl.sh \
            "
+SRC_URI_append_mingw32_class-nativesdk = " \
+           file://0001-unix-Makefile.tmpl-don-t-add-prefix-for-libdir.patch \
+           "
 
 SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242"
 
@@ -116,6 +119,9 @@ do_configure () {
 	mingw32-x86_64)
 		target=mingw64
 		;;
+	mingw32-i686)
+		target=mingw
+		;;
 	esac
 
 	useprefix=${prefix}
@@ -198,8 +204,7 @@ FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf \
                       ${libdir}/ssl-1.1/openssl.cnf* \
                       "
 FILES_${PN}-engines = "${libdir}/engines-1.1"
-# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP)
-FILES_${PN}-engines_append_mingw32_class-nativesdk = " ${prefix}${libdir}/engines-1_1"
+FILES_${PN}-engines_mingw32_class-nativesdk = "${libdir}/engines-1_1"
 FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash"
 FILES_${PN} =+ "${libdir}/ssl-1.1/*"
 FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
Signature · 1 line
2.17.1
#1 lore raw

On Mon, 2021-01-04 at 16:13 +0800, Changqing Li wrote:
* add support for mingw32
* Engines are installed in a slightly different path, which is urgly, patch it to make the path shorter

---
 ...ile.tmpl-don-t-add-prefix-for-libdir.patch | 32 +++++++++++++++++++ .../openssl/openssl_1.1.1i.bb                 |  9 ++++--

 2 files changed, 39 insertions(+), 2 deletions(-)

 create mode 100644 meta/recipes-connectivity/openssl/files/0001-unix- Makefile.tmpl-don-t-add-prefix-for-libdir.patch

(quoted diff) +0 -0

Makefile.tmpl-don-t-add-prefix-for-libdir.patch b/meta/recipes- connectivity/openssl/files/0001-unix-Makefile.tmpl-don-t-add-prefix- for-libdir.patch
new file mode 100644
index 0000000000..028431b1b2
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- don-t-add-prefix-for-libdir.patch
@@ -0,0 +1,32 @@
+From 8fe5c9421acfaff35b637e7ad55d1df598bb7081 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]>
+Date: Tue, 22 Dec 2020 09:22:10 +0800
+Subject: [PATCH] unix-Makefile.tmpl: don't add prefix for libdir +
+we pass libdir to Configure, don't use prefix again to +avoid engineer dir set to:
+/opt/poky/3.2+snapshot/sysroots/x86_64-w64- mingw32/usr/opt/poky/3.2+snapshot/sysroots/x86_64-w64- mingw32/usr/lib/engines-1_1
+
+Upstream-Status: Inappropriate[oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>

+---
+ Configurations/unix-Makefile.tmpl | 2 +-

+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix- Makefile.tmpl
+index bbafb98..eecb63e 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -244,7 +244,7 @@ LIBDIR={- our $libdir = $config{libdir} || "lib"; +           File::Spec::Win32->file_name_is_absolute($libdir) ? "" :
$libdir -}
+ ENGINESDIR_dev={- use File::Spec::Win32;
+                   our $enginesdir =
+-                      File::Spec::Win32->catdir($prefix,$libdir, ++                      File::Spec::Win32->catdir($libdir, +                                                 "engines- $sover_dirname");
+                   our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
+                       File::Spec::Win32->splitpath($enginesdir, 1);
+--
+2.17.1
+

(quoted diff) +0 -0

b/meta/recipes-connectivity/openssl/openssl_1.1.1i.bb index c63ba3c8e7..9465166ab1 100644

meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +0 -0
@@ -22,6 +22,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-

${PV}.tar.gz \
 SRC_URI_append_class-nativesdk = " \
            file://environment.d-openssl.sh \
            "
+SRC_URI_append_mingw32_class-nativesdk = " \
+           file://0001-unix-Makefile.tmpl-don-t-add-prefix-for- libdir.patch \
+           "

 SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242"
@@ -116,6 +119,9 @@ do_configure () {
        mingw32-x86_64)
                target=mingw64
                ;;
+       mingw32-i686)
+               target=mingw
+               ;;
        esac

        useprefix=${prefix}
@@ -198,8 +204,7 @@ FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf \
                       ${libdir}/ssl-1.1/openssl.cnf* \
                       "
 FILES_${PN}-engines = "${libdir}/engines-1.1"
-# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES_${PN}-engines_append_mingw32_class-nativesdk = " ${prefix}${libdir}/engines-1_1" +FILES_${PN}-engines_mingw32_class-nativesdk = "${libdir}/engines-1_1" FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash" FILES_${PN} =+ "${libdir}/ssl-1.1/*" FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment- setup.d/openssl.sh

I'm not really sure we want this kind of patch in OE-Core, it might be more suited to meta-mingw. I suspect it will be a bit of a maintenance nightmare there too though. Adding Joshua to cc to see if he has any thoughts...

Cheers,

Richard

#2 lore raw
Quoted 104 lines · Richard Purdie

On Mon, 2021-01-04 at 16:13 +0800, Changqing Li wrote:
* add support for mingw32
* Engines are installed in a slightly different path, which is urgly, patch it to make the path shorter

---
  ...ile.tmpl-don-t-add-prefix-for-libdir.patch | 32 +++++++++++++++++++
  .../openssl/openssl_1.1.1i.bb                 |  9 ++++--
  2 files changed, 39 insertions(+), 2 deletions(-)

 create mode 100644 meta/recipes-connectivity/openssl/files/0001-unix-
Makefile.tmpl-don-t-add-prefix-for-libdir.patch

(quoted diff) +0 -0

Makefile.tmpl-don-t-add-prefix-for-libdir.patch b/meta/recipes- connectivity/openssl/files/0001-unix-Makefile.tmpl-don-t-add-prefix- for-libdir.patch
new file mode 100644
index 0000000000..028431b1b2

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +0 -0

don-t-add-prefix-for-libdir.patch

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +8 -0
@@ -0,0 +1,32 @@
+From 8fe5c9421acfaff35b637e7ad55d1df598bb7081 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Tue, 22 Dec 2020 09:22:10 +0800
+Subject: [PATCH] unix-Makefile.tmpl: don't add prefix for libdir
+
+we pass libdir to Configure, don't use prefix again to
+avoid engineer dir set to:
+/opt/poky/3.2+snapshot/sysroots/x86_64-w64-

mingw32/usr/opt/poky/3.2+snapshot/sysroots/x86_64-w64- mingw32/usr/lib/engines-1_1

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +9 -0
+
+Upstream-Status: Inappropriate[oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Configurations/unix-Makefile.tmpl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-

Makefile.tmpl
+index bbafb98..eecb63e 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -244,7 +244,7 @@ LIBDIR={- our $libdir = $config{libdir} || "lib"; +           File::Spec::Win32->file_name_is_absolute($libdir) ? "" :
$libdir -}
+ ENGINESDIR_dev={- use File::Spec::Win32;
+                   our $enginesdir =
+-                      File::Spec::Win32->catdir($prefix,$libdir, ++                      File::Spec::Win32->catdir($libdir, +                                                 "engines- $sover_dirname");
+                   our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
+                       File::Spec::Win32->splitpath($enginesdir, 1);
+--
+2.17.1

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +1 -0
+
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +3 -0
index c63ba3c8e7..9465166ab1 100644
@@ -22,6 +22,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-
 ${PV}.tar.gz \
  SRC_URI_append_class-nativesdk = " \
             file://environment.d-openssl.sh \
             "
+SRC_URI_append_mingw32_class-nativesdk = " \
+           file://0001-unix-Makefile.tmpl-don-t-add-prefix-for-
 libdir.patch \
+           "
 

 SRC_URI[sha256sum] =
"e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242"

meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +3 -2
@@ -116,6 +119,9 @@ do_configure () {
         mingw32-x86_64)
                 target=mingw64
                 ;;
+       mingw32-i686)
+               target=mingw
+               ;;
         esac
 
         useprefix=${prefix}
@@ -198,8 +204,7 @@ FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf
 \
                        ${libdir}/ssl-1.1/openssl.cnf* \
                        "
  FILES_${PN}-engines = "${libdir}/engines-1.1"
-# ${prefix} comes from what we pass into --prefix at configure time
 (which is used for INSTALLTOP)
-FILES_${PN}-engines_append_mingw32_class-nativesdk = "

${prefix}${libdir}/engines-1_1" +FILES_${PN}-engines_mingw32_class-nativesdk = "${libdir}/engines-1_1"
 FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash" FILES_${PN} =+ "${libdir}/ssl-1.1/*" FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-
setup.d/openssl.sh

Quoted 4 lines

I'm not really sure we want this kind of patch in OE-Core, it might be more suited to meta-mingw. I suspect it will be a bit of a maintenance nightmare there too though. Adding Joshua to cc to see if he has any thoughts...

Can you provide some background on why openSSL is needed in the SDK? It would help with making a decision.

Quoted 6 lines

Cheers,

Richard

#3 lore raw
Quoted 103 lines · Joshua Watt
Quoted 101 lines · Richard Purdie

On Mon, 2021-01-04 at 16:13 +0800, Changqing Li wrote:
* add support for mingw32
* Engines are installed in a slightly different path, which is urgly, patch it to make the path shorter

---
  ...ile.tmpl-don-t-add-prefix-for-libdir.patch | 32 +++++++++++++++++++ .../openssl/openssl_1.1.1i.bb                 |  9 ++++--

  2 files changed, 39 insertions(+), 2 deletions(-)

  create mode 100644 meta/recipes-connectivity/openssl/files/0001-unix- Makefile.tmpl-don-t-add-prefix-for-libdir.patch

(quoted diff) +0 -0

Makefile.tmpl-don-t-add-prefix-for-libdir.patch b/meta/recipes- connectivity/openssl/files/0001-unix-Makefile.tmpl-don-t-add-prefix- for-libdir.patch
new file mode 100644
index 0000000000..028431b1b2

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +0 -0

don-t-add-prefix-for-libdir.patch

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +8 -0
@@ -0,0 +1,32 @@
+From 8fe5c9421acfaff35b637e7ad55d1df598bb7081 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Tue, 22 Dec 2020 09:22:10 +0800
+Subject: [PATCH] unix-Makefile.tmpl: don't add prefix for libdir
+
+we pass libdir to Configure, don't use prefix again to
+avoid engineer dir set to:
+/opt/poky/3.2+snapshot/sysroots/x86_64-w64-

mingw32/usr/opt/poky/3.2+snapshot/sysroots/x86_64-w64- mingw32/usr/lib/engines-1_1

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +9 -0
+
+Upstream-Status: Inappropriate[oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Configurations/unix-Makefile.tmpl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-

Makefile.tmpl
+index bbafb98..eecb63e 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -244,7 +244,7 @@ LIBDIR={- our $libdir = $config{libdir} || "lib"; +           File::Spec::Win32->file_name_is_absolute($libdir) ? "" :
$libdir -}
+ ENGINESDIR_dev={- use File::Spec::Win32;
+                   our $enginesdir =
+- File::Spec::Win32->catdir($prefix,$libdir,
++                      File::Spec::Win32->catdir($libdir, +                                                 "engines- $sover_dirname");
+                   our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
+ File::Spec::Win32->splitpath($enginesdir, 1);
+--
+2.17.1

meta/recipes-connectivity/openssl/files/0001-unix-Makefile.tmpl- new file +1 -0
+
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +0 -0
index c63ba3c8e7..9465166ab1 100644
@@ -22,6 +22,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-
 ${PV}.tar.gz \
   SRC_URI_append_class-nativesdk = " \
              file://environment.d-openssl.sh \

             "
+SRC_URI_append_mingw32_class-nativesdk = " \
+           file://0001-unix-Makefile.tmpl-don-t-add-prefix-for- libdir.patch \
+           "
    SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242" @@ -116,6 +119,9 @@ do_configure () {
         mingw32-x86_64)
                 target=mingw64
                 ;;
+       mingw32-i686)
+               target=mingw
+               ;;
         esac
           useprefix=${prefix}

meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +0 -0
@@ -198,8 +204,7 @@ FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf
 \
                         ${libdir}/ssl-1.1/openssl.cnf* \

                        "
  FILES_${PN}-engines = "${libdir}/engines-1.1"
-# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES_${PN}-engines_append_mingw32_class-nativesdk = " ${prefix}${libdir}/engines-1_1" +FILES_${PN}-engines_mingw32_class-nativesdk = "${libdir}/engines-1_1" FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash" FILES_${PN} =+ "${libdir}/ssl-1.1/*" FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment- setup.d/openssl.sh

Quoted 6 lines
Quoted 4 lines

I'm not really sure we want this kind of patch in OE-Core, it might be more suited to meta-mingw. I suspect it will be a bit of a maintenance nightmare there too though. Adding Joshua to cc to see if he has any thoughts...

Can you provide some background on why openSSL is needed in the SDK? It would help with making a decision.

Actually,  I don't have special background. Just know should be a request from some customer that bitbake nativesdk-openssl cannot build success.

Joshua,  I have send a patch to meta-mingw layer,  please review it there if we need this patch. Thanks.

Quoted 8 lines
Quoted 8 lines

Cheers,

Richard