summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-05-06 07:56:57 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-22 16:23:23 +0100
commit2c9338ad8f75748e33895a06fb64b1fbd6517682 (patch)
tree37b6e897306becb5ec0def25c19c08fbe964325a
parentc0d765f8bfaee261f1e5ce6b4d411ece475c6ad2 (diff)
downloadpoky-2c9338ad8f75748e33895a06fb64b1fbd6517682.tar.gz
libnewt: Backport patch to fix reproducibility
Backports a patch from upstream to fix a reproducibility problem where paths would be encoded in the binary. Drops an obsolete patch that conflicted with the backport (From OE-Core rev: b8f5114aabf6bbbc4adf5802a6707efaf18ba2ee) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/newt/files/0002-don-t-ignore-CFLAGS-when-building-snack.patch29
-rw-r--r--meta/recipes-extended/newt/files/pie-flags.patch41
-rw-r--r--meta/recipes-extended/newt/libnewt_0.52.21.bb4
3 files changed, 31 insertions, 43 deletions
diff --git a/meta/recipes-extended/newt/files/0002-don-t-ignore-CFLAGS-when-building-snack.patch b/meta/recipes-extended/newt/files/0002-don-t-ignore-CFLAGS-when-building-snack.patch
new file mode 100644
index 0000000000..ca235d5108
--- /dev/null
+++ b/meta/recipes-extended/newt/files/0002-don-t-ignore-CFLAGS-when-building-snack.patch
@@ -0,0 +1,29 @@
1From f60dc1063607ca1f201ba4cbda467d8af3f78f64 Mon Sep 17 00:00:00 2001
2From: Miroslav Lichvar <mlichvar@redhat.com>
3Date: Tue, 1 Oct 2019 16:37:55 +0200
4Subject: [PATCH] don't ignore CFLAGS when building snack
5
6In addition to the flags returned by python-config --cflags, use the
7user-specified CFLAGS when building the snack object.
8
9Upstream-Status: Backport from master
10Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
11---
12 Makefile.in | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/Makefile.in b/Makefile.in
16index be5f87b..6facd5e 100644
17--- a/Makefile.in
18+++ b/Makefile.in
19@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH)
20 PIFLAGS=`$$pyconfig --includes`; \
21 PLDFLAGS=`$$pyconfig --ldflags`; \
22 PLFLAGS=`$$pyconfig --libs`; \
23- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
24- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
25+ echo $(CC) $(SHCFLAGS) $(CFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
26+ $(CC) $(SHCFLAGS) $(CFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
27 echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
28 $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
29 done || :
diff --git a/meta/recipes-extended/newt/files/pie-flags.patch b/meta/recipes-extended/newt/files/pie-flags.patch
deleted file mode 100644
index 92f5b2503b..0000000000
--- a/meta/recipes-extended/newt/files/pie-flags.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1specify -fPIC after CFLAGS so it can override the CFLAGS containing -pie and -fpie this makes sure the objects that go into shared objects are compiled with -fPIC and not with -fpie. We can not use -fpie on objects which will go into .so files Fixes errors like
2
3| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: shared/newt.o: relocation R_X86_64_PC32 against undefined symbol `SLtt_Screen_Rows@@SLANG2' can not be used when making a shared object; recompile with -fPIC
4| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
5| collect2: error: ld returned 1 exit status
6| make: *** [libnewt.so.0.52.18] Error 1
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10
11---
12 Makefile.in | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/Makefile.in b/Makefile.in
16index be5f87b..88ee0b7 100644
17--- a/Makefile.in
18+++ b/Makefile.in
19@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH)
20 PIFLAGS=`$$pyconfig --includes`; \
21 PLDFLAGS=`$$pyconfig --ldflags`; \
22 PLFLAGS=`$$pyconfig --libs`; \
23- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
24- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
25+ echo $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
26+ $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
27 echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
28 $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
29 done || :
30@@ -133,7 +133,7 @@ $(LIBNEWTSH): $(SHAREDOBJS)
31
32 $(SHAREDDIR)/%.o : %.c
33 @mkdir -p $(SHAREDDIR)
34- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
35+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SHCFLAGS) -o $@ $<
36
37 install: $(LIBNEWT) install-sh whiptail
38 [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
39--
402.7.4
41
diff --git a/meta/recipes-extended/newt/libnewt_0.52.21.bb b/meta/recipes-extended/newt/libnewt_0.52.21.bb
index 09b61be61d..88b4cf4a03 100644
--- a/meta/recipes-extended/newt/libnewt_0.52.21.bb
+++ b/meta/recipes-extended/newt/libnewt_0.52.21.bb
@@ -20,9 +20,9 @@ DEPENDS = "slang popt python3"
20SRC_URI = "https://releases.pagure.org/newt/newt-${PV}.tar.gz \ 20SRC_URI = "https://releases.pagure.org/newt/newt-${PV}.tar.gz \
21 file://cross_ar.patch \ 21 file://cross_ar.patch \
22 file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \ 22 file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \
23 file://pie-flags.patch \
24 file://0001-detect-gold-as-GNU-linker-too.patch \ 23 file://0001-detect-gold-as-GNU-linker-too.patch \
25" 24 file://0002-don-t-ignore-CFLAGS-when-building-snack.patch \
25 "
26 26
27SRC_URI[md5sum] = "a0a5fd6b53bb167a65e15996b249ebb5" 27SRC_URI[md5sum] = "a0a5fd6b53bb167a65e15996b249ebb5"
28SRC_URI[sha256sum] = "265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31" 28SRC_URI[sha256sum] = "265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31"