Skip to content

Commit f5360b9

Browse files
committed
Cleanup CSLs and compilation from source with USE_BINARYBUILDER=0
1 parent d3b2bbe commit f5360b9

File tree

14 files changed

+83
-254
lines changed

14 files changed

+83
-254
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,6 @@ endif
402402
@$(MAKE) -C $(BUILDROOT) -f $(JULIAHOME)/Makefile install
403403
cp $(JULIAHOME)/LICENSE.md $(BUILDROOT)/julia-$(JULIA_COMMIT)
404404
ifeq ($(OS), Linux)
405-
-$(JULIAHOME)/contrib/fixup-libstdc++.sh $(DESTDIR)$(libdir) $(DESTDIR)$(private_libdir)
406-
407405
# Copy over any bundled ca certs we picked up from the system during buildi
408406
-cp $(build_datarootdir)/julia/cert.pem $(DESTDIR)$(datarootdir)/julia/
409407
endif

contrib/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Installation
77
|[ check-whitespace.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/check-whitespace.sh) | Check for trailing white space |
88
|[ commit-name.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/commit-name.sh) | Computes a version name for a commit |
99
|[ filterArgs.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/filterArgs.sh) | Update library search code to use only tokens that start with -L |
10-
|[ fixup-libgfortran.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/fixup-libgfortran.sh) | Include libgfortran and libquadmath for installations |
11-
|[ fixup-libstdc++.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/fixup-libstdc++.sh) | Include libstdc++ for installations |
1210
|[ install.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/install.sh) | Installation script with different permissions |
1311
|[ julia.appdata.xml ](https://github.com/JuliaLang/julia/blob/master/contrib/julia.appdata.xml) | Appdata config file |
1412
|[ julia-config.jl ](https://github.com/JuliaLang/julia/blob/master/contrib/julia-config.jl) | Determines build parameters required by an embedded Julia |

contrib/fixup-libgfortran.sh

Lines changed: 0 additions & 163 deletions
This file was deleted.

contrib/fixup-libstdc++.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

contrib/mac/framework/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ endif
135135
# fix private lib paths
136136
$(JULIAHOME)/contrib/delete-all-rpaths.sh $(DESTDIR)$(prefix)/$(framework_frameworks)/*
137137

138-
$(JULIAHOME)/contrib/fixup-libgfortran.sh $(DESTDIR)$(prefix)/$(framework_frameworks)
139-
140138
# Add framework header
141139
sed -e 's/<Julia/<$(FRAMEWORK_NAME)/' $(JULIAHOME)/contrib/mac/framework/Julia.h > $(DESTDIR)$(prefix)/$(framework_headers)/$(FRAMEWORK_NAME).h
142140

deps/blas.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ endif
8080
endif
8181

8282
OPENBLAS_BUILD_OPTS += CFLAGS="$(CFLAGS) $(OPENBLAS_CFLAGS)"
83-
OPENBLAS_BUILD_OPTS += FFLAGS="$(FFLAGS) $(OPENBLAS_FFLAGS)"
84-
OPENBLAS_BUILD_OPTS += LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN)"
83+
OPENBLAS_BUILD_OPTS += FFLAGS="$(FFLAGS) $(OPENBLAS_FFLAGS) -L$(CSL_SHLIBDIR)"
84+
OPENBLAS_BUILD_OPTS += LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN) -L$(CSL_SHLIBDIR)"
8585

8686
# Debug OpenBLAS
8787
ifeq ($(OPENBLAS_DEBUG), 1)
@@ -110,7 +110,7 @@ $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-winexit.patch-applied: $(BUILDDIR)/$(OP
110110
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-winexit.patch-applied
111111
echo 1 > $@
112112

113-
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured
113+
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured | $(build_prefix)/manifest/compilersupportlibraries
114114
echo $(MAKE) -C $(dir $<) $(OPENBLAS_BUILD_OPTS) # echo first, so we only print the error message below in a failure case
115115
@$(MAKE) -C $(dir $<) $(OPENBLAS_BUILD_OPTS) || (echo $(WARNCOLOR)"*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 'make OPENBLAS_USE_THREAD=0' if OpenBLAS had trouble linking libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building SandyBridge support. Both these options can also be used simultaneously. ***"$(ENDCOLOR) && false)
116116
echo 1 > $@

deps/csl.mk

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,64 @@
11
ifneq ($(USE_BINARYBUILDER_CSL),1)
22

3-
# If we're not using BB-vendored CompilerSupportLibraries, then we must
4-
# build our own by stealing the libraries from the currently-running system
5-
CSL_FORTRAN_LIBDIR := $(dir $(shell $(FC) --print-file-name libgfortran.$(SHLIB_EXT)))
6-
CSL_CXX_LIBDIR := $(dir $(shell $(CXX) --print-file-name libstdc++.$(SHLIB_EXT)))
7-
8-
CXX_LIBS := libgcc_s libstdc++ libc++ libgomp
9-
FORTRAN_LIBS := libgfortran libquadmath
10-
11-
define cxx_src
12-
$(CSL_CXX_LIBDIR)/$(1)*.$(SHLIB_EXT)*
13-
endef
14-
define fortran_src
15-
$(CSL_FORTRAN_LIBDIR)/$(1)*.$(SHLIB_EXT)*
16-
endef
17-
18-
CXX_LIB_PATHS := $(foreach f,$(wildcard $(foreach lib,$(CXX_LIBS),$(call cxx_src,$(lib)))),$(realpath $(f)))
19-
FORTRAN_LIB_PATHS := $(foreach f,$(wildcard $(foreach lib,$(FORTRAN_LIBS),$(call fortran_src,$(lib)))),$(realpath $(f)))
20-
21-
UNINSTALL_compilersupportlibraries = delete-uninstaller "$(wildcard $(foreach lib,$(CXX_LIBS) $(FORTRAN_LIBS),$(build_shlibdir)/$(lib)*.$(SHLIB_EXT)*))"
22-
$(build_prefix)/manifest/compilersupportlibraries: | $(build_shlibdir) $(build_prefix)/manifest
23-
cp -va -l $(CXX_LIB_PATHS) $(build_shlibdir)/
24-
cp -va $(FORTRAN_LIB_PATHS) $(build_shlibdir)/
25-
echo '$(UNINSTALL_compilersupportlibraries)' > "$@"
3+
# If we're not using BB-vendored CompilerSupportLibraries, then we just generate
4+
# a stub JLL that loads whatever the system is running. The downside of this,
5+
# of course, is that this is much less backwards-compatible. The one exception
6+
# is FreeBSD, where we cannot rely upon the `libgcc_s` in `/lib`, but must
7+
# explicitly link against the `libgcc_s` that comes with GCC, which we find here:
8+
9+
$(BUILDDIR)/csl:
10+
mkdir -p "$@"
11+
12+
$(BUILDDIR)/csl/libgcc_finder.cc: | $(BUILDDIR)/csl
13+
@echo "int main(void) { return 0; }" >> "$@"
14+
15+
$(BUILDDIR)/csl/libgcc_finder.$(SHLIB_EXT): $(BUILDDIR)/csl/libgcc_finder.cc
16+
@$(call PRINT_CC,$(CXX) -shared $(fPIC) -o "$@" "$<")
17+
18+
ifeq ($(OS),FreeBSD)
19+
$(build_prefix)/manifest/compilersupportlibraries: $(build_prefix)/manifest/libwhich
20+
endif
21+
22+
$(build_prefix)/manifest/compilersupportlibraries: $(BUILDDIR)/csl/libgcc_finder.$(SHLIB_EXT) | $(build_shlibdir) $(build_prefix)/manifest
23+
ifeq ($(OS),FreeBSD)
24+
@cp -v $$($(call spawn,$(build_depsbindir)/libwhich) -a $< | tr '\0' '\n' | grep libgcc_s) $(build_shlibdir)
25+
@echo "delete-uninstaller $(build_shlibdir)/libgcc_s*$(SHLIB_EXT)*" > "$@"
26+
endif
27+
28+
LIBGFORTRAN_SOVER := $(subst libgfortran,,$(word 4, $(subst -, ,$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))
29+
30+
ifeq ($(OS),Linux)
31+
LIBGCC_S_SONAME := libgcc_s.so.1
32+
LIBGFORTRAN_SONAME := libgfortran.so.$(LIBGFORTRAN_SOVER)
33+
LIBSTDCXX_SONAME := libstdc++.so.6
34+
CSL_LIBNAMES := libgcc_s libgfortran libstdcxx
35+
else ifeq ($(OS),Darwin)
36+
LIBGCC_S_SONAME := libgcc_s.1.dylib
37+
LIBGFORTRAN_SONAME := libgfortran.$(LIBGFORTRAN_SOVER).dylib
38+
# We're not going to load this by default, since it's built with clang
39+
#LIBSTDCXX_SONAME := libstdc++.6.dylib
40+
CSL_LIBNAMES := libgcc_s libgfortran
41+
else ifeq ($(OS),WINNT)
42+
LIBGCC_S_SONAME := libgcc_s_seh-1.dll
43+
LIBGFORTRAN_SONAME := libgfortran-$(LIBGFORTRAN_SOVER).dll
44+
LIBSTDCXX_SONAME := libstdc++-6.dll
45+
CSL_LIBNAMES := libgcc_s libgfortran libstdcxx
46+
else ifeq ($(OS),FreeBSD)
47+
LIBGCC_S_SONAME := libgcc_s.so.1
48+
LIBGFORTRAN_SONAME := libgfortran.so.$(LIBGFORTRAN_SOVER)
49+
# We're not going to load this by default, since it's built with clang
50+
#LIBSTDCXX_SONAME := libstdc++.so.6
51+
CSL_LIBNAMES := libgcc_s libgfortran
52+
endif
2653

2754
get-compilersupportlibraries:
2855
extract-compilersupportlibraries:
2956
configure-compilersupportlibraries:
3057
compile-compilersupportlibraries:
3158
install-compilersupportlibraries: $(build_prefix)/manifest/compilersupportlibraries
3259

33-
$(eval $(call jll-generate,CompilerSupportLibraries_jll, \
34-
libgcc_s=\"libgcc_s\" \
35-
libgomp=\"libgomp\" \
36-
libgfortran=\"libgfortran\" \
37-
libstdcxx=\"libstdc++\" \
38-
,,e66e0078-7015-5450-92f7-15fbd957f2ae,))
60+
CSL_LIB_MAPPINGS := $(foreach lib,$(CSL_LIBNAMES),$(lib)=\"$($(call uppercase,$(lib))_SONAME)\")
61+
$(eval $(call jll-generate,CompilerSupportLibraries_jll,$(CSL_LIB_MAPPINGS),,e66e0078-7015-5450-92f7-15fbd957f2ae,))
3962
else # USE_BINARYBUILDER_CSL
4063

4164
# Install CompilerSupportLibraries_jll into our stdlib folder

deps/curl.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ $(eval $(call jll-generate,LibCURL_jll,libcurl=\"libcurl\",,deac9b47-8bc7-5906-a
8383
Zlib_jll=83775a58-1f1d-513f-b197-d71354ab007a))
8484
install-curl: install-LibCURL_jll
8585

86+
# Fix naming mismatches
87+
$(build_prefix)/manifest/libcurl: $(build_prefix)/manifest/curl
88+
@cp "$<" "$@"
89+
8690
else # USE_BINARYBUILDER_CURL
8791

8892
# Install LibCURL_jll into our stdlib folder

deps/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ ifeq ($(OS),Darwin)
477477
LLVM_INSTALL += && ln -s libLLVM.dylib $2$$(build_shlibdir)/libLLVM-$$(LLVM_VER_SHORT).dylib
478478
endif
479479

480-
$(eval $(call staged-install,llvm,llvm-$$(LLVM_VER)/build_$$(LLVM_BUILDTYPE), \
480+
$(eval $(call staged-install,libllvm,llvm-$$(LLVM_VER)/build_$$(LLVM_BUILDTYPE), \
481481
LLVM_INSTALL,,,))
482482

483483
clean-libllvm: clean-libcxx clean-libcxxabi

deps/p7zip.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fastcheck-p7zip: check-p7zip
5757
check-p7zip: compile-p7zip
5858

5959
# If we built our own p7zip, we need to generate a fake p7zip_jll package to load it in:
60-
$(eval $(call jll-generate,p7zip_jll,,p7zip=\"7z$(EXE)\",05ff407c-b0c1-5878-9df8-858cc2e60c36,))
60+
$(eval $(call jll-generate,p7zip_jll,,p7zip=\"7z$(EXE)\",3f19e933-33d8-53b3-aaab-bd5110c3b7a0,))
6161

6262
else # USE_BINARYBUILDER_P7ZIP
6363

0 commit comments

Comments
 (0)