* Can't compile GCC-14 for AVR
@ 2024-01-14 23:19 Levente
2024-01-15 6:09 ` Xi Ruoyao
2024-01-15 9:50 ` [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc Georg-Johann Lay
0 siblings, 2 replies; 4+ messages in thread
From: Levente @ 2024-01-14 23:19 UTC (permalink / raw)
To: gcc-help
I'm trying to set up a toolchain for avr-dd MCUs, and I get this error
message when I try to compile gcc:
/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/./gcc/xgcc
-B/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/./gcc/
-B/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/bin/
-B/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/lib/
-isystem
/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/include
-isystem
/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/sys-include
-g -O2 -mdouble=64 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE
-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include
-Dinhibit_libc -mcall-prologues -Os -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc -Dinhibit_libc -mcall-prologues -Os
-I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/.
-I../../../../libgcc/../gcc -I../../../../libgcc/../include
-DHAVE_CC_TLS -DUSE_EMUTLS -o hardcfr.o -MT hardcfr.o -MD -MP -MF
hardcfr.dep -c ../../../../libgcc/hardcfr.c -fvisibility=hidden
-DHIDE_EXPORTS
/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/./gcc/xgcc
-B/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/./gcc/
-B/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/bin/
-B/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/lib/
-isystem
/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/include
-isystem
/home/lev/git/library/software/scripts/avr_toolchain_build/out/avr/sys-include
-g -O2 -mdouble=64 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE
-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include
-Dinhibit_libc -mcall-prologues -Os -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc -Dinhibit_libc -mcall-prologues -Os
-I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/.
-I../../../../libgcc/../gcc -I../../../../libgcc/../include
-DHAVE_CC_TLS -DUSE_EMUTLS -o strub.o -MT strub.o -MD -MP -MF strub.dep
-c ../../../../libgcc/strub.c -fvisibility=hidden -DHIDE_EXPORTS
../../../../libgcc/strub.c:95:1: internal compiler error:
'global_options' are modified in local context
95 | {
| ^
0xdc6e93 cl_optimization_compare(gcc_options*, gcc_options*)
/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/gcc/options-save.cc:13442
0x96537c handle_optimize_attribute
../../gcc/c-family/c-attribs.cc:5983
0x840c04 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.cc:905
0x847559 c_decl_attributes
../../gcc/c/c-decl.cc:5495
0x85f4db start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.cc:10433
0x8cb731 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2912
0x8d6873 c_parser_external_declaration
../../gcc/c/c-parser.cc:2046
0x8d72b3 c_parser_translation_unit
../../gcc/c/c-parser.cc:1900
0x8d72b3 c_parse_file()
../../gcc/c/c-parser.cc:26815
0x94bf11 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1301
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[4]: *** [../../../../libgcc/static-object.mk:17: strub.o] Error 1
make[4]: Leaving directory
'/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/avr/double64/libgcc'
make[3]: *** [Makefile:1221: multi-do] Error 1
make[3]: Leaving directory
'/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/avr/libgcc'
make[2]: *** [Makefile:127: all-multi] Error 2
make[2]: Leaving directory
'/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr/avr/libgcc'
make[1]: *** [Makefile:13076: all-target-libgcc] Error 2
make[1]: Leaving directory
'/home/lev/git/library/software/scripts/avr_toolchain_build/gcc/obj-avr'
make: *** [Makefile:1039: all] Error 2
This is with the current HEAD of master branch.
I'm on a Debian stable, my host gcc is gcc-12.
My binutils is gdb-14.1-release.
My configure options are:
--target=avr
--enable-languages=c,c++
--disable-nls
--disable-libssp
--disable-libada
--with-dwarf2
--disable-shared
--enable-static
--enable-mingw-wildcard
--enable-plugin
--with-gnu-as
What do I do wrong?
Thanks,
Lev
--
Levente Kovacs
Senior Electronic Engineer
W: http://levente.logonex.eu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Can't compile GCC-14 for AVR
2024-01-14 23:19 Can't compile GCC-14 for AVR Levente
@ 2024-01-15 6:09 ` Xi Ruoyao
2024-01-15 9:50 ` [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc Georg-Johann Lay
1 sibling, 0 replies; 4+ messages in thread
From: Xi Ruoyao @ 2024-01-15 6:09 UTC (permalink / raw)
To: Levente, gcc-help
On Mon, 2024-01-15 at 00:19 +0100, Levente via Gcc-help wrote:
> I'm trying to set up a toolchain for avr-dd MCUs, and I get this error
> message when I try to compile gcc:
/* snip */
> ../../../../libgcc/strub.c:95:1: internal compiler error:
> 'global_options' are modified in local context
/* snip */
> What do I do wrong?
Not your mistake. This is a known bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113156
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc
2024-01-14 23:19 Can't compile GCC-14 for AVR Levente
2024-01-15 6:09 ` Xi Ruoyao
@ 2024-01-15 9:50 ` Georg-Johann Lay
2024-01-15 11:55 ` Levente
1 sibling, 1 reply; 4+ messages in thread
From: Georg-Johann Lay @ 2024-01-15 9:50 UTC (permalink / raw)
To: gcc-patches; +Cc: Andrew Pinski, Levente, gcc-help
I went ahead and installed Andrew's patch
https://gcc.gnu.org/r14-7240
Johann
Am 15.01.24 um 00:19 schrieb Levente via Gcc-help:
> I'm trying to set up a toolchain for avr-dd MCUs, and I get this error
> message when I try to compile gcc:
> Lev
--
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date: Mon Jan 15 10:31:36 2024 +0100
AVR: target/113156 - Fix ICE due to missing "Save" on
-m[long-]double= options.
Multilib options -mdouble= and -mlong-double= are not
orthogonal:
TARGET_HANDLE_OPTION = avr-common.cc::avr_handle_option()
sets them
such that sizeof(double) <= sizeof(long double) is always
true.
gcc/
PR target/113156
* config/avr/avr.opt (-mdouble, -mlong-double): Add "Save"
flag.
(-mbranch-cost): Set "Optimization" flag.
diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt
index ee0b40603f0..c9f2b4d2fe5 100644
--- a/gcc/config/avr/avr.opt
+++ b/gcc/config/avr/avr.opt
@@ -27,7 +27,7 @@ Target RejectNegative Joined Var(avr_mmcu)
MissingArgError(missing device or arc
-mmcu=MCU Select the target MCU.
mgas-isr-prologues
-Target Var(avr_gasisr_prologues) UInteger Init(0) Optimization
+Target Var(avr_gasisr_prologues) UInteger Init(0) Optimization
Allow usage of __gcc_isr pseudo instructions in ISR prologues and
epilogues.
mn-flash=
@@ -61,7 +61,7 @@ Target RejectNegative Mask(NO_INTERRUPTS)
Change the stack pointer without disabling interrupts.
mbranch-cost=
-Target Joined RejectNegative UInteger Var(avr_branch_cost) Init(0)
+Target Joined RejectNegative UInteger Var(avr_branch_cost) Init(0)
Optimization
Set the branch costs for conditional branch instructions. Reasonable
values are small, non-negative integers. The default branch cost is 0.
mmain-is-OS_task
@@ -124,11 +124,11 @@ Target Mask(ABSDATA)
Assume that all data in static storage can be accessed by LDS / STS.
This option is only useful for reduced Tiny devices.
mdouble=
-Target Joined RejectNegative Var(avr_double) Init(0) Enum(avr_bits_e)
+Target Joined RejectNegative Var(avr_double) Init(0) Enum(avr_bits_e) Save
-mdouble=<BITS> Use <BITS> bits wide double type.
mlong-double=
-Target Joined RejectNegative Var(avr_long_double) Init(0) Enum(avr_bits_e)
+Target Joined RejectNegative Var(avr_long_double) Init(0)
Enum(avr_bits_e) Save
-mlong-double=<BITS> Use <BITS> bits wide long double type.
nodevicelib
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc
2024-01-15 9:50 ` [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc Georg-Johann Lay
@ 2024-01-15 11:55 ` Levente
0 siblings, 0 replies; 4+ messages in thread
From: Levente @ 2024-01-15 11:55 UTC (permalink / raw)
To: Georg-Johann Lay, gcc-help; +Cc: Andrew Pinski
Hello Johann,
Thank you, it now compiles.
Lev
--
Levente Kovacs
Senior Electronic Engineer
W: http://levente.logonex.eu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-15 11:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-14 23:19 Can't compile GCC-14 for AVR Levente
2024-01-15 6:09 ` Xi Ruoyao
2024-01-15 9:50 ` [patch,avr,applied] Fix PR target/113156 - ICE when building libgcc Georg-Johann Lay
2024-01-15 11:55 ` Levente
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).