EmBitz
The .weak bug in gcc - Printable Version

+- EmBitz (https://www.embitz.org/forum)
+-- Forum: IDE (https://www.embitz.org/forum/forum-1.html)
+--- Forum: ARM GCC toolchain (https://www.embitz.org/forum/forum-4.html)
+--- Thread: The .weak bug in gcc (/thread-123.html)



The .weak bug in gcc - PDonchev - 19-04-2022

Hi embitz,

Do you have any plans to update the gcc compiler that came with EmBitz?
The .weak bug is very annoying: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83967
I can't use the "generic" compiler because it's reserved for other purposes (ESP8266). Is it possible to add support for more "generic" compilers in the future?


RE: The .weak bug in gcc - embitz - 20-04-2022

EmBitz after 2.30 is using 9.3.1 and your "bug" reference is about 7.2.1

If I use LTO I always make this workable by changing the build priority of the particular files so that they will be linked before the .weak functions are pulled in.

Tip: This workaround can also be found on the internet where users are discussing these problems.


RE: The .weak bug in gcc - PDonchev - 20-04-2022

I was confused by "Lower weight means higher priority (order of compiling)". After I set the startup .s file to 0 (where a weak handler is defined) and the .c file to 100, the code is built correctly.