diff options
| author | Joshua Watt <JPEWhacker@gmail.com> | 2020-05-06 07:56:57 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-07 12:16:00 +0100 |
| commit | e7833d0edf707825830039d4249168e9cad1fe50 (patch) | |
| tree | 44c0755a15a3a5cdf68ee97e307b5a071eacc2cb | |
| parent | 643c26562f777f3e71c95864ebc9a2efc49ebdf9 (diff) | |
| download | poky-e7833d0edf707825830039d4249168e9cad1fe50.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: 303bf23048cb326dd8a8079a7cf773c3fd8f21ff)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@ | |||
| 1 | From f60dc1063607ca1f201ba4cbda467d8af3f78f64 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Miroslav Lichvar <mlichvar@redhat.com> | ||
| 3 | Date: Tue, 1 Oct 2019 16:37:55 +0200 | ||
| 4 | Subject: [PATCH] don't ignore CFLAGS when building snack | ||
| 5 | |||
| 6 | In addition to the flags returned by python-config --cflags, use the | ||
| 7 | user-specified CFLAGS when building the snack object. | ||
| 8 | |||
| 9 | Upstream-Status: Backport from master | ||
| 10 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | ||
| 11 | --- | ||
| 12 | Makefile.in | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/Makefile.in b/Makefile.in | ||
| 16 | index 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 @@ | |||
| 1 | specify -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 | |||
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | --- | ||
| 12 | Makefile.in | 6 +++--- | ||
| 13 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/Makefile.in b/Makefile.in | ||
| 16 | index 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 | -- | ||
| 40 | 2.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" | |||
| 20 | SRC_URI = "https://releases.pagure.org/newt/newt-${PV}.tar.gz \ | 20 | SRC_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 | ||
| 27 | SRC_URI[md5sum] = "a0a5fd6b53bb167a65e15996b249ebb5" | 27 | SRC_URI[md5sum] = "a0a5fd6b53bb167a65e15996b249ebb5" |
| 28 | SRC_URI[sha256sum] = "265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31" | 28 | SRC_URI[sha256sum] = "265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31" |
