[PATCH] D78117: [AVR] Define __ELF__
Ayke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 09:06:15 PDT 2020
aykevl created this revision.
aykevl added reviewers: dylanmckay, rjmccall, MaskRay.
aykevl added a project: LLVM.
Herald added subscribers: cfe-commits, Jim.
Herald added a project: clang.
aykevl updated this revision to Diff 257358.
This symbol is defined in avr-gcc. Because AVR normally uses the ELF format, define the symbol unconditionally.
This patch is needed to get Clang to compile compiler-rt.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D78117
Files:
clang/lib/Basic/Targets/AVR.cpp
clang/test/CodeGen/avr/target-cpu-defines/atmega328p.c
clang/test/CodeGen/avr/target-cpu-defines/attiny104.c
clang/test/CodeGen/avr/target-cpu-defines/common.c
Index: clang/test/CodeGen/avr/target-cpu-defines/common.c
===================================================================
--- clang/test/CodeGen/avr/target-cpu-defines/common.c
+++ clang/test/CodeGen/avr/target-cpu-defines/common.c
@@ -4,3 +4,4 @@
// CHECK: #define AVR 1
// CHECK: #define __AVR 1
// CHECK: #define __AVR__ 1
+// CHECK: #define __ELF__ 1
Index: clang/test/CodeGen/avr/target-cpu-defines/attiny104.c
===================================================================
--- clang/test/CodeGen/avr/target-cpu-defines/attiny104.c
+++ clang/test/CodeGen/avr/target-cpu-defines/attiny104.c
@@ -5,3 +5,4 @@
// CHECK: #define __AVR 1
// CHECK: #define __AVR_ATtiny104__ 1
// CHECK: #define __AVR__ 1
+// CHECK: #define __ELF__ 1
Index: clang/test/CodeGen/avr/target-cpu-defines/atmega328p.c
===================================================================
--- clang/test/CodeGen/avr/target-cpu-defines/atmega328p.c
+++ clang/test/CodeGen/avr/target-cpu-defines/atmega328p.c
@@ -5,3 +5,4 @@
// CHECK: #define __AVR 1
// CHECK: #define __AVR_ATmega328P__ 1
// CHECK: #define __AVR__ 1
+// CHECK: #define __ELF__ 1
Index: clang/lib/Basic/Targets/AVR.cpp
===================================================================
--- clang/lib/Basic/Targets/AVR.cpp
+++ clang/lib/Basic/Targets/AVR.cpp
@@ -300,6 +300,7 @@
Builder.defineMacro("AVR");
Builder.defineMacro("__AVR");
Builder.defineMacro("__AVR__");
+ Builder.defineMacro("__ELF__");
if (!this->CPU.empty()) {
auto It = llvm::find_if(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78117.257358.patch
Type: text/x-patch
Size: 1530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200414/b5f2373a/attachment.bin>
More information about the llvm-commits
mailing list