Summary: | [4.5 Regression] AVR fails to build with other than C family languages | ||
---|---|---|---|
Product: | gcc | Reporter: | Andy Hutchinson <hutchinsonandy> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aesok, eric.weddington, gcc-bugs, mstein.lists |
Priority: | P3 | Keywords: | build |
Version: | 4.5.0 | ||
Target Milestone: | 4.5.0 | ||
Host: | Target: | avr-*-* | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2009-12-22 03:29:41 | |
Attachments: |
Make log file
PATCH to add avr-c.c |
Description
Andy Hutchinson
2009-12-22 03:18:10 UTC
Created attachment 19366 [details]
Make log file
A way to fix this is to have avr-c.c like most other targets have. And declare avr_cpu_cpp_builtins in there. Note this change broke other languages besides C/C++/Objective-C/Objective-C++ so this is a regression as at one point Ada was building. Created attachment 19375 [details]
PATCH to add avr-c.c
Here is patch that I believe moves out the C related stuff to avr-c.
builtin_define_std and cpp_define are undeclared - since they have no prototypes - which is pretty ugly.
Compiler now builds without disabling LTO - BUT I now have LTO/WHPR problems with LD that is possibly a different bug.
I would like opinion on this before concluding the problem is fixed or indeed solution is getting closer.
Testsuite fails all lto/whopr tests: Example: Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc -B/media/verbatim/gcchead/obj-dir/gcc/ /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c -w -O2 -flto -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES -DSIGNAL_SUPPRESS -mmcu=atmega128 /home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf -lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80ffff -lm -o /media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6 (timeout = 300) spawn /media/verbatim/gcchead/obj-dir/gcc/xgcc -B/media/verbatim/gcchead/obj-dir/gcc/ /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c -w -O2 -flto -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES -DSIGNAL_SUPPRESS -mmcu=atmega128 /home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf -lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80ffff -lm -o /media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6 /home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be used without -shared compiler exited with status 1 output is: /home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be used without -shared FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation, -O2 -flto Subject: Bug 42457 Author: hutchinsonandy Date: Thu Dec 24 20:32:38 2009 New Revision: 155460 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155460 Log: 2009-12-24 Andy Hutchinson <hutchinsonandy@gcc.gnu.org> PR target/42457 * config/avr/avr.c (avr_extra_arch_macro): Remove static. (avr_cpu_cpp_builtins): Remove. * config/avr/avr.h (avr_extra_arch_macro): Add prototype. * config/avr/avr-c.c: New File. (avr_cpu_cpp_builtins) : Add. * config/avr/t-avr: Add make information for avr-c. * config.gcc (avr-*-*): Include avr-c.o as c and cpp object. Added: trunk/gcc/config/avr/avr-c.c Modified: trunk/gcc/ChangeLog trunk/gcc/config.gcc trunk/gcc/config/avr/avr.c trunk/gcc/config/avr/avr.h trunk/gcc/config/avr/t-avr Fixed 4.5 |