-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fix static builds #305
Fix static builds #305
Conversation
I don't know if this is correct, either. What does Libs.private do? |
From man pkg-config: Libs.private:
|
@gjedeer I'd like to see the error output you're getting. Just to be sure this is our problem, and not how you're building. That said, after reading this https://autotools.io/pkgconfig/dependencies.html#pkgconfig.static-link It makes me think that adding the same libs to Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, some commit checks broke. Comments from Reviewable |
The Makefile is as simple as they come. With the Libs.private change, the linker is executed like this:
and pkg-config outputs as following:
Without Libs.private:
and pkg-config outputs as following:
The former links correctly, the latter yields a stream of errors starting with:
I have no idea what makes my change work with --static, it's the same output but all -l flags are duplicated. |
Can it be that the order of -l flags is wrong and that's why duplication resolves the build (but if that's the case, why does the dynamic build work?) |
|
Sorry for flooding but I resolved this in a much simpler way: moving -ltoxcore to the front. Updated PR accordingly. |
Can you rebase this on master? Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
Done |
Reviewed 2 of 2 files at r1. Comments from Reviewable |
I'm porting tuntox to work with TokTok c-toxcore and couldn't get it to link statically - dynamic linking works.
I'm not sure if the solution in this pull request is valid but it definitely makes the static linking work.
This change is