Open yohm opened 6 years ago
Hi, sorry for the slow response.
I think we need to add a test for X10_STATIC_LIB being set in x10.runtime/build.xml in the various stanzas of the build-bdwgc rule that don't already pass: <arg value="--disable-shared" />
to the configure command so that if X10_STATIC_LIB is set, then bdwgc is configured to not build libgc.so. If both libgc.a and libgc.so are available, the C++ compiler will prefer to link to the .so version. So we need to prevent libgc.so from being built.
Does this make sense?
Thank you for your reply. It makes sense. Do you have a plan to add an option to suppress building libgc.so?
I'd like compile an X10 program statically linked to x10 runtime libraries in order to distribute it as a stand-alone executable file. As far as I understand, libx10, libx10rt_sockets, libgc are dynamically linked by default but I'd like to link them statically.
I found that the static libraries are created when we build x10 with an environment variable
X10_STATIC_LIB
as follows.Even though I found .a files are created under x10.dist/*/lib directories,
x10c++
tries to use "libgc.so" file, which causes a run-time error likeI found a tentative workaround of deleting libgc.so to force a static link, but this must not be a canonical way. Please tell me how to link it statically.