From 8f4d1ca8e2ddec3dd2dbfb924ee44fae8ce20ac4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 31 Jan 2019 13:25:54 -0800 Subject: llvm: Add .dword support for aarch64 MC Signed-off-by: Khem Raj --- ...AARCH64-Add-support-for-.dword-directives.patch | 57 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 58 insertions(+) create mode 100644 recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch diff --git a/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch b/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch new file mode 100644 index 0000000..4ac102d --- /dev/null +++ b/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch @@ -0,0 +1,57 @@ +From 2c85adc50b677e9094932828aa7a51affde892fb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 31 Jan 2019 10:53:22 -0800 +Subject: [PATCH] llvm: [AARCH64] Add support for .dword directives + +This directives is supported in GNU assembler, Add support via addAliasForDirective. +Add a testcase to check for data directives + +Signed-off-by: Khem Raj +--- + .../AArch64/AsmParser/AArch64AsmParser.cpp | 3 ++- + llvm/test/MC/AArch64/data-directives-invalid.s | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 llvm/test/MC/AArch64/data-directives-invalid.s + +diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +index 6cc9b67e4d2..c43b9827cbd 100644 +--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp ++++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +@@ -244,10 +244,11 @@ public: + + // Alias .hword/.word/xword to the target-independent .2byte/.4byte/.8byte + // directives as they have the same form and semantics: +- /// ::= (.hword | .word | .xword ) [ expression (, expression)* ] ++ /// ::= (.hword | .word | .xword | .dword ) [ expression (, expression)* ] + Parser.addAliasForDirective(".hword", ".2byte"); + Parser.addAliasForDirective(".word", ".4byte"); + Parser.addAliasForDirective(".xword", ".8byte"); ++ Parser.addAliasForDirective(".dword", ".8byte"); + + // Initialize the set of available features. + setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits())); +diff --git a/llvm/test/MC/AArch64/data-directives-invalid.s b/llvm/test/MC/AArch64/data-directives-invalid.s +new file mode 100644 +index 00000000000..7b59a2e60fa +--- /dev/null ++++ b/llvm/test/MC/AArch64/data-directives-invalid.s +@@ -0,0 +1,16 @@ ++# RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck %s ++ ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive ++.hword 0xffffa ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive ++.2byte 0xffffa ++# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive ++.word 0xffffffffa ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive ++.4byte 0xffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.dword' directive ++.dword 0xffffffffffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.xword' directive ++.xword 0xffffffffffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive ++.8byte 0xffffffffffffffffa +-- +2.20.1 + diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 0d9445a..65589f9 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -25,6 +25,7 @@ SRC_URI = "\ file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ file://0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch \ + file://0017-llvm-AARCH64-Add-support-for-.dword-directives.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf