Skip to content

Commit d8929e9

Browse files
authored
build: enhance usage of libwhich path resolution to respect SONAME (#24916)
If the SONAME is available, it directly names the file we want to link to, so use that instead.
1 parent 4817d99 commit d8929e9

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ Building Julia requires that the following software be installed:
287287
- **[perl]** — preprocessing of header files of libraries.
288288
- **[wget]**, **[curl]**, or **[fetch]** (FreeBSD) — to automatically download external libraries.
289289
- **[m4]** — needed to build GMP.
290+
- **[awk]** - helper tool for Makefiles.
290291
- **[patch]** — for modifying source code.
291292
- **[cmake]** (>= 3.4.3) — needed to build `libgit2`.
292293
- **[pkg-config]** — needed to build `libgit2` correctly, especially for proxy support.

base/Makefile

+17-9
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ resolve_path += && \
130130
$1_wd=`dirname "$${$1}"`; $1=$${$1_}; \
131131
if [ -z "`echo $${$1} | grep '^/'`" ]; then $1=$${$1_wd}/$${$1}; fi; \
132132
fi
133+
else
134+
# try to use the SO_NAME (if the named file exists)
135+
resolve_path += && \
136+
$1_=`objdump -p "$${$1}" | awk '/SONAME/ {print $$2}'` && \
137+
if [ -n "$${$1_}" ]; then \
138+
$1_=$$(dirname "$${$1}")/$${$1_}; \
139+
if [ -e "$${$1_}" ]; then $1=$${$1_}; fi; \
140+
fi
133141
endif
134142

135143
## debug code: `make resolve-path P=<path to test>`
@@ -201,12 +209,12 @@ symlink_system_libraries: $(SYMLINK_SYSTEM_LIBRARIES)
201209
.PHONY: $(BUILDDIR)/build_h.jl.phony $(BUILDDIR)/version_git.jl.phony clean all symlink_*
202210

203211
clean:
204-
rm -f $(BUILDDIR)/pcre_h.jl
205-
rm -f $(BUILDDIR)/errno_h.jl
206-
rm -f $(BUILDDIR)/build_h.jl
207-
rm -f $(BUILDDIR)/build_h.jl.phony
208-
rm -f $(BUILDDIR)/fenv_constants.jl # To be removed
209-
rm -f $(BUILDDIR)/uv_constants.jl
210-
rm -f $(BUILDDIR)/file_constants.jl
211-
rm -f $(BUILDDIR)/version_git.jl
212-
rm -f $(BUILDDIR)/version_git.jl.phony
212+
-rm -f $(BUILDDIR)/pcre_h.jl
213+
-rm -f $(BUILDDIR)/errno_h.jl
214+
-rm -f $(BUILDDIR)/build_h.jl
215+
-rm -f $(BUILDDIR)/build_h.jl.phony
216+
-rm -f $(BUILDDIR)/uv_constants.jl
217+
-rm -f $(BUILDDIR)/file_constants.jl
218+
-rm -f $(BUILDDIR)/version_git.jl
219+
-rm -f $(BUILDDIR)/version_git.jl.phony
220+
-rm -f $(build_private_libdir)/lib*.$(SHLIB_EXT)*

0 commit comments

Comments
 (0)