# Gcc 12.3 (new compiler maybe)

**URL:** <https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048>\
**Category:** ProffieOS\
**Created:** [September 29, 2023, 5:59am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048 "2023-09-29T05:59:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [September 29, 2023, 5:59am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/1 "2023-09-29T05:59:52Z")

</div>

So I’ve been having some trouble with my color display implementation. Turns out that part of the problem is that the compiler will in some case generate completely bogus code.

Luckly, there are new releases of the gcc compiler. The arduino-proffieboard plugin currently uses gcc 9.2, which a couple of years old. The latest is 12.3, which so far seems to be better at not generating bogus code.

Anyways, unless I find something wrong with it, I will make an update for the arduino-proffieboard plugin soon which uses a newer compiler.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [September 29, 2023, 6:17pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/2 "2023-09-29T18:17:41Z")

</div>

I wonder if maybe some of the other weird bugs we’ve been chasing are related to gcc bugs too?

---

<div class="post-metadata">

**Author:** ![NoSloppy](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/nosloppy/32/3865_2.png) [@NoSloppy](https://crucible.hubbe.net/u/NoSloppy)\
**Post date:** [October 1, 2023, 12:38am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/3 "2023-10-01T00:38:12Z")

</div>

Not sure how it could be related to SD card not found once in a blue moon, but better sleep at night would be nice.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [October 1, 2023, 5:24am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/4 "2023-10-01T05:24:09Z")

</div>

It’s possible, although the errors I’ve had while working on color displays have been a lot more severe. In one instance, a function which does not have any loops whatsoever was compiled into an infinite loop, causing ProffieOS to freeze instantly. In another case, debug printouts from the code were printed out of order, indicating that some parts of the code had either been optimized away, or that jumps in the code were going to the wrong location. Pretty weird stuff.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [October 8, 2023, 7:25am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/5 "2023-10-08T07:25:30Z")

</div>

Ok, so I made a version of the arduino-proffieboard plugin that uses gcc 12.3.  
It seems to work pretty well and generate slightly smaller code.

If you want to try it, you’ll need to have the “experimental” package index in your “additional board manager urls”:

[https://profezzorn.github.io/arduino-proffieboard/package\_proffieboard\_experimental\_index.json](https://profezzorn.github.io/arduino-proffieboard/package_proffieboard_experimental_index.json)

Arduino 2.x is reasonably good at keeping things separate, so you can have both the experimental and the regular version installed and swap between them in Tools → Board.

If you try it out, let me know if it works for you. (Just drop a note in this thread) I hope to promote this to beta, and then stable eventually, but I want plenty of testing first, and it takes forever if I have to do it all myself.

---

<div class="post-metadata">

**Author:** ![LyleStyle](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/lylestyle/32/296_2.png) [@LyleStyle](https://crucible.hubbe.net/u/LyleStyle)\
**Post date:** [October 8, 2023, 6:14pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/6 "2023-10-08T18:14:52Z")

</div>

I had moved up in arduino versions and rolled back at some point to 1.8.19

Has anyone had probs with 2.2.1 (current public release). If not then I’ll upgrade and try the new plugin. I just don’t wanna run two variables at the same time (the upgrade being one of them).

---

<div class="post-metadata">

**Author:** ![Maff76](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@Maff76](https://crucible.hubbe.net/u/Maff76)\
**Post date:** [October 8, 2023, 8:05pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/7 "2023-10-08T20:05:45Z")

</div>

just flashed my v3.9 graflex, only one font and nothing fancy for blade sytle, smaller code generated and seems to be working 🙂

been using 2.2.1 for a few weeks and not sure if anything bad, but sabers flash and work

---

<div class="post-metadata">

**Author:** ![NoSloppy](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/nosloppy/32/3865_2.png) [@NoSloppy](https://crucible.hubbe.net/u/NoSloppy)\
**Post date:** [October 9, 2023, 1:39am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/8 "2023-10-09T01:39:42Z")

</div>

> [@profezzorn](#):
>
> [https://profezzorn.github.io/arduino-proffieboard/package\_proffieboard\_experimental\_index.json](https://profezzorn.github.io/arduino-proffieboard/package_proffieboard_experimental_index.json)

@profezzorn Oddly, this is giving me a hard time installing on MacOS.  
It seemed like it worked:

- Boards Manager progress bar completed “downloading tools”
- Tools\>Board\>Proffieboard was there.
- Error compiling for Proffieboard V2. `Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/arm-none-eabi-g++: no such file or directory`  
I looked and actually there’s nothing inside 12-3-rel1.  
I uninstalled (deleted package) and tried to reinstall a few more times but I repeatedly got:

```auto
org/tukaani/xz/XZInputStream
java.lang.NoClassDefFoundError: org/tukaani/xz/XZInputStream
	at cc.arduino.utils.ArchiveExtractor.extract(ArchiveExtractor.java:103)
	at cc.arduino.utils.ArchiveExtractor.extract(ArchiveExtractor.java:82)
	at cc.arduino.contributions.packages.ContributionInstaller.install(ContributionInstaller.java:141)
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:172)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.tukaani.xz.XZInputStream
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

```

Tried removing and installing again, and now back to case 1, it looks successful, but no directories after /12-3-rel1.

---

<div class="post-metadata">

**Author:** ![NoSloppy](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/nosloppy/32/3865_2.png) [@NoSloppy](https://crucible.hubbe.net/u/NoSloppy)\
**Post date:** [October 9, 2023, 2:33am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/9 "2023-10-09T02:33:25Z")

</div>

I manually installed from the tarball and working now.  
However, compiled size is larger now.  
3.6.0 = sketch 247800  
3.7.0 = sketch 255832

Also a note, Arduino 1.8.19 is allowing me to have both installed simultaneously, and choose from the Tools\>Board menu no problem.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [October 9, 2023, 6:25am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/10 "2023-10-09T06:25:55Z")

</div>

Arduino 1.x doesn’t support \*.tar.xz files.  
Not an issue on windows, because the windows file is zip file, but the Linux and Mac files are \*.xz files, which requires Arduino 2.x. I could repackage the files I suppose, but as it is, I can reference the files directly from the arm-gcc website, which is kind of nice.

Guess size depends on what is compiled.  
I’ve only tried a couple of things, and most of them were slightly smaller.  
The color display program got bigger though, but that is because gcc 9 was optimizing away things that are actually needed…

---

<div class="post-metadata">

**Author:** ![LyleStyle](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/lylestyle/32/296_2.png) [@LyleStyle](https://crucible.hubbe.net/u/LyleStyle)\
**Post date:** [October 10, 2023, 9:04pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/11 "2023-10-10T21:04:14Z")

</div>

I’m running Mac Ventura 13.5.1 and Arduino 1.8.19

When I attempted to install the experimental package 3.7, I got this error at the bottom of the boards manager and the installation failed:

```auto
org/tukaani/xz/XZInputStream

```

---

<div class="post-metadata">

**Author:** ![LyleStyle](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/lylestyle/32/296_2.png) [@LyleStyle](https://crucible.hubbe.net/u/LyleStyle)\
**Post date:** [October 10, 2023, 9:46pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/12 "2023-10-10T21:46:34Z")

</div>

Bumped up to Arduino 2.2.1

With the current plug-in:

Sketch uses 206512 bytes (78%) of program storage space. Maximum is 262144 bytes.

With the experimental plug-in I got an error. I was able to select Tools\>Board\>Proffieboard Experimental\>Proffieboard V2

Error:

```auto

fork/exec /Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/arm-none-eabi-g++: no such file or directory

Compilation error: fork/exec /Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/arm-none-eabi-g++: no such file or directory

```

Sorry, I tried 🙂

Edit: still glad to help if I can.

---

<div class="post-metadata">

**Author:** ![NoSloppy](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/nosloppy/32/3865_2.png) [@NoSloppy](https://crucible.hubbe.net/u/NoSloppy)\
**Post date:** [October 10, 2023, 10:44pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/13 "2023-10-10T22:44:53Z")

</div>

Correct, same. Installer doesn’t get anything extracted to go inside 12-3-rel1 directory. (see profezzorn’s explanation above)  
So empty folder = file not found error.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [October 10, 2023, 11:43pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/14 "2023-10-10T23:43:36Z")

</div>

Try uninstall / reinstall the experimental plugin (with Arduino 2.2.1)

---

<div class="post-metadata">

**Author:** ![LyleStyle](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/lylestyle/32/296_2.png) [@LyleStyle](https://crucible.hubbe.net/u/LyleStyle)\
**Post date:** [October 11, 2023, 12:43am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/15 "2023-10-11T00:43:09Z")

</div>

Successfully compiles after uninstall/reinstall.

Output:

```auto
/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld:/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/hardware/stm32l4/3.7/variants/STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper: note: see the '-flto' option documentation for more information
/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: warning: start of section .bss changed by 8
Sketch uses 206800 bytes (78%) of program storage space. Maximum is 262144 bytes.

```

Output from standard plug in:

```auto
/Users/catherinebogin/Library/Arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld:/Users/catherinebogin/Library/Arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 206512 bytes (78%) of program storage space. Maximum is 262144 bytes.

```

Looks like the experimental sketch uses 288 more bytes. Easy to switch back and forth.

---

<div class="post-metadata">

**Author:** ![LyleStyle](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/lylestyle/32/296_2.png) [@LyleStyle](https://crucible.hubbe.net/u/LyleStyle)\
**Post date:** [October 11, 2023, 12:54am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/16 "2023-10-11T00:54:55Z")

</div>

I thought to run the same config for a v3 board as I’m working on one for the first time.

Standard compiler output:

```auto
/Users/catherinebogin/Library/Arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld:/Users/catherinebogin/Library/Arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L452RE-ProffieboardV3/linker_scripts/STM32L452RE_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 207664 bytes (40%) of program storage space. Maximum is 507904 bytes.

```

Experimental:

```auto
/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld:/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/hardware/stm32l4/3.7/variants/STM32L452RE-ProffieboardV3/linker_scripts/STM32L452RE_FLASH.ld:224: warning: memory region `SRAM2' not declared
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper: note: see the '-flto' option documentation for more information
/Users/catherinebogin/Library/Arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: warning: start of section .bss changed by 8
Sketch uses 208248 bytes (41%) of program storage space. Maximum is 507904 bytes.

```

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [October 11, 2023, 4:39am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/17 "2023-10-11T04:39:16Z")

</div>

> [@LyleStyle](#):
>
> ```auto
> lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
> lto-wrapper: note: see the '-flto' option documentation for more information
> 
> ```

This warning is new, normal and nothing to worry about. (It’s annoying so maybe I’ll see if I can make it go away.)

---

<div class="post-metadata">

**Author:** ![Khufu01](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/k/bcef8e/32.png) [@Khufu01](https://crucible.hubbe.net/u/Khufu01)\
**Post date:** [October 17, 2023, 11:21pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/19 "2023-10-17T23:21:57Z")

</div>

Supposedly that warning is fixed in GCC 13. The next question is how many other things does GCC 13 break.

---

<div class="post-metadata">

**Author:** ![Sabersense](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/sabersense/32/2960_2.png) [@Sabersense](https://crucible.hubbe.net/u/Sabersense)\
**Post date:** [November 10, 2023, 10:43am UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/20 "2023-11-10T10:43:57Z")

</div>

When I try to upload a config under the 3.7.0. plugin, I get the error below.

System is MacOS 10.15.7 Catalina, Arduino 1.8.19.

> Arduino: 1.8.19 (Mac OS X), Board: “Proffieboard V2, Serial + Mass Storage, SDCARD (SPI), 80 MHz, Smallest Code”
> 
> fork/exec /Users/chrisandlindsey/Library/Arduino15/packages/proffieboard\_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/arm-none-eabi-g++: no such file or directory  
> Error compiling for board Proffieboard V2.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [November 10, 2023, 7:53pm UTC](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048/21 "2023-11-10T19:53:50Z")

</div>

Please re-install the plugin.  
Also, 1.8.19 cannot install this plugin, because it doesn’t support xz files.  
You can either untar the files manually, or you can use Arduino 2.2.1 to install it.  
Once installed, you should be able to use the plugin with Arduino 1.8.19, as well as 2.2.1.

[Next page](https://crucible.hubbe.net/t/gcc-12-3-new-compiler-maybe/4048.md?page=2)
