aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-static-utils-do-not-build-shared-binaries.patch
blob: 2f7cd355647140dd723757617424a98e0fb13fdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
From c034dceae17b7d8d437871afe5eba55a55434222 Mon Sep 17 00:00:00 2001
From: Andrea Adami <andrea.adami@gmail.com>
Date: Wed, 10 Oct 2018 00:48:31 +0200
Subject: [PATCH] klibc-static-utils: do not build shared binaries

We were building some shared utilities and this was leading to linker errors
for x86 with security flags enabled.

Fix
 i586-oe-linux-musl-ld.bfd: discarded output section: `.got.plt'

Upstream-Status: Inappropriate [Embedded Specific]

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
 usr/dash/Kbuild           | 6 +-----
 usr/kinit/Kbuild          | 4 +---
 usr/kinit/fstype/Kbuild   | 4 +---
 usr/kinit/ipconfig/Kbuild | 4 +---
 usr/kinit/nfsmount/Kbuild | 4 +---
 usr/kinit/resume/Kbuild   | 5 +----
 usr/kinit/run-init/Kbuild | 5 +----
 usr/utils/Kbuild          | 7 ++-----
 8 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/usr/dash/Kbuild b/usr/dash/Kbuild
index 1a6920a..b3a4e64 100644
--- a/usr/dash/Kbuild
+++ b/usr/dash/Kbuild
@@ -25,12 +25,8 @@ gen-h-files := builtins.h nodes.h syntax.h token.h
 
 static-y := sh
 
-# The shared binary
-shared-y    := sh.shared
-sh.shared-y := $(sh-y)
-
 # For cleaning
-targets := sh sh.g sh.shared sh.shared.g $(gen-o-files)
+targets := sh sh.g $(gen-o-files)
 
 # explicit dependency for all generated files
 $(addprefix $(obj)/, $(sh-y)): $(addprefix $(obj)/, $(gen-h-files))
diff --git a/usr/kinit/Kbuild b/usr/kinit/Kbuild
index f7fdccd..8db06ab 100644
--- a/usr/kinit/Kbuild
+++ b/usr/kinit/Kbuild
@@ -18,8 +18,6 @@ kinit-y  += fstype/
 kinit-y  += resume/
 
 static-y := kinit
-shared-y := kinit.shared
-kinit.shared-y := $(kinit-y)
 
 # Additional include paths files
 KLIBCCFLAGS += -I$(srctree)/$(src)/fstype \
@@ -29,7 +27,7 @@ KLIBCCFLAGS += -I$(srctree)/$(src)/fstype \
  	       -I$(srctree)/$(src)/run-init
 
 # Cleaning
-targets += kinit kinit.g kinit.shared kinit.shared.g
+targets += kinit kinit.g
 subdir- := fstype ipconfig nfsmount resume run-init
 
 
diff --git a/usr/kinit/fstype/Kbuild b/usr/kinit/fstype/Kbuild
index 367611d..8d453ea 100644
--- a/usr/kinit/fstype/Kbuild
+++ b/usr/kinit/fstype/Kbuild
@@ -3,7 +3,6 @@
 #
 
 static-y := static/fstype
-shared-y := shared/fstype
 
 # common .o files
 objs := main.o fstype.o
@@ -16,8 +15,7 @@ lib-y := $(objs)
 
 # .o files used to built executables
 static/fstype-y := $(objs)
-shared/fstype-y := $(objs)
 
 # Cleaning
-clean-dirs := static shared
+clean-dirs := static
 
diff --git a/usr/kinit/ipconfig/Kbuild b/usr/kinit/ipconfig/Kbuild
index eb1d472..ef87e7e 100644
--- a/usr/kinit/ipconfig/Kbuild
+++ b/usr/kinit/ipconfig/Kbuild
@@ -3,7 +3,6 @@
 #
 
 static-y := static/ipconfig
-shared-y := shared/ipconfig
 
 # common .o files
 objs := main.o netdev.o packet.o
@@ -22,8 +21,7 @@ lib-y := $(objs)
 
 # .o files used to built executables
 static/ipconfig-y := $(objs)
-shared/ipconfig-y := $(objs)
 
 # Cleaning
-clean-dirs := static shared
+clean-dirs := static
 
diff --git a/usr/kinit/nfsmount/Kbuild b/usr/kinit/nfsmount/Kbuild
index ba31708..01bedce 100644
--- a/usr/kinit/nfsmount/Kbuild
+++ b/usr/kinit/nfsmount/Kbuild
@@ -4,7 +4,6 @@
 
 static-y := static/nfsmount
 #FIXME - build is broken static-y := dummypmap
-shared-y := shared/nfsmount
 
 objs := main.o mount.o portmap.o dummypmap.o sunrpc.o
 
@@ -13,7 +12,6 @@ lib-y := $(objs)
 
 # .o files used for executables
 static/nfsmount-y := $(objs)
-shared/nfsmount-y := $(objs)
 
 # dummypmap uses a single .o file (rename src file?)
 dummypmap-y := dummypmap_test.o
@@ -21,5 +19,5 @@ dummypmap-y := dummypmap_test.o
 # TODO - do we want a stripped version
 # TODO - do we want the static.g + shared.g directories?
 
-clean-dirs := static shared
+clean-dirs := static
 
diff --git a/usr/kinit/resume/Kbuild b/usr/kinit/resume/Kbuild
index c1342e1..15b9590 100644
--- a/usr/kinit/resume/Kbuild
+++ b/usr/kinit/resume/Kbuild
@@ -3,7 +3,6 @@
 #
 
 static-y := static/resume
-shared-y := shared/resume
 
 # common .o files
 objs := resume.o resumelib.o
@@ -20,9 +19,7 @@ KLIBCCFLAGS += -I$(srctree)/$(src)/..
 # .o files used to built executables
 static/resume-y   := $(objs)
 static/resume-lib := ../lib.a
-shared/resume-y   := $(objs)
-shared/resume-lib := ../lib.a
 
 # Cleaning
-clean-dirs := static shared
+clean-dirs := static
 
diff --git a/usr/kinit/run-init/Kbuild b/usr/kinit/run-init/Kbuild
index c153b0a..a1ea834 100644
--- a/usr/kinit/run-init/Kbuild
+++ b/usr/kinit/run-init/Kbuild
@@ -3,7 +3,6 @@
 #
 
 static-y := static/run-init
-shared-y := shared/run-init
 
 # common .o files
 objs := run-init.o runinitlib.o
@@ -24,9 +23,7 @@ KLIBCCFLAGS += -I$(srctree)/$(src)/..
 # .o files used to built executables
 static/run-init-y   := $(objs)
 static/run-init-lib := ../lib.a
-shared/run-init-y   := $(objs)
-shared/run-init-lib := ../lib.a
 
 # Cleaning
-clean-dirs := static shared
+clean-dirs := static
 
diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild
index 67d9486..1573363 100644
--- a/usr/utils/Kbuild
+++ b/usr/utils/Kbuild
@@ -7,7 +7,6 @@ progs += true false sleep ln mv nuke minips cat ls losetup
 progs += uname halt kill readlink cpio sync dmesg
 
 static-y := $(addprefix static/, $(progs))
-shared-y := $(addprefix shared/, $(progs))
 
 # The binary is placed in a subdir, so we need to tell kbuild this
 static/chroot-y     := chroot.o
@@ -62,13 +61,11 @@ static/losetup-y    := losetup.o
 shared/losetup-y    := losetup.o
 
 # Additionally linked targets
-always := static/reboot static/poweroff shared/reboot shared/poweroff
+always := static/reboot static/poweroff
 
 $(obj)/static/reboot $(obj)/static/poweroff: $(obj)/static/halt
 	$(call cmd,ln)
-$(obj)/shared/reboot $(obj)/shared/poweroff: $(obj)/shared/halt
-	$(call cmd,ln)
 
 # Clean deletes the static and shared dir
-clean-dirs := static shared
+clean-dirs := static
 
-- 
2.7.4