diff options
3 files changed, 55 insertions, 47 deletions
diff --git a/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Make-function-checks-more-robust-within-shared-libs.patch b/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Make-function-checks-more-robust-within-shared-libs.patch new file mode 100644 index 0000000000..13a9e3b884 --- /dev/null +++ b/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Make-function-checks-more-robust-within-shared-libs.patch | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | From 1735a78561dbe139fd138caef2d44d81f5494fe7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 4 Apr 2023 12:28:11 -0700 | ||
| 4 | Subject: [PATCH] Make function checks more robust within shared libs | ||
| 5 | |||
| 6 | Previous attempt to error at link like was with | ||
| 7 | |||
| 8 | https://github.com/toddr/IO-Tty/commit/1747cdf9f98cfd3aada9bf6c09f9d46297e18a5e | ||
| 9 | |||
| 10 | this however causes issues with newer clang where it detects | ||
| 11 | the assignment as -Wint-conversion warning which is treated at error | ||
| 12 | and builds with clang fail. So this is an attempt to instruct | ||
| 13 | linker explicitly to error out if the symbol is not found during link | ||
| 14 | time when building a shared library, this fixes both the problems | ||
| 15 | as reported in | ||
| 16 | |||
| 17 | https://github.com/toddr/IO-Tty/issues/23 | ||
| 18 | |||
| 19 | as well as | ||
| 20 | |||
| 21 | https://github.com/toddr/IO-Tty/pull/33#issuecomment-1260147256 | ||
| 22 | |||
| 23 | Upstream-Status: Submitted [https://github.com/toddr/IO-Tty/pull/33] | ||
| 24 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 25 | --- | ||
| 26 | Makefile.PL | 5 +++-- | ||
| 27 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/Makefile.PL b/Makefile.PL | ||
| 30 | index eaf47e0..2e8338d 100644 | ||
| 31 | --- a/Makefile.PL | ||
| 32 | +++ b/Makefile.PL | ||
| 33 | @@ -163,7 +163,8 @@ main () | ||
| 34 | #if defined (__stub_$f) || defined (__stub___$f) | ||
| 35 | choke me | ||
| 36 | #else | ||
| 37 | -f = $f (); | ||
| 38 | +f = $f; | ||
| 39 | +f(); | ||
| 40 | #endif | ||
| 41 | |||
| 42 | ; | ||
| 43 | @@ -173,7 +174,7 @@ ESQ | ||
| 44 | |||
| 45 | close(TST); | ||
| 46 | print "Looking for $f()" . "." x (13-length($f)) . " "; | ||
| 47 | - if (system("$cfg{'cc'} $flags $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) { | ||
| 48 | + if (system("$cfg{'cc'} $flags -Wl,--no-undefined $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) { | ||
| 49 | print "not found.\n"; | ||
| 50 | } else { | ||
| 51 | $define{"-DHAVE_\U$f"} = undef; | ||
| 52 | -- | ||
| 53 | 2.40.0 | ||
| 54 | |||
diff --git a/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch b/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch deleted file mode 100644 index 07c7690fb8..0000000000 --- a/meta-oe/recipes-devtools/perl/libio-pty-perl/0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | From fae771aefc593a0ef798bc0c1e21b0524eb85e2d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 31 Aug 2022 20:32:35 -0700 | ||
| 4 | Subject: [PATCH] Tty.xs: Do not mark strlcpy as static | ||
| 5 | |||
| 6 | Some libcs e.g. musl do not provide implementation of strlcpy but they | ||
| 7 | do provide the signature in string.h, if we mark it static here then it | ||
| 8 | conflicts with the libc define and compiler may warn/error | ||
| 9 | |||
| 10 | Fixes | ||
| 11 | Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration | ||
| 12 | strlcpy( ^ | ||
| 13 | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libio-pty-perl/1.16-r0/recipe-sysroot/usr/include/string.h:86:8: note: previous declaration is here | ||
| 14 | size_t strlcpy (char *, const char *, size_t); ^ | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://github.com/toddr/IO-Tty/pull/33] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | Tty.xs | 10 +++++----- | ||
| 20 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/Tty.xs b/Tty.xs | ||
| 23 | index aa638f4..4bab39d 100644 | ||
| 24 | --- a/Tty.xs | ||
| 25 | +++ b/Tty.xs | ||
| 26 | @@ -186,11 +186,11 @@ mysignal(int sig, mysig_t act) | ||
| 27 | * will be copied. Always NUL terminates (unless siz == 0). | ||
| 28 | * Returns strlen(src); if retval >= siz, truncation occurred. | ||
| 29 | */ | ||
| 30 | -static size_t | ||
| 31 | -strlcpy(dst, src, siz) | ||
| 32 | - char *dst; | ||
| 33 | - const char *src; | ||
| 34 | - size_t siz; | ||
| 35 | +size_t | ||
| 36 | +strlcpy( | ||
| 37 | + char *dst, | ||
| 38 | + const char *src, | ||
| 39 | + size_t siz) | ||
| 40 | { | ||
| 41 | register char *d = dst; | ||
| 42 | register const char *s = src; | ||
| 43 | -- | ||
| 44 | 2.37.3 | ||
| 45 | |||
diff --git a/meta-oe/recipes-devtools/perl/libio-pty-perl_1.17.bb b/meta-oe/recipes-devtools/perl/libio-pty-perl_1.17.bb index 684788f199..e5c1ec1c82 100644 --- a/meta-oe/recipes-devtools/perl/libio-pty-perl_1.17.bb +++ b/meta-oe/recipes-devtools/perl/libio-pty-perl_1.17.bb | |||
| @@ -4,9 +4,8 @@ LICENSE = "Artistic-1.0 | GPL-1.0-or-later" | |||
| 4 | LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=12;md5=b2562f94907eeb42e8ce9d45f628e587" | 4 | LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=12;md5=b2562f94907eeb42e8ce9d45f628e587" |
| 5 | 5 | ||
| 6 | SRC_URI = "http://www.cpan.org/modules/by-module/IO/IO-Tty-${PV}.tar.gz \ | 6 | SRC_URI = "http://www.cpan.org/modules/by-module/IO/IO-Tty-${PV}.tar.gz \ |
| 7 | file://0001-Tty.xs-Do-not-mark-strlcpy-as-static.patch \ | 7 | file://0001-Make-function-checks-more-robust-within-shared-libs.patch \ |
| 8 | " | 8 | " |
| 9 | |||
| 10 | SRC_URI[sha256sum] = "a5f1a83020bc5b5dd6c1b570f48c7546e0a8f7fac10a068740b03925ad9e14e8" | 9 | SRC_URI[sha256sum] = "a5f1a83020bc5b5dd6c1b570f48c7546e0a8f7fac10a068740b03925ad9e14e8" |
| 11 | 10 | ||
| 12 | S = "${WORKDIR}/IO-Tty-${PV}" | 11 | S = "${WORKDIR}/IO-Tty-${PV}" |
