[PATCH 09/15] scripts: link-barebox: force error on kallsyms failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Based on linux v4.5 patch: a043934207c5eb271deeaed2e9bd019c3be92cad

    scripts/link-vmlinux.sh: force error on kallsyms failure

    Since the output of the invocation of scripts/kallsyms is piped directly
    into the assembler, error messages it emits are visible on stderr, but
    a non-zero return code is ignored, and the build simply proceeds in that
    case. However, the resulting kernel is most likely broken, and will crash
    at boot.

    So instead, capture the output of kallsyms in a separate .S file, and pass
    that to the assembler in a separate step.

    Signed-off-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
    Signed-off-by: Michal Marek <mmarek@xxxxxxxx>

Signed-off-by: Steffen Trumtrar <s.trumtrar@xxxxxxxxxxxxxx>
---
 scripts/link-barebox.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/link-barebox.sh b/scripts/link-barebox.sh
index bff2363a19d5..20375792a7f7 100755
--- a/scripts/link-barebox.sh
+++ b/scripts/link-barebox.sh
@@ -94,9 +94,10 @@ kallsyms()
 	local aflags="${AFLAGS} ${AFLAGS_KERNEL}			\
 		      ${NOSTDINC_FLAGS} ${BAREBOXINCLUDE} ${CPPFLAGS}"
 
-	${NM} -n ${1} | \
-		${KALLSYMS} ${kallsymopt} | \
-		${CC} ${aflags} -c -o ${2} -x assembler-with-cpp -
+	local afile="`basename ${2} .o`.S"
+
+	${NM} -n ${1} | ${KALLSYMS} ${kallsymopt} > ${afile}
+	${CC} ${aflags} -c -o ${2} -x assembler-with-cpp ${afile}
 }
 
 # Create map file with all symbols from ${1}
-- 
2.19.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux