-
-
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
Probe and dlopen() the correct libstdc++ #46976
Changes from all commits
8a2ad6b
314df3e
b395b0b
128e8be
b4f876f
f423adb
6d84325
2961b0f
6ff2bf5
799c642
c652040
1574d22
213fdce
ea99107
ece7a5a
2788bc0
c4a95e7
ca967aa
4bf5699
3314c16
794e7a7
483a081
f570772
2c9a17e
cc88e0e
a8262e4
f675f17
7685f15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ LOADER_LDFLAGS = $(JLDFLAGS) -ffreestanding -L$(build_shlibdir) -L$(build_libdir | |
|
||
ifeq ($(OS),WINNT) | ||
LOADER_CFLAGS += -municode -mconsole -nostdlib -fno-stack-check -fno-stack-protector -mno-stack-arg-probe | ||
else ifeq ($(OS),Linux) | ||
LOADER_CFLAGS += -DGLIBCXX_LEAST_VERSION_SYMBOL=\"$(shell echo "$(CSL_NEXT_GLIBCXX_VERSION)" | cut -d'|' -f1 | sed 's/\\//g')\" | ||
endif | ||
|
||
ifeq ($(OS),WINNT) | ||
|
@@ -110,7 +112,7 @@ endif | |
|
||
$(build_shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_OBJS) $(SRCDIR)/list_strip_symbols.h | $(build_shlibdir) $(build_libdir) | ||
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,[email protected]) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(SHIPFLAGS) $(LIB_OBJS) -o $@ \ | ||
$(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(RPATH_LIB) $(call SONAME_FLAGS,libjulia.$(JL_MAJOR_SHLIB_EXT))) | ||
$(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(call SONAME_FLAGS,libjulia.$(JL_MAJOR_SHLIB_EXT))) | ||
@$(INSTALL_NAME_CMD)libjulia.$(SHLIB_EXT) $@ | ||
ifeq ($(OS), WINNT) | ||
@# Note that if the objcopy command starts getting too long, we can use `@file` to read | ||
|
@@ -120,7 +122,7 @@ endif | |
|
||
$(build_shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_DOBJS) $(SRCDIR)/list_strip_symbols.h | $(build_shlibdir) $(build_libdir) | ||
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,[email protected]) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(DEBUGFLAGS) $(LIB_DOBJS) -o $@ \ | ||
$(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(RPATH_LIB) $(call SONAME_FLAGS,libjulia-debug.$(JL_MAJOR_SHLIB_EXT))) | ||
$(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(call SONAME_FLAGS,libjulia-debug.$(JL_MAJOR_SHLIB_EXT))) | ||
@$(INSTALL_NAME_CMD)libjulia-debug.$(SHLIB_EXT) $@ | ||
ifeq ($(OS), WINNT) | ||
@$(call PRINT_ANALYZE, $(OBJCOPY) $(build_libdir)/$(notdir $@).tmp.a $(STRIP_EXPORTED_FUNCS) $(build_libdir)/$(notdir $@).a && rm $(build_libdir)/$(notdir $@).tmp.a) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,17 +12,16 @@ endef | |
|
||
# CSL bundles lots of system compiler libraries, and while it is quite bleeding-edge | ||
# as compared to what most distros ship, if someone tries to build an older branch, | ||
# the version of CSL that ships with that branch may become relatively old. This is | ||
# not a problem for code that is built in BB, but when we build Julia with the system | ||
# the version of CSL that ships with that branch may be relatively old. This is not | ||
# a problem for code that is built in BB, but when we build Julia with the system | ||
# compiler, that compiler uses the version of `libstdc++` that it is bundled with, | ||
# and we can get linker errors when trying to run that `julia` executable with the | ||
# and we can get linker errors when trying to run that `julia` executable with the | ||
# `libstdc++` that comes from the (now old) BB-built CSL. | ||
# | ||
# To fix this, we take note when the system `libstdc++.so` is newer than whatever we | ||
# would get from CSL (by searching for a `GLIBCXX_3.4.X` symbol that does not exist | ||
# in our CSL, but would in a newer one), and default to `USE_BINARYBUILDER_CSL=0` in | ||
# this case. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a leftover comment which should probably be moved to Make.inc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apaz-cli can you move this comment please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, just copy it, since it makes sense in both places. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, it seems the comment I edited above is derived from the comment here, but has unique typos?! What's going on there? |
||
CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.31|GLIBCXX_3\.5\.|GLIBCXX_4\. | ||
|
||
# First, check to see if BB is disabled on a global setting | ||
ifeq ($(USE_BINARYBUILDER),0) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for other reviewers: we also identified that libgit2, lib*san, and all suitesparse libraries do not have
RUNPATH: $ORIGIN
in them as expected. Of those, however, the lib*san libraries are not installed, so we don't care about them currently. Secondly, we appear to load all of the dependencies of libgit2 at startup (excluding libgit2 itself), according toLibdl.dllist()
, so it shouldn't see a change there, even with attempted LD_LIBRARY_PATH overloading:And while we do not load all of SuiteSparse at startup, the
_jll
pkg will attempt to sort them correctly, so the presence ofRPATH $ORIGIN
should be of little to no consequence, compared toRUNPATH $ORIGIN
that we would prefer to see there.So these seem to be the only 2 libraries that we need to care about for this PR to progress at present.