Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 1 | From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <martin@geanix.com> |
| 3 | Date: Tue, 6 Nov 2018 14:50:47 +0100 |
| 4 | Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler |
| 5 | info |
| 6 | MIME-Version: 1.0 |
| 7 | Content-Type: text/plain; charset=UTF-8 |
| 8 | Content-Transfer-Encoding: 8bit |
| 9 | |
| 10 | The openssl build system generates buildinf.h containing the full |
| 11 | compiler command line used to compile objects. This breaks |
| 12 | reproducibility, as the compile command is baked into libcrypto, where |
| 13 | it is used when running `openssl version -f`. |
| 14 | |
| 15 | Add stripped build variables for the compiler and cflags lines, and use |
| 16 | those when generating buildinfo.h. |
| 17 | |
| 18 | This is based on a similar patch for older openssl versions: |
| 19 | https://patchwork.openembedded.org/patch/147229/ |
| 20 | |
| 21 | Upstream-Status: Inappropriate [OE specific] |
| 22 | Signed-off-by: Martin HundebΓΈll <martin@geanix.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 23 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | Update to fix buildpaths qa issue for '-fmacro-prefix-map'. |
| 25 | |
| 26 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 27 | |
| 28 | Update to fix buildpaths qa issue for '-ffile-prefix-map'. |
| 29 | |
| 30 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 31 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | --- |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 33 | Configurations/unix-Makefile.tmpl | 12 +++++++++++- |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 34 | crypto/build.info | 2 +- |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 35 | 2 files changed, 12 insertions(+), 2 deletions(-) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 36 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 37 | diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl |
| 38 | index f88a70f..528cdef 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | --- a/Configurations/unix-Makefile.tmpl |
| 40 | +++ b/Configurations/unix-Makefile.tmpl |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 41 | @@ -471,13 +471,23 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 42 | '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} |
| 43 | BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) |
| 44 | |
| 45 | -# CPPFLAGS_Q is used for one thing only: to build up buildinf.h |
| 46 | +# *_Q variables are used for one thing only: to build up buildinf.h |
| 47 | CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; |
| 48 | $cppflags2 =~ s|([\\"])|\\$1|g; |
| 49 | $lib_cppflags =~ s|([\\"])|\\$1|g; |
| 50 | join(' ', $lib_cppflags || (), $cppflags2 || (), |
| 51 | $cppflags1 || ()) -} |
| 52 | |
| 53 | +CFLAGS_Q={- for (@{$config{CFLAGS}}) { |
| 54 | + s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g; |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 55 | + s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g; |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 56 | + s|-ffile-prefix-map=[^ ]+|-ffile-prefix-map=|g; |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 57 | + } |
| 58 | + join(' ', @{$config{CFLAGS}}) -} |
| 59 | + |
| 60 | +CC_Q={- $config{CC} =~ s|--sysroot=[^ ]+|--sysroot=recipe-sysroot|g; |
| 61 | + join(' ', $config{CC}) -} |
| 62 | + |
| 63 | PERLASM_SCHEME= {- $target{perlasm_scheme} -} |
| 64 | |
| 65 | # For x86 assembler: Set PROCESSOR to 386 if you want to support |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 66 | diff --git a/crypto/build.info b/crypto/build.info |
| 67 | index efca6cc..eda433e 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 68 | --- a/crypto/build.info |
| 69 | +++ b/crypto/build.info |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 70 | @@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 71 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 72 | DEPEND[info.o]=buildinf.h |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 73 | DEPEND[cversion.o]=buildinf.h |
| 74 | -GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" |
| 75 | +GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC_Q) $(CFLAGS_Q) $(CPPFLAGS_Q)" "$(PLATFORM)" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 76 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 77 | GENERATE[uplink-x86.s]=../ms/uplink-x86.pl |
| 78 | GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl |