blob: 41abf3d6bdbdae24ea1a67c750897e9d06c95d30 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 7fb1192f112c1920bfd39f4185f34e9afff3cff2 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Sat, 5 Mar 2016 00:12:02 +0000
4Subject: [PATCH 24/28] Fix the parallel races in the Makefiles.
5
6This patch was taken from the Gentoo packaging:
7https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2g-parallel-build.patch
8
9Upstream-Status: Pending
10Signed-off-by: Ross Burton <ross.burton@intel.com>
11
12Refreshed for 1.0.2i
13Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
14
15---
Brad Bishop220d5532018-08-14 00:59:39 +010016 Makefile.org | 14 ++--
17 Makefile.shared | 2 +
18 crypto/Makefile | 10 +--
19 engines/Makefile | 6 +-
20 test/Makefile | 94 +++++++++++-----------
21 5 files changed, 64 insertions(+), 62 deletions(-)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022
23diff --git a/Makefile.org b/Makefile.org
Brad Bishop220d5532018-08-14 00:59:39 +010024index efcfafb..82eab91 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025--- a/Makefile.org
26+++ b/Makefile.org
Brad Bishop220d5532018-08-14 00:59:39 +010027@@ -282,17 +282,17 @@ build_libcrypto: build_crypto build_engines libcrypto.pc
Brad Bishopd7bf8c12018-02-25 22:55:05 -050028 build_libssl: build_ssl libssl.pc
29
30 build_crypto:
31- @dir=crypto; target=all; $(BUILD_ONE_CMD)
32+ +@dir=crypto; target=all; $(BUILD_ONE_CMD)
33 build_ssl: build_crypto
34- @dir=ssl; target=all; $(BUILD_ONE_CMD)
35+ +@dir=ssl; target=all; $(BUILD_ONE_CMD)
36 build_engines: build_crypto
37- @dir=engines; target=all; $(BUILD_ONE_CMD)
38+ +@dir=engines; target=all; $(BUILD_ONE_CMD)
39 build_apps: build_libs
40- @dir=apps; target=all; $(BUILD_ONE_CMD)
41+ +@dir=apps; target=all; $(BUILD_ONE_CMD)
42 build_tests: build_libs
43- @dir=test; target=all; $(BUILD_ONE_CMD)
44+ +@dir=test; target=all; $(BUILD_ONE_CMD)
45 build_tools: build_libs
46- @dir=tools; target=all; $(BUILD_ONE_CMD)
47+ +@dir=tools; target=all; $(BUILD_ONE_CMD)
48
49 all_testapps: build_libs build_testapps
50 build_testapps:
Brad Bishop220d5532018-08-14 00:59:39 +010051@@ -564,7 +564,7 @@ install_sw:
Brad Bishopd7bf8c12018-02-25 22:55:05 -050052 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
53 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
54 done;
55- @set -e; target=install; $(RECURSIVE_BUILD_CMD)
56+ +@set -e; target=install; $(RECURSIVE_BUILD_CMD)
57 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
58 do \
59 if [ -f "$$i" ]; then \
60diff --git a/Makefile.shared b/Makefile.shared
Brad Bishop220d5532018-08-14 00:59:39 +010061index bbefb2b..18013a9 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050062--- a/Makefile.shared
63+++ b/Makefile.shared
64@@ -105,6 +105,7 @@ LINK_SO= \
65 SHAREDFLAGS="$(OE_LDFLAGS) $${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
66 LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
67 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
68+ [ -e $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX ] && exit 0; \
69 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
70 $${SHAREDCMD} $${SHAREDFLAGS} \
71 -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
72@@ -122,6 +123,7 @@ SYMLINK_SO= \
73 done; \
74 fi; \
75 if [ -n "$$SHLIB_SOVER" ]; then \
76+ [ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \
77 ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
78 ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
79 fi; \
80diff --git a/crypto/Makefile b/crypto/Makefile
Brad Bishop220d5532018-08-14 00:59:39 +010081index 875ea1a..c22b683 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050082--- a/crypto/Makefile
83+++ b/crypto/Makefile
84@@ -85,11 +85,11 @@ testapps:
85 @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
86
87 subdirs:
88- @target=all; $(RECURSIVE_MAKE)
89+ +@target=all; $(RECURSIVE_MAKE)
90
91 files:
92 $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
93- @target=files; $(RECURSIVE_MAKE)
94+ +@target=files; $(RECURSIVE_MAKE)
95
96 links:
97 @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
98@@ -100,7 +100,7 @@ links:
99 # lib: $(LIB): are splitted to avoid end-less loop
100 lib: $(LIB)
101 @touch lib
102-$(LIB): $(LIBOBJ)
103+$(LIB): $(LIBOBJ) | subdirs
104 $(AR) $(LIB) $(LIBOBJ)
105 test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
106 $(RANLIB) $(LIB) || echo Never mind.
107@@ -111,7 +111,7 @@ shared: buildinf.h lib subdirs
108 fi
109
110 libs:
111- @target=lib; $(RECURSIVE_MAKE)
112+ +@target=lib; $(RECURSIVE_MAKE)
113
114 install:
115 @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
116@@ -120,7 +120,7 @@ install:
117 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
118 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
119 done;
120- @target=install; $(RECURSIVE_MAKE)
121+ +@target=install; $(RECURSIVE_MAKE)
122
123 lint:
124 @target=lint; $(RECURSIVE_MAKE)
125diff --git a/engines/Makefile b/engines/Makefile
126index fe8e9ca..a43d21b 100644
127--- a/engines/Makefile
128+++ b/engines/Makefile
129@@ -72,7 +72,7 @@ top:
130
131 all: lib subdirs
132
133-lib: $(LIBOBJ)
134+lib: $(LIBOBJ) | subdirs
135 @if [ -n "$(SHARED_LIBS)" ]; then \
136 set -e; \
137 for l in $(LIBNAMES); do \
138@@ -89,7 +89,7 @@ lib: $(LIBOBJ)
139
140 subdirs:
141 echo $(EDIRS)
142- @target=all; $(RECURSIVE_MAKE)
143+ +@target=all; $(RECURSIVE_MAKE)
144
145 files:
146 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
147@@ -128,7 +128,7 @@ install:
148 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx ); \
149 done; \
150 fi
151- @target=install; $(RECURSIVE_MAKE)
152+ +@target=install; $(RECURSIVE_MAKE)
153
154 tags:
155 ctags $(SRC)
156diff --git a/test/Makefile b/test/Makefile
Brad Bishop220d5532018-08-14 00:59:39 +0100157index 36506cf..c69af8b 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500158--- a/test/Makefile
159+++ b/test/Makefile
160@@ -145,7 +145,7 @@ install:
161 tags:
162 ctags $(SRC)
163
164-tests: exe apps $(TESTS)
165+tests: exe $(TESTS)
166
167 apps:
168 @(cd ..; $(MAKE) DIRS=apps all)
Brad Bishop220d5532018-08-14 00:59:39 +0100169@@ -448,142 +448,142 @@ BUILD_CMD_STATIC=shlib_target=; \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500170 link_app.$${shlib_target}
171
172 $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
173- @target=$(RSATEST); $(BUILD_CMD)
174+ +@target=$(RSATEST); $(BUILD_CMD)
175
176 $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
177- @target=$(BNTEST); $(BUILD_CMD)
178+ +@target=$(BNTEST); $(BUILD_CMD)
179
180 $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
181- @target=$(ECTEST); $(BUILD_CMD)
182+ +@target=$(ECTEST); $(BUILD_CMD)
183
184 $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
185- @target=$(EXPTEST); $(BUILD_CMD)
186+ +@target=$(EXPTEST); $(BUILD_CMD)
187
188 $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
189- @target=$(IDEATEST); $(BUILD_CMD)
190+ +@target=$(IDEATEST); $(BUILD_CMD)
191
192 $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
193- @target=$(MD2TEST); $(BUILD_CMD)
194+ +@target=$(MD2TEST); $(BUILD_CMD)
195
196 $(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO)
197- @target=$(SHATEST); $(BUILD_CMD)
198+ +@target=$(SHATEST); $(BUILD_CMD)
199
200 $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
201- @target=$(SHA1TEST); $(BUILD_CMD)
202+ +@target=$(SHA1TEST); $(BUILD_CMD)
203
204 $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
205- @target=$(SHA256TEST); $(BUILD_CMD)
206+ +@target=$(SHA256TEST); $(BUILD_CMD)
207
208 $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
209- @target=$(SHA512TEST); $(BUILD_CMD)
210+ +@target=$(SHA512TEST); $(BUILD_CMD)
211
212 $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
213- @target=$(RMDTEST); $(BUILD_CMD)
214+ +@target=$(RMDTEST); $(BUILD_CMD)
215
216 $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
217- @target=$(MDC2TEST); $(BUILD_CMD)
218+ +@target=$(MDC2TEST); $(BUILD_CMD)
219
220 $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
221- @target=$(MD4TEST); $(BUILD_CMD)
222+ +@target=$(MD4TEST); $(BUILD_CMD)
223
224 $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
225- @target=$(MD5TEST); $(BUILD_CMD)
226+ +@target=$(MD5TEST); $(BUILD_CMD)
227
228 $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
229- @target=$(HMACTEST); $(BUILD_CMD)
230+ +@target=$(HMACTEST); $(BUILD_CMD)
231
232 $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
233- @target=$(WPTEST); $(BUILD_CMD)
234+ +@target=$(WPTEST); $(BUILD_CMD)
235
236 $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
237- @target=$(RC2TEST); $(BUILD_CMD)
238+ +@target=$(RC2TEST); $(BUILD_CMD)
239
240 $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
241- @target=$(BFTEST); $(BUILD_CMD)
242+ +@target=$(BFTEST); $(BUILD_CMD)
243
244 $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
245- @target=$(CASTTEST); $(BUILD_CMD)
246+ +@target=$(CASTTEST); $(BUILD_CMD)
247
248 $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
249- @target=$(RC4TEST); $(BUILD_CMD)
250+ +@target=$(RC4TEST); $(BUILD_CMD)
251
252 $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
253- @target=$(RC5TEST); $(BUILD_CMD)
254+ +@target=$(RC5TEST); $(BUILD_CMD)
255
256 $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
257- @target=$(DESTEST); $(BUILD_CMD)
258+ +@target=$(DESTEST); $(BUILD_CMD)
259
260 $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
261- @target=$(RANDTEST); $(BUILD_CMD)
262+ +@target=$(RANDTEST); $(BUILD_CMD)
263
264 $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
265- @target=$(DHTEST); $(BUILD_CMD)
266+ +@target=$(DHTEST); $(BUILD_CMD)
267
268 $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
269- @target=$(DSATEST); $(BUILD_CMD)
270+ +@target=$(DSATEST); $(BUILD_CMD)
271
272 $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
273- @target=$(METHTEST); $(BUILD_CMD)
274+ +@target=$(METHTEST); $(BUILD_CMD)
275
276 $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
277- @target=$(SSLTEST); $(FIPS_BUILD_CMD)
278+ +@target=$(SSLTEST); $(FIPS_BUILD_CMD)
279
280 $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
281- @target=$(ENGINETEST); $(BUILD_CMD)
282+ +@target=$(ENGINETEST); $(BUILD_CMD)
283
284 $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
285- @target=$(EVPTEST); $(BUILD_CMD)
286+ +@target=$(EVPTEST); $(BUILD_CMD)
287
288 $(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
289- @target=$(EVPEXTRATEST); $(BUILD_CMD)
290+ +@target=$(EVPEXTRATEST); $(BUILD_CMD)
291
292 $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
293- @target=$(ECDSATEST); $(BUILD_CMD)
294+ +@target=$(ECDSATEST); $(BUILD_CMD)
295
296 $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
297- @target=$(ECDHTEST); $(BUILD_CMD)
298+ +@target=$(ECDHTEST); $(BUILD_CMD)
299
300 $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
301- @target=$(IGETEST); $(BUILD_CMD)
302+ +@target=$(IGETEST); $(BUILD_CMD)
303
304 $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO)
305- @target=$(JPAKETEST); $(BUILD_CMD)
306+ +@target=$(JPAKETEST); $(BUILD_CMD)
307
308 $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO)
309- @target=$(ASN1TEST); $(BUILD_CMD)
310+ +@target=$(ASN1TEST); $(BUILD_CMD)
311
312 $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
313- @target=$(SRPTEST); $(BUILD_CMD)
314+ +@target=$(SRPTEST); $(BUILD_CMD)
315
316 $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
317- @target=$(V3NAMETEST); $(BUILD_CMD)
318+ +@target=$(V3NAMETEST); $(BUILD_CMD)
319
320 $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO)
321- @target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
322+ +@target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
323
324 $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
325- @target=$(CONSTTIMETEST) $(BUILD_CMD)
326+ +@target=$(CONSTTIMETEST) $(BUILD_CMD)
327
328 $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
329- @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
330+ +@target=$(VERIFYEXTRATEST) $(BUILD_CMD)
331
332 $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o
333- @target=$(CLIENTHELLOTEST) $(BUILD_CMD)
334+ +@target=$(CLIENTHELLOTEST) $(BUILD_CMD)
335
336 $(BADDTLSTEST)$(EXE_EXT): $(BADDTLSTEST).o
337- @target=$(BADDTLSTEST) $(BUILD_CMD)
338+ +@target=$(BADDTLSTEST) $(BUILD_CMD)
339
340 $(FATALERRTEST)$(EXE_EXT): $(FATALERRTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
341 @target=$(FATALERRTEST); exobj=ssltestlib.o; $(BUILD_CMD)
Brad Bishop220d5532018-08-14 00:59:39 +0100342
343 $(X509TIMETEST)$(EXE_EXT): $(X509TIMETEST).o
344- @target=$(X509TIMETEST) $(BUILD_CMD)
345+ +@target=$(X509TIMETEST) $(BUILD_CMD)
346
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500347 $(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFTEST).o
348- @target=$(SSLV2CONFTEST) $(BUILD_CMD)
349+ +@target=$(SSLV2CONFTEST) $(BUILD_CMD)
350
351 $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
352- @target=$(DTLSTEST); exobj=ssltestlib.o; $(BUILD_CMD)
353+ +@target=$(DTLSTEST); exobj=ssltestlib.o; $(BUILD_CMD)
354
355 #$(AESTEST).o: $(AESTEST).c
356 # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
Brad Bishop220d5532018-08-14 00:59:39 +0100357@@ -596,7 +596,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500358 # fi
359
360 dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
361- @target=dummytest; $(BUILD_CMD)
362+ +@target=dummytest; $(BUILD_CMD)
363
364 # DO NOT DELETE THIS LINE -- make depend depends on it.
365
366--
3672.15.1
368