@@ -0,0 +1,45 @@
1+
2+From Yang Shi <>
3+Subject [PATCH] crypto: rsa - fix a potential race condition in build
4+Date Fri, 2 Dec 2016 15:41:04 -0800
5+
6+
7+When building kernel with RSA enabled with multithreaded, the below
8+compile failure might be caught:
9+
10+| /buildarea/kernel-source/crypto/rsa_helper.c:18:28: fatal error: rsapubkey-asn1.h: No such file or directory
11+| #include "rsapubkey-asn1.h"
12+| ^
13+| compilation terminated.
14+| CC crypto/rsa-pkcs1pad.o
15+| CC crypto/algboss.o
16+| CC crypto/testmgr.o
17+| make[3]: *** [/buildarea/kernel-source/scripts/Makefile.build:289: crypto/rsa_helper.o] Error 1
18+| make[3]: *** Waiting for unfinished jobs....
19+| make[2]: *** [/buildarea/kernel-source/Makefile:969: crypto] Error 2
20+| make[1]: *** [Makefile:150: sub-make] Error 2
21+| make: *** [Makefile:24: __sub-make] Error 2
22+
23+The header file is not generated before rsa_helper is compiled, so
24+adding dependency to avoid such issue.
25+
26+Signed-off-by: Yang Shi <yang.shi@windriver.com>
27+
28+---
29+ crypto/Makefile | 1 +
30+ 1 file changed, 1 insertion(+)
31+
32+diff --git a/crypto/Makefile b/crypto/Makefile
33+index 99cc64a..8db39f9 100644
34+--- a/crypto/Makefile
35++++ b/crypto/Makefile
36+@@ -40,6 +40,7 @@ obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o
37+
38+ $(obj)/rsapubkey-asn1.o: $(obj)/rsapubkey-asn1.c $(obj)/rsapubkey-asn1.h
39+ $(obj)/rsaprivkey-asn1.o: $(obj)/rsaprivkey-asn1.c $(obj)/rsaprivkey-asn1.h
40++$(obj)/rsa_helper.o: $(obj)/rsa_helper.c $(obj)/rsaprivkey-asn1.h
41+ clean-files += rsapubkey-asn1.c rsapubkey-asn1.h
42+ clean-files += rsaprivkey-asn1.c rsaprivkey-asn1.h
43+
44+--
45+2.0.2