-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Windows build fails on MinGW GCC 13 due to libssp changes #51740
Comments
The symbol is |
Is it? Even using GCC 12, from our CI's environment,
And the
|
Looks like
vs
|
MWE: extern __declspec(dllimport) int __stack_chk_guard;
int* foo(void)
{
return &__stack_chk_guard;
}
Works on GCC 12, fails on 13. Tried some combinations of |
Looks like the static libssp libraries were intentionally removed and replaced with empty alternatives: msys2/MINGW-packages#13414 msys2/MINGW-packages#13405 AFAICT, the stack protector implementation is now provided by libmingwex: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/10394c9a966f8e93e9e2f09677dab273a0f6c00c/
Simply adding |
It is outdated libmingwex apparently, the new one (corresponding to the new libssp) contains |
Is this related to this news announcement? https://www.msys2.org/news/#2022-10-10-libssp-is-no-longer-required
|
Yes.
|
We ship libssp.dll.a with the CompilerSupportLibraries (CSL) dependency, so we just need to append that to diff --git a/src/Makefile b/src/Makefile
index c78df75bdc..b433fbfdee 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -163,7 +163,7 @@ else
LIBJULIA_PATH_REL := libjulia
endif
-COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir)
+COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir) -L$(build_private_libdir)
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
RT_DEBUG_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a -ljulia-debug $(RT_LIBS) nevermind: this goes back to the beginning. |
My current work around is as follows.
I think the following should fix it. diff --git a/deps/csl.mk b/deps/csl.mk
index aaebc8f50c..c3bbede366 100644
--- a/deps/csl.mk
+++ b/deps/csl.mk
@@ -110,7 +110,7 @@ install-csl:
cp -a $(build_libdir)/gcc/$(BB_TRIPLET)/13/libgcc_s.a $(build_private_libdir)/
cp -a $(build_libdir)/gcc/$(BB_TRIPLET)/13/libgcc.a $(build_private_libdir)/
cp -a $(build_libdir)/gcc/$(BB_TRIPLET)/13/libmsvcrt.a $(build_private_libdir)/
- cp -a $(build_libdir)/gcc/$(BB_TRIPLET)/13/libssp.dll.a $(build_private_libdir)/
+ cp -a $(build_libdir)/gcc/$(BB_TRIPLET)/13/libssp.dll.a $(build_libdir)/
endif
endif
ifeq ($(OS),WINNT)
@@ -119,5 +119,5 @@ uninstall-gcc-libraries:
-rm -f $(build_private_libdir)/libgcc_s.a
-rm -f $(build_private_libdir)/libgcc.a
-rm -f $(build_private_libdir)/libmsvcrt.a
- -rm -f $(build_private_libdir)/libssp.dll.a
+ -rm -f $(build_libdir)/libssp.dll.a
endif |
…dir (#52820) Fix #51740 Since we are providing libssp.dll on Windows and we want to dynamically link to it, exposing libssp.dll.a is necessary. The inconsistency is that libjulia-codegen.so looks in build_libdir and build_private_libdir while standard library precompilation looks in build_shlibdir and build_private_dir.
…dir (#52820) Fix #51740 Since we are providing libssp.dll on Windows and we want to dynamically link to it, exposing libssp.dll.a is necessary. The inconsistency is that libjulia-codegen.so looks in build_libdir and build_private_libdir while standard library precompilation looks in build_shlibdir and build_private_dir. (cherry picked from commit c3836e1)
Compiling Julia on Windows with GCC 13 from MSYS2 (which is the only available compiler) fails during linking:
This is on #51698, because otherwise the CSL static libraries break the build.
I'm not entirely sure where we should be getting
__stack_chk_guard
from; it's defined inrtutils.c
, butHAVE_SSP
is set, so that code isn't activated:julia/src/rtutils.c
Lines 218 to 228 in 4d2d849
Meanwhile,
libssp.dll
from CSL has the symbol:... and we do link this DLL, but that somehow doesn't seem to help:
cc @vtjnash
See below for a MWE, and the link to upstream changes causing this.
Workaround:
override HAVE_SSP := 0
inMake.user
.The text was updated successfully, but these errors were encountered: