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(


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(
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to