Skip to contentSkip to conversation

libio-pty-perl: Fix build with musl/clang

PATCH New Khem Raj 1 participant 1 message Apr 4, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libio-pty-perl: Fix build with musl/clang

recipe ptest results led to this issue where the tests would fail with clang but not with gcc, the reason is that clang find more errors and configure tests were failing. Fixes thusly, this also means that other patch to fix musl build is no longer needed as well.

---
 ...hecks-more-robust-within-shared-libs.patch | 54 +++++++++++++++++++
 ...Tty.xs-Do-not-mark-strlcpy-as-static.patch | 45 ----------------
 .../perl/libio-pty-perl_1.17.bb               |  3 +-
 3 files changed, 55 insertions(+), 47 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Make-function-checks-more-robust-within-shared-libs.patch
 delete mode 100644 meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch
meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Make-function-checks-more-robust-within-shared-libs.patch new file +54 -0
new file mode 100644
index 0000000000..13a9e3b884
@@ -0,0 +1,54 @@
+From 1735a78561dbe139fd138caef2d44d81f5494fe7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 4 Apr 2023 12:28:11 -0700
+Subject: [PATCH] Make function checks more robust within shared libs
+
+Previous attempt to error at link like was with
+
+https://github.com/toddr/IO-Tty/commit/1747cdf9f98cfd3aada9bf6c09f9d46297e18a5e
+
+this however causes issues with newer clang where it detects
+the assignment as -Wint-conversion warning which is treated at error
+and builds with clang fail. So this is an attempt to instruct
+linker explicitly to error out if the symbol is not found during link
+time when building a shared library, this fixes both the problems
+as reported in
+
+https://github.com/toddr/IO-Tty/issues/23
+
+as well as
+
+https://github.com/toddr/IO-Tty/pull/33#issuecomment-1260147256
+
+Upstream-Status: Submitted [https://github.com/toddr/IO-Tty/pull/33]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile.PL | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index eaf47e0..2e8338d 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -163,7 +163,8 @@ main ()
+ #if defined (__stub_$f) || defined (__stub___$f)
+ choke me
+ #else
+-f = $f ();
++f = $f;
++f();
+ #endif
+ 
+   ;
+@@ -173,7 +174,7 @@ ESQ
+ 
+   close(TST);
+   print "Looking for $f()" . "." x (13-length($f)) . " ";
+-  if (system("$cfg{'cc'} $flags $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) {
++  if (system("$cfg{'cc'} $flags -Wl,--no-undefined $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) {
+     print "not found.\n";
+   } else {
+     $define{"-DHAVE_\U$f"} = undef;
+-- 
+2.40.0
+
meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch deleted +0 -45

45 lines not on this page · raw message

meta-oe/recipes-devtools/perl/libio-pty-perl_1.17.bb +1 -2
index 684788f199..e5c1ec1c82 100644
@@ -4,9 +4,8 @@ LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
 LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=12;md5=b2562f94907eeb42e8ce9d45f628e587"
 
 SRC_URI = "http://www.cpan.org/modules/by-module/IO/IO-Tty-${PV}.tar.gz \
-           file://0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch \
+           file://0001-Make-function-checks-more-robust-within-shared-libs.patch \
            "
-
 SRC_URI[sha256sum] = "a5f1a83020bc5b5dd6c1b570f48c7546e0a8f7fac10a068740b03925ad9e14e8"
 
 S = "${WORKDIR}/IO-Tty-${PV}"
Signature · 1 line
2.40.0