-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Building with CMARK_SHARED=OFF fails #247
Comments
The problem is that the |
I've looked into a fix for this — I'm fairly sure trying to build shared and static at the same time is a bug? They generate different export headers. @nwellnhof Pulling the command outside of the shared block doesn't work because there's no We either only permit building static or shared at one point in time, or generate separate export headers (which will require source-level tinkering, as we currently just always |
I believe this was fixed by #249, so closing. |
@jgm: Building with CMARK_SHARED=OFF works now, but the end result is a statically linked cmark binary:
If I want the binary to be statically linked, what options should I set? The CMARK_STATIC and CMARK_SHARED options only mention the library. |
Currently the binary is always just compiled as a separate target with all the library sources included. (i.e. you can turn both |
Trying to build with both of those set to OFF causes the build to fail with the same error from before:
My question of how do I compile a static binary still hasn't be answered. I'm not terribly familiar with cmake, and I would like to build a static cmark binary without having to modify files in the repository if possible. |
As @kivikakk said, the cmark executable is always built as a separate target with all the library sources included. This produces exactly the same result as linking with a static cmark library. |
I'm attempting to work building cmark in a static manner again, and I would like clarification on this comment. Unless I'm missing something, this doesn't appear to be the case because the generated executable depends on linux-vdso.so.1, libc.so.6 and /lib64/ld-linux-x86-64.so.2 as shown by the ldd output above. Just because it's not dynamically linked to the cmark library doesn't mean it isn't dynamically linked to other libraries. I'm trying to make an entirely hermetic binary that doesn't depend on any shared libraries. |
You can build a completely static executable like this:
On my Linux system, this results in:
|
Perfect; thank you! |
I'm attempting to build a static cmark binary by setting the cmake option "CMARK_SHARED" to "OFF", but the cmark binary fails to build. This is the script I'm using:
The build fails because the compiler is unable to locate some source files. All failed builds show the exact same error:
Here's the diff of the generated Makefiles with CMAKE_SHARED=ON/OFF:
A year and a half ago, I opened #129 , and I was able to build just a static cmark binary by modifying CMakeFiles.txt at your recommendation, but that no longer works either:
How should I go about build a static cmark binary now?
The text was updated successfully, but these errors were encountered: