Skip to content

Check if -static-{libgcc,libstdc++} flags are supported before passing them#44

Merged
TheAssassin merged 1 commit into
linuxdeploy:masterfrom
arrowd:freebsd
Jun 7, 2026
Merged

Check if -static-{libgcc,libstdc++} flags are supported before passing them#44
TheAssassin merged 1 commit into
linuxdeploy:masterfrom
arrowd:freebsd

Conversation

@arrowd

@arrowd arrowd commented May 3, 2026

Copy link
Copy Markdown
Contributor

This fixes build on FreeBSD (with Clang).

@TheAssassin TheAssassin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have a non-static mode which you can opt into. This might lead to situations where static linking is needed but implicitly disabled. The default use case is always static linking with this tool.

@arrowd

arrowd commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

This might lead to situations where static linking is needed but implicitly disabled.

My understanding is that clang simply does not support -static-{libgcc,libstdc++} flags, but only -static, which is enough to build a statically-linked executable. I just verified that the executable I built is statically linked indeed.

@TheAssassin

Copy link
Copy Markdown
Member

Oh, now I see why you are doing it like that. In fact, there's a comment missing to explain exactly that. This kind of knowledge is otherwise going to be forgotten and a regression might be reintroduced. Please add one. See also https://standards.mousepawmedia.com/en/latest/csi.html.

Also, not sure if we should just maybe introduce a clang build job.

@TheAssassin

Copy link
Copy Markdown
Member

I see you requested a review, but your approach has not been described in the file yet. Please fix.

…g them

Clang does not support these flags and -static is enough to link everything
statically.

This fixes build on FreeBSD.
@arrowd

arrowd commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

I reworded the commit message, but not CMakeLists.txt. Now added a comment to CMakeLists.txt too.

@TheAssassin

Copy link
Copy Markdown
Member

Thanks. IMO, such information belongs into the code, not the commit history. Trying to find the motivation of changes in the commit history is merely a waste of time. Let's merge this!

@TheAssassin TheAssassin merged commit 536b068 into linuxdeploy:master Jun 7, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants