-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Sway static compilation failure on set_cloexec #4677
Comments
Hmm. This function shouldn't be exported by wlroots because we use a version script to filter symbols: https://github.com/swaywm/wlroots/blob/master/wlroots.syms Maybe the version script isn't run properly when generating a static lib? |
Yeah, the "rules" for symbol exporting when statically linking are not the same. |
Hmm, I'd rather fix our exported symbols for the static lib. |
If all the static libs are just being pushed directly into the sway binary, there isn't a way to actually enforce the exported/not-exported settings since it's all just a bunch of .o files in the end? Or is my linker knowledge out of date? can you $LINKER -o binary file1.o -Wl=filter-for-file-2 file2.o ? |
Hmm, actually Meson doesn't use |
set_cloexec is defined by both sway and wlroots (and who-knows-else), so rename the sway one for supporting static linkage. We also remove the duplicate version of this in client/. Fixes: swaywm#4677
PR is probably not an ideal but a fix none-the-less. |
set_cloexec is defined by both sway and wlroots (and who-knows-else), so rename the sway one for supporting static linkage. We also remove the duplicate version of this in client/. Fixes: #4677
Compiling sway in static mode fails due to conflicting symbols exposed by both wlroots and sway. The symbol is set_cloexec. This function is duplicated a few times across both code bases.
Simple version of my build commands:
Full version of my build script: https://gist.github.com/sheenobu/bfa8f758878184a4c5b72066a938bd8f
Expected output:
a binary with sway and wlroots statically linked together
Actual output:
I was able to fix this by inlining set_cloexec within include/util.h but i think fixing this in wlroots might be better? just make set_cloexec a wlroots util function that can be imported in?
HACK, don't use:
The text was updated successfully, but these errors were encountered: