@@ -1479,7 +1479,7 @@ JULIA_SYSIMG_release := $(build_private_libdir)/sys.$(SHLIB_EXT)
1479
1479
JULIA_SYSIMG := $(JULIA_SYSIMG_$(JULIA_BUILD_MODE ) )
1480
1480
1481
1481
define dep_lib_path
1482
- $$( $(PYTHON ) $(call python_cygpath,$(JULIAHOME ) /contrib/relative_path.py) $(1 ) $(2 ) )
1482
+ $( shell $(PYTHON ) $(call python_cygpath,$(JULIAHOME ) /contrib/relative_path.py) $(1 ) $(2 ) )
1483
1483
endef
1484
1484
1485
1485
LIBJULIAINTERNAL_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir ) ,$(build_shlibdir ) /libjulia-internal.$(JL_MAJOR_SHLIB_EXT ) )
@@ -1526,6 +1526,19 @@ LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(L
1526
1526
endif
1527
1527
LIBGCC_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir ) ,$(private_shlibdir ) /$(LIBGCC_NAME ) )
1528
1528
1529
+ # We only bother to define this on Linux, as that's the only platform that does libstdc++ probing
1530
+ # On all other platforms, the LIBSTDCXX_*_DEPLIB variables will be empty.
1531
+ ifeq ($(OS ) ,Linux)
1532
+ LIBSTDCXX_NAME := libstdc++.so.6
1533
+ ifeq ($(USE_SYSTEM_CSL ) ,1)
1534
+ LIBSTDCXX_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir ) ,$(build_private_shlibdir ) /$(LIBSTDCXX_NAME ) )
1535
+ else
1536
+ LIBSTDCXX_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir ) ,$(build_shlibdir ) /$(LIBSTDCXX_NAME ) )
1537
+ endif
1538
+ LIBSTDCXX_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir ) ,$(private_shlibdir ) /$(LIBSTDCXX_NAME ) )
1539
+ endif
1540
+
1541
+
1529
1542
# USE_SYSTEM_LIBM and USE_SYSTEM_OPENLIBM causes it to get symlinked into build_private_shlibdir
1530
1543
ifeq ($(USE_SYSTEM_LIBM ) ,1)
1531
1544
LIBM_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir ) ,$(build_private_shlibdir ) /$(LIBMNAME ) .$(SHLIB_EXT ) )
@@ -1539,6 +1552,8 @@ LIBM_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBMN
1539
1552
# We list:
1540
1553
# * libgcc_s, because FreeBSD needs to load ours, not the system one.
1541
1554
# * libopenlibm, because Windows has an untrustworthy libm, and we want to use ours more than theirs
1555
+ # * libstdc++, because while performing `libstdc++` probing we need to
1556
+ # know the path to the bundled `libstdc++` library.
1542
1557
# * libjulia-internal, which must always come second-to-last.
1543
1558
# * libjulia-codegen, which must always come last
1544
1559
#
@@ -1547,11 +1562,45 @@ LIBM_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBMN
1547
1562
# * install time relative paths are not equal to build time relative paths (../lib vs. ../lib/julia)
1548
1563
# That second point will no longer be true for most deps once they are placed within Artifacts directories.
1549
1564
# Note that we prefix `libjulia-codegen` and `libjulia-internal` with `@` to signify to the loader that it
1550
- # should not automatically dlopen() it in its loading loop.
1551
- LOADER_BUILD_DEP_LIBS = $(LIBGCC_BUILD_DEPLIB ) :$(LIBM_BUILD_DEPLIB ) :@$(LIBJULIAINTERNAL_BUILD_DEPLIB ) :@$(LIBJULIACODEGEN_BUILD_DEPLIB ) :
1552
- LOADER_DEBUG_BUILD_DEP_LIBS = $(LIBGCC_BUILD_DEPLIB ) :$(LIBM_BUILD_DEPLIB ) :@$(LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB ) :@$(LIBJULIACODEGEN_DEBUG_BUILD_DEPLIB ) :
1553
- LOADER_INSTALL_DEP_LIBS = $(LIBGCC_INSTALL_DEPLIB ) :$(LIBM_INSTALL_DEPLIB ) :@$(LIBJULIAINTERNAL_INSTALL_DEPLIB ) :@$(LIBJULIACODEGEN_INSTALL_DEPLIB ) :
1554
- LOADER_DEBUG_INSTALL_DEP_LIBS = $(LIBGCC_INSTALL_DEPLIB ) :$(LIBM_INSTALL_DEPLIB ) :@$(LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB ) :@$(LIBJULIACODEGEN_DEBUG_INSTALL_DEPLIB ) :
1565
+ # should not automatically dlopen() it in its loading loop, it is "special" and should happen later.
1566
+ # We do the same for `libstdc++`, and explicitly place it _after_ `libgcc_s`, and `libm` since `libstdc++`
1567
+ # may depend on those libraries (e.g. when USE_SYSTEM_LIBM=1)
1568
+
1569
+ # Helper function to join a list with colons, then place an extra at the end.
1570
+ define build_deplibs
1571
+ $(subst $(SPACE ) ,:,$(strip $(1 ) ) ) :
1572
+ endef
1573
+
1574
+ LOADER_BUILD_DEP_LIBS = $(call build_deplibs, \
1575
+ $(LIBGCC_BUILD_DEPLIB ) \
1576
+ $(LIBM_BUILD_DEPLIB ) \
1577
+ @$(LIBSTDCXX_BUILD_DEPLIB ) \
1578
+ @$(LIBJULIAINTERNAL_BUILD_DEPLIB ) \
1579
+ @$(LIBJULIACODEGEN_BUILD_DEPLIB ) \
1580
+ )
1581
+
1582
+ LOADER_DEBUG_BUILD_DEP_LIBS = $(call build_deplibs, \
1583
+ $(LIBGCC_BUILD_DEPLIB ) \
1584
+ $(LIBM_BUILD_DEPLIB ) \
1585
+ @$(LIBSTDCXX_BUILD_DEPLIB ) \
1586
+ @$(LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB ) \
1587
+ @$(LIBJULIACODEGEN_DEBUG_BUILD_DEPLIB ) \
1588
+ )
1589
+
1590
+ LOADER_INSTALL_DEP_LIBS = $(call build_deplibs, \
1591
+ $(LIBGCC_INSTALL_DEPLIB ) \
1592
+ $(LIBM_INSTALL_DEPLIB ) \
1593
+ @$(LIBSTDCXX_INSTALL_DEPLIB ) \
1594
+ @$(LIBJULIAINTERNAL_INSTALL_DEPLIB ) \
1595
+ @$(LIBJULIACODEGEN_INSTALL_DEPLIB ) \
1596
+ )
1597
+ LOADER_DEBUG_INSTALL_DEP_LIBS = $(call build_deplibs, \
1598
+ $(LIBGCC_INSTALL_DEPLIB ) \
1599
+ $(LIBM_INSTALL_DEPLIB ) \
1600
+ @$(LIBSTDCXX_INSTALL_DEPLIB ) \
1601
+ @$(LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB ) \
1602
+ @$(LIBJULIACODEGEN_DEBUG_INSTALL_DEPLIB ) \
1603
+ )
1555
1604
1556
1605
# Colors for make
1557
1606
ifndef VERBOSE
0 commit comments