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

Tell GCC to optimize for code size in some .c files #2202

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

fredrik-johansson
Copy link
Collaborator

@fredrik-johansson fredrik-johansson commented Jan 28, 2025

Some files have large chunks of code that don't need to be optimized for execution speed, so it makes sense to selectively compile with -Os.

This shrinks my libflint.so by 300 KB.

@fredrik-johansson
Copy link
Collaborator Author

@albinahlback Does this look OK?

@albinahlback albinahlback merged commit f62cdb2 into flintlib:main Jan 30, 2025
12 checks passed
@albinahlback
Copy link
Collaborator

Yes!

@albinahlback
Copy link
Collaborator

Perhaps this was not the best solution. For optimizations, Clang does not work like GCC as it will not accept these things. One should really push -Os when compiling the file here.

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

Successfully merging this pull request may close these issues.

2 participants