diff mbox series

[11/12] s390: make chkbss work with clang

Message ID 20190408212648.2407234-11-arnd@arndb.de
State Accepted
Commit 9a0ceb9cfbee7da4a005135c620603ea837878a9
Headers show
Series [01/12] s390: remove -fno-strength-reduce flag | expand

Commit Message

Arnd Bergmann April 8, 2019, 9:26 p.m. UTC
llvm skips an empty .bss section entirely, which makes
the check fail with an unexpected error:

/tmp/binutils-multi-test/bin/s390x-linux-gnu-objdump: section '.bss' mentioned in a -j option, but not found in any input file
error: arch/s390/boot/compressed/decompressor.o .bss section is not empty
../arch/s390/scripts/Makefile.chkbss:20: recipe for target 'arch/s390/boot/compressed/decompressor.o.chkbss' failed

Change the check so we first see if a .bss section exists
before trying to read its size.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 arch/s390/scripts/Makefile.chkbss | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.20.0

Comments

Martin Schwidefsky April 10, 2019, 4:02 p.m. UTC | #1
On Mon,  8 Apr 2019 23:26:24 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> llvm skips an empty .bss section entirely, which makes

> the check fail with an unexpected error:

> 

> /tmp/binutils-multi-test/bin/s390x-linux-gnu-objdump: section '.bss' mentioned in a -j option, but not found in any input file

> error: arch/s390/boot/compressed/decompressor.o .bss section is not empty

> ../arch/s390/scripts/Makefile.chkbss:20: recipe for target 'arch/s390/boot/compressed/decompressor.o.chkbss' failed

> 

> Change the check so we first see if a .bss section exists

> before trying to read its size.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Added to s390/linux:features for the next merge window. Thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.
diff mbox series

Patch

diff --git a/arch/s390/scripts/Makefile.chkbss b/arch/s390/scripts/Makefile.chkbss
index cd7e8f4419f5..884a9caff5fb 100644
--- a/arch/s390/scripts/Makefile.chkbss
+++ b/arch/s390/scripts/Makefile.chkbss
@@ -11,7 +11,8 @@  chkbss: $(addprefix $(obj)/, $(chkbss-files))
 
 quiet_cmd_chkbss = CHKBSS  $<
       cmd_chkbss = \
-	if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
+	if $(OBJDUMP) -h $< | grep -q "\.bss" && \
+	   ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
 		echo "error: $< .bss section is not empty" >&2; exit 1; \
 	fi; \
 	touch $@;