summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-03 12:20:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-04 14:21:41 +0100
commitcd158dd197a3a41a91679107a94c6f213476921c (patch)
treea943fa0a0705df61bdf71474a4ff09788705d395 /meta/recipes-core
parent6a924ca5a509c518493343409d28e92f9e5bdb46 (diff)
downloadpoky-cd158dd197a3a41a91679107a94c6f213476921c.tar.gz
glibc: Fix glibc reproducibility issues
Currently for non-IA platforms, glibc is not reproducible as host system paths are being injected into target binaries. These spread through all target binaries on the system which link to the libc. Add a patch which injects .file directives into the assembly pieces and works around this issue until a better solution can be found. (From OE-Core rev: 4d6fd8178da75f9a1870db290bbe24de5af752c9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch259
-rw-r--r--meta/recipes-core/glibc/glibc_2.28.bb1
2 files changed, 260 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch b/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch
new file mode 100644
index 0000000000..3f9f8cf189
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch
@@ -0,0 +1,259 @@
1Currently, non-IA builds are not reproducibile since build paths are
2being injected into the debug symbols. These are coming from the use of
3.S assembler files during the glibc build. No STT_FILE section is added
4during the assembly but when linking, ld decides to add one to aid
5debugging and ensure references between the different object files its
6linking remain clear.
7
8We can avoid this by injecting a file header into the assembler files
9ahead of time, choosing a filename which does not contain build system
10paths.
11
12This is a bit of a workaround/hack but does significantly reduce the
13build system references in target binaries for the non-IA architectures
14which use .S files.
15
16RP
172018/10/3
18
19Upstream-Status: Pending
20
21diff --git a/csu/abi-note.S b/csu/abi-note.S
22index 5d0ca7803d..8ce41581b1 100644
23--- a/csu/abi-note.S
24+++ b/csu/abi-note.S
25@@ -56,6 +56,8 @@ offset length contents
26 #include <config.h>
27 #include <abi-tag.h> /* OS-specific ABI tag value */
28
29+ .file "abi-note.S"
30+
31 /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose
32 name begins with `.note' and creates a PT_NOTE program header entry
33 pointing at it. */
34diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S
35index 2b213758b2..736f33e314 100644
36--- a/sysdeps/aarch64/crti.S
37+++ b/sysdeps/aarch64/crti.S
38@@ -50,6 +50,8 @@
39 # define PREINIT_FUNCTION_WEAK 1
40 #endif
41
42+ .file "crti.S"
43+
44 #if PREINIT_FUNCTION_WEAK
45 weak_extern (PREINIT_FUNCTION)
46 #else
47diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S
48index d72300af80..cb249bf3ca 100644
49--- a/sysdeps/aarch64/crtn.S
50+++ b/sysdeps/aarch64/crtn.S
51@@ -37,6 +37,8 @@
52 /* crtn.S puts function epilogues in the .init and .fini sections
53 corresponding to the prologues in crti.S. */
54
55+ .file "crtn.S"
56+
57 .section .init,"ax",%progbits
58 ldp x29, x30, [sp], 16
59 RET
60diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
61index bad000f555..5957c028cd 100644
62--- a/sysdeps/aarch64/start.S
63+++ b/sysdeps/aarch64/start.S
64@@ -18,6 +18,8 @@
65
66 #include <sysdep.h>
67
68+ .file "start.S"
69+
70 /* This is the canonical entry point, usually the first thing in the text
71 segment.
72
73diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
74index 92fc0191a5..715bfcb9e4 100644
75--- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
76+++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
77@@ -18,6 +18,8 @@
78
79 #include <sysdep.h>
80
81+ .file "__read_tp.S"
82+
83 .hidden __read_tp
84 ENTRY (__read_tp)
85 mrs x0, tpidr_el0
86diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
87index 43a62ef307..42f85cdde9 100644
88--- a/sysdeps/aarch64/dl-tlsdesc.S
89+++ b/sysdeps/aarch64/dl-tlsdesc.S
90@@ -22,6 +22,8 @@
91 #include <tls.h>
92 #include "tlsdesc.h"
93
94+ .file "dl-tlsdesc.S"
95+
96 #define NSAVEDQREGPAIRS 16
97 #define SAVE_Q_REGISTERS \
98 stp q0, q1, [sp, #-32*NSAVEDQREGPAIRS]!; \
99diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
100index a86d0722d4..92edab1d01 100644
101--- a/sysdeps/aarch64/dl-trampoline.S
102+++ b/sysdeps/aarch64/dl-trampoline.S
103@@ -21,6 +21,8 @@
104
105 #include "dl-link.h"
106
107+ .file "dl-trampoline.S"
108+
109 #define ip0 x16
110 #define ip0l PTR_REG (16)
111 #define ip1 x17
112diff --git a/sysdeps/arm/abi-note.S b/sysdeps/arm/abi-note.S
113index 07bd4c4619..7213b16f27 100644
114--- a/sysdeps/arm/abi-note.S
115+++ b/sysdeps/arm/abi-note.S
116@@ -1,3 +1,5 @@
117+ .file "abi-note.S"
118+
119 /* Tag_ABI_align8_preserved: This code preserves 8-byte
120 alignment in any callee. */
121 .eabi_attribute 25, 1
122diff --git a/sysdeps/arm/crti.S b/sysdeps/arm/crti.S
123index a1424d0333..bca1dab256 100644
124--- a/sysdeps/arm/crti.S
125+++ b/sysdeps/arm/crti.S
126@@ -57,6 +57,8 @@
127 .hidden PREINIT_FUNCTION
128 #endif
129
130+ .file "crti.S"
131+
132 #if PREINIT_FUNCTION_WEAK
133 .p2align 2
134 .type call_weak_fn, %function
135diff --git a/sysdeps/arm/crtn.S b/sysdeps/arm/crtn.S
136index 26027693ce..65a0502826 100644
137--- a/sysdeps/arm/crtn.S
138+++ b/sysdeps/arm/crtn.S
139@@ -37,6 +37,8 @@
140 #define NO_THUMB
141 #include <sysdep.h>
142
143+ .file "crtn.S"
144+
145 /* crtn.S puts function epilogues in the .init and .fini sections
146 corresponding to the prologues in crti.S. */
147
148diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S
149index 056e17d52d..a98c68dfb9 100644
150--- a/sysdeps/arm/dl-tlsdesc.S
151+++ b/sysdeps/arm/dl-tlsdesc.S
152@@ -21,6 +21,8 @@
153 #include <tls.h>
154 #include "tlsdesc.h"
155
156+ .file "dl-tlsdesc.S"
157+
158 .text
159 @ emit debug information with cfi
160 @ use arm-specific pseudos for unwinding itself
161diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
162index c731b01286..4b37b25344 100644
163--- a/sysdeps/arm/dl-trampoline.S
164+++ b/sysdeps/arm/dl-trampoline.S
165@@ -21,6 +21,8 @@
166 #include <sysdep.h>
167 #include <libc-symbols.h>
168
169+ .file "dl-trampoline.S"
170+
171 .text
172 .globl _dl_runtime_resolve
173 .type _dl_runtime_resolve, #function
174diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S
175index adef090717..d22e4128e0 100644
176--- a/sysdeps/arm/start.S
177+++ b/sysdeps/arm/start.S
178@@ -57,6 +57,8 @@
179 NULL
180 */
181
182+ .file "start.S"
183+
184 /* Tag_ABI_align8_preserved: This code preserves 8-byte
185 alignment in any callee. */
186 .eabi_attribute 25, 1
187diff --git a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
188index 871702317a..20a942dbac 100644
189--- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
190+++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
191@@ -39,6 +39,8 @@
192 a normal function call) in a high page of memory; tail call to the
193 helper. */
194
195+ .file "aeabi_read_tp.S"
196+
197 .hidden __aeabi_read_tp
198 ENTRY (__aeabi_read_tp)
199 #ifdef ARCH_HAS_HARD_TP
200diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S
201index a4c4ef0fae..d00fff31a8 100644
202--- a/sysdeps/mips/start.S
203+++ b/sysdeps/mips/start.S
204@@ -38,6 +38,8 @@
205 #include <sgidefs.h>
206 #include <sys/asm.h>
207
208+ .file "start.S"
209+
210 #ifndef ENTRY_POINT
211 #error ENTRY_POINT needs to be defined for start.S on MIPS/ELF.
212 #endif
213diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
214index eeb96544e3..da182b28f8 100644
215--- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
216+++ b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
217@@ -1 +1,3 @@
218+ .file "dl-brk.S"
219+
220 #include <brk.S>
221diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S
222index 5c10a22f8a..2b52627f27 100644
223--- a/sysdeps/powerpc/powerpc32/start.S
224+++ b/sysdeps/powerpc/powerpc32/start.S
225@@ -35,6 +35,8 @@
226
227 #include <sysdep.h>
228
229+ .file "start.S"
230+
231 /* We do not want .eh_frame info for crt1.o since crt1.o is linked
232 before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
233 #undef cfi_startproc
234diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
235index bd7189310c..2e22b8472d 100644
236--- a/sysdeps/powerpc/powerpc64/start.S
237+++ b/sysdeps/powerpc/powerpc64/start.S
238@@ -35,6 +35,8 @@
239
240 #include <sysdep.h>
241
242+ .file "start.S"
243+
244 /* We do not want .eh_frame info for crt1.o since crt1.o is linked
245 before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
246 #undef cfi_startproc
247diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
248index 244d87fb6d..14d3e2ce14 100644
249--- a/sysdeps/powerpc/powerpc32/dl-start.S
250+++ b/sysdeps/powerpc/powerpc32/dl-start.S
251@@ -18,6 +18,8 @@
252
253 #include <sysdep.h>
254
255+ .file "dl-start.S"
256+
257 /* Initial entry point code for the dynamic linker.
258 The C function `_dl_start' is the real entry point;
259 its return value is the user program's entry point. */
diff --git a/meta/recipes-core/glibc/glibc_2.28.bb b/meta/recipes-core/glibc/glibc_2.28.bb
index bd8b51e1d6..d072939254 100644
--- a/meta/recipes-core/glibc/glibc_2.28.bb
+++ b/meta/recipes-core/glibc/glibc_2.28.bb
@@ -48,6 +48,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
48 file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \ 48 file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \
49 file://0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch \ 49 file://0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch \
50 file://0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ 50 file://0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
51 file://0034-inject-file-assembly-directives.patch \
51" 52"
52 53
53NATIVESDKFIXES ?= "" 54NATIVESDKFIXES ?= ""