KBuild abuses the asm statement to write to a file and clang chokes about these invalid asm statements. Hack it even more by fooling this is actual valid asm code. [masahiro: Import Jeroen's work for U-Boot: http://patchwork.ozlabs.org/patch/375026/ Tweak sed script a little to avoid garbage '#' for GCC case, like #define NR_PAGEFLAGS 23 /* __NR_PAGEFLAGS # */ ]
Showing the changes to scripts (1 of 2 files). Show all
Unified · Split
| @@ -413,10 +413,14 @@ cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ · 412 unmodified lines | ||
| 413 | 413 | # --------------------------------------------------------------------------- |
| 414 | 414 | |
| 415 | 415 | # Default sed regexp - multiline due to syntax constraints |
| 416 | +# | |
| 417 | +# Use [:space:] because LLVM's integrated assembler inserts <tab> around | |
| 418 | +# the .ascii directive whereas GCC keeps the <space> as-is. | |
| 416 | 419 | define sed-offsets |
| 417 | − "/^->/{s:->#\(.*\):/* \1 */:; \ | |
| 420 | + 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \ | |
| 421 | + /^->/{s:->#\(.*\):/* \1 */:; \ | |
| 418 | 422 | s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
| 419 | − s:->::; p;}" | |
| 423 | + s:->::; p;}' | |
| 420 | 424 | endef |
| 421 | 425 | |
| 422 | 426 | # Use filechk to avoid rebuilds when a header changes, but the resulting file |