mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-26 06:48:51 -04:00

Summary: This patch modifies the AVR toolchain so that if avr-gcc and avr-libc are detected during compilation, the CRT, libgcc, libm, and libc anre linked. This matches avr-gcc's default behaviour, and the expected behaviour of all C compilers - including the C runtime. avr-gcc also needs a -mmcu specified in order to link runtime libraries. The difference betwen this patch and avr-gcc is that this patch will warn users whenever they compile without a runtime, as opposed to GCC, which silently trims the runtime libs from the linker arguments when no -mmcu is specified. Reviewers: aaron.ballman, kparzysz, asb, hfinkel, brucehoult, TimNN Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D54334 llvm-svn: 361116
11 lines
538 B
C
11 lines
538 B
C
// RUN: %clang -### -target avr -no-canonical-prefixes -save-temps %s 2>&1 | FileCheck --check-prefix=WARN %s
|
|
// RUN: %clang -### -target avr -no-canonical-prefixes -save-temps -mmcu=atmega328 %s 2>&1 | FileCheck --check-prefix=NOWARN %s
|
|
|
|
// WARN: warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name>
|
|
// WARN: warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked
|
|
|
|
// NOWARN: main
|
|
|
|
int main() { return 0; }
|
|
|