Skip to contentSkip to conversation

kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS

PATCH In review Matthias Kaehlcke 2 participants 2 messages Apr 25, 2017 – Apr 28, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS

From: Michael Davidson <[email protected]>

The Linux Kernel relies on GCC's acceptance of inline assembly as an opaque object which will not have any validation performed on the content. The current behaviour in LLVM is to perform validation of the contents by means of parsing the input if the MC layer can handle it.

Disable clangs integrated assembler and use the GNU assembler instead.

Wording-mostly-from: Saleem Abdulrasool <[email protected]>

---
Changes in v2:
- Added paragraph explaining why this change is needed
- Updated subject (was: Makefile, LLVM: add -no-integrated-as to KBUILD_[AC]FLAGS)

(agreed with Michael to update the patch)

 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index 5039b9148d15..3832c8243334 100644
@@ -710,6 +710,8 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
 # See modpost pattern 2
 KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
 KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
+KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
 else
 
 # These warnings generated too much noise in a regular build.
Signature · 1 line
2.13.0.rc0.306.g87b477812d-goog
#1 lore raw

2017-04-26 7:47 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 7 lines

From: Michael Davidson <[email protected]>

The Linux Kernel relies on GCC's acceptance of inline assembly as an opaque object which will not have any validation performed on the content. The current behaviour in LLVM is to perform validation of the contents by means of parsing the input if the MC layer can handle it.

Quoted 6 lines

Disable clangs integrated assembler and use the GNU assembler instead.

Wording-mostly-from: Saleem Abdulrasool <[email protected]>

---

Applied to linux-kbuild/kbuild. Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada