-
Notifications
You must be signed in to change notification settings - Fork 183
build: Changes to depends to provide for completely static Gridcoin Linux build #2812
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
base: development
Are you sure you want to change the base?
build: Changes to depends to provide for completely static Gridcoin Linux build #2812
Conversation
f7af2b2
to
bacd1cf
Compare
@div72 I am not sure why MacOS depends boost is not finding libz. Can you take a look? |
Checking it out. |
3aeb108
to
f636369
Compare
|
The whole thing is janky actually. I think the original idea is that redirecting towards the local site pkgconfigs would ensure that the proper (static) libs would be picked up, but what has apparently been happening is that the system libs are leaking in rather than a failure to link the proper static library resulting in a failure of the build. This would not be easy to detect without checking ldd, because as long as the build was tested on that machine, it would work. I will put in a hack conditional to fill out this variable for MacOS. Maybe we should put an ldd check in the depends builds to make sure that only the libc libraries are linked? With Windows, this is not a problem because the whole thing has to be built given that the native Windows environment is alien. |
Good idea. Also any specific reason you decided to do this after we decided to retire autotools? |
f636369
to
d48f0dc
Compare
I view this as a dry run for what we have to do on the cmake side. |
I am sure we are going to run into a different set of issues with cmake, but this shows the pressure points. |
This addresses a linker order causing macos depends builds to fail.
I independently started to backport CMake support in depends from Bitcoin. Now I'm at the point where the daemon builds and links without issues, but there are multiple link failures for GUI. (I'm cross-compiling only for mingw32 now, no darwin yet.) |
So don't rush to support CMake right now. When static builds are fixed, it will be easier for me to finish cross-compile support with CMake. |
This PR represents an effort to build a completely static daemon and GUI version of Gridcoin.
I recently started investigating the depends builds for Linux (i.e. using HOST=x86_64-pc-linux-gnu) and very quickly realized it was completely broken. Because on some machines, the pkg-config/linker would find the system libs and link in, it would give the appearance of working, but an inspection by ldd revealed numerous unwanted dependencies.
To get this to compile correctly with only the libc system library dependencies was a significant effort. Several missing depends packages had to be added, all the depends packages converted to static libs, and then a section in configure.ac implemented to turn off the automatic lib detection and replace with defined lib variables to ensure that the system libraries didn't get picked up instead. Literally hours were spent futzing with the libraries to be included and the library order. Gemini Pro 2.5 was somewhat helpful in its assistance.
Both gridcoinresearchd and gridcoinresearch now work and give the following:
Which are the correct libc dependencies.
This should support #2456 as well as #2766.