Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 12.1 support #159

Open
tlaurion opened this issue Aug 31, 2022 · 15 comments
Open

GCC 12.1 support #159

tlaurion opened this issue Aug 31, 2022 · 15 comments

Comments

@tlaurion
Copy link

-Oz looks really promising for embedded devices!

Optimize aggressively for size rather than speed. This may increase the number of instructions executed if those instructions require fewer bytes to encode. -Oz behaves similarly to -Os including enabling most -O2 optimizations.

src:https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html

@tlaurion
Copy link
Author

And now I'm confused. Is Oz Apple related?

https://gcc.gnu.org/legacy-ml/gcc/2017-08/msg00281.html

@aka-mj
Copy link

aka-mj commented Sep 16, 2022

I just made a build with 12.1 and was able to compile with -Oz and run on x86-64.

It's difficult to find history on -Oz, but it may be that this was originally for Apple only and more recently expanded to more platforms/architectures.

@AlexKordic
Copy link

Hi @aka-mj, how did you built with gcc 12.1? The musl.cc download page offers GCC: 11.2.1

@tlaurion
Copy link
Author

@aka-mj ping

@tlaurion
Copy link
Author

tlaurion commented Mar 13, 2024

@aka-mj
Copy link

aka-mj commented Apr 1, 2024

@tlaurion, @AlexKordic, I built this via gcc 12.1 by modifying the Makefile to use GCC 12.1.

- GCC_VER = 9.4.0
+ GCC_VER = 12.1.0

@tlaurion
Copy link
Author

@aka-mj not sure how that would work

  • patches missing
  • checksum validation missing

My last post was about patches having been done downstream.

I guess my question is if it would be OK if a or was made with that content even if I'm not the original author, referencing to whare it was found.

@aka-mj
Copy link

aka-mj commented Apr 16, 2024

@tlaurion , I didn't add patches but I did add the package checksum.

aka-mj@c7b0311

@sean-mcmanus
Copy link

We've encountered a gcc 11 crash bug with std::regex_match that is fixed with gcc 12.

@rofl0r
Copy link
Contributor

rofl0r commented May 7, 2024

@sean-mcmanus gcc 11 was just updated to 11.4. does the bug still exist there ? if so please provide a link to the bugtracker issue report so we can backport the patch.

@sean-mcmanus
Copy link

sean-mcmanus commented May 7, 2024

@rofl0r The bug repros with MUSL gcc 11.4, but not when I switch to the non-musl gcc 12, but I wasn't able to locate a bug report on the gcc site, but it could be a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61601, which isn't fixed, since the crash call stack is very big, but maybe something in gcc 12 causes the stack to not overflow, or maybe building non-musl is affecting the stack size. I'll check if non-musl gcc 11 still repros it later today, or if the crash can be made to occur with gcc 12 with an even larger call stack repro.

@rofl0r
Copy link
Contributor

rofl0r commented May 7, 2024

if it's related to stack size, it may well be that musl's default thread stack of 128 (or was it enlarged to 180?) KB isn't sufficient for your application - that is if you encounter this from a thread that's not the main thread. in that case you can request a bigger stack with pthread_attr_setstacksize(3p).

@sean-mcmanus
Copy link

@rofl0r Yeah, increasing the thread stack size fixed it. Thanks. We had already done that for other scenarios, but this case went over our previous increase.

@tlaurion
Copy link
Author

tlaurion commented May 7, 2024

@rofl0r may I ask why musl-cross doesn't intent to provide 12.x support?

@richfelker
Copy link
Owner

There's no intent that it not be provided; it's just not something I have tested patches for, and as maintainer I'm not going to merge something for which I have no idea whether it works or (in the case of some of the PRs) that's making other random wrong changes alongside adding support for new versions.

12.x and 13.x are coming at some point, once I get to them. Well-documented PRs that make no extraneous changes and that cite where the patches are from and why any that have been dropped are no longer needed would probably help move this along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants