]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
asm: handle comments when creating header file
authorNorbert Manthey <nmanthey@amazon.com>
Wed, 6 Feb 2019 14:09:33 +0000 (15:09 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 12 Feb 2019 10:48:40 +0000 (10:48 +0000)
In the early steps of compilation, the asm header files are created, such
as include/asm-$(TARGET_ARCH)/asm-offsets.h. These files depend on the
assembly file arch/$(TARGET_ARCH)/asm-offsets.s, which is generated
before. Depending on the used toolchain, there might be comments in the
assembly files. Especially the goto-gcc compiler of the bounded model
checker CBMC adds comments that start with a '#' symbol at the beginning
of the line.

This commit adds handling comments in assembler during the creation of the
asm header files, especially ignoring lines that start with '#', which
indicate comments for both ARM and x86 assembler. The used tool goto-as
produces exactly comments of this kind.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Signed-off-by: Michael Tautschnig <tautschn@amazon.co.uk>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/Makefile

index 749c21348818c56932830f0d2d4dd117303444e6..ea82fc8ba64963e658daec5d6f6aac1ca6e19243 100644 (file)
@@ -191,7 +191,7 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
          echo "#ifndef __ASM_OFFSETS_H__"; \
          echo "#define __ASM_OFFSETS_H__"; \
          echo ""; \
-         sed -rne "/==>/{s:.*==>(.*)<==.*:\1:; s: [\$$#]: :; p;}"; \
+         sed -rne "/^[^#].*==>/{s:.*==>(.*)<==.*:\1:; s: [\$$#]: :; p;}"; \
          echo ""; \
          echo "#endif") <$< >$@