Kaydet (Commit) b078e0d6 authored tarafından Michael Stahl's avatar Michael Stahl

python3: put a RPATH into libpython3.so

libpython3.so is the "ABI compatible" wrapper library around
libpython3.5m.so - it is not actually used by anything in LO right now,
but let's ensure it has RPATH $ORIGIN just in case.

This revealed that the AIX patch in python3 accidentally changed the
SONAME of libpython3.5m.so from upstream's libpython3.5m.so.1.0
on ELF platforms, because the SONAME variable was set in the shell
command but read as a make variable in the next line, which is actually
evaluated earlier.

So rename a few files in packages to use the upstream SONAME.

Change-Id: I3611f75eee62b0993b853230521a2fa41ac5cd9c
üst 3d31cf66
...@@ -45,9 +45,8 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYT ...@@ -45,9 +45,8 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYT
else else
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python))
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so))
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so))
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so-gdb.py,Tools/gdb/libpython.py)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0-gdb.py,Tools/gdb/libpython.py))
# versioned lib/libpython3.3m.so.1.0 appears to be unnecessary?
# Unfortunately the python build system does not allow to explicitly enable or # Unfortunately the python build system does not allow to explicitly enable or
# disable these, it just tries to build them and then prints which did not # disable these, it just tries to build them and then prints which did not
......
...@@ -17,7 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ ...@@ -17,7 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\
$(eval $(call gb_UnpackedTarball_add_patches,python3,\ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/i100492-freebsd.patch.1 \ external/python3/i100492-freebsd.patch.1 \
external/python3/python-3.3.3-aix.patch.1 \ $(if $(filter AIX,$(OS)),external/python3/python-3.3.3-aix.patch.1) \
external/python3/python-3.3.0-darwin.patch.1 \ external/python3/python-3.3.0-darwin.patch.1 \
external/python3/python-3.3.0-msvc-disable.patch.1 \ external/python3/python-3.3.0-msvc-disable.patch.1 \
external/python3/python-3.3.0-ssl.patch.1 \ external/python3/python-3.3.0-ssl.patch.1 \
......
...@@ -103,15 +103,12 @@ diff -ru python3.orig/configure.ac python3/configure.ac ...@@ -103,15 +103,12 @@ diff -ru python3.orig/configure.ac python3/configure.ac
diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
--- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200 --- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200
+++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200 +++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200
@@ -598,14 +598,20 @@ @@ -598,14 +598,17 @@
libpython$(LDVERSION).so: $(LIBRARY_OBJS) libpython$(LDVERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \ if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \ + $(BLDSHARED) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ SONAME="-Wl,-h$(INSTSONAME)"; \
+ fi; \
+ $(BLDSHARED) $(SONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
$(LN) -f $(INSTSONAME) $@; \ $(LN) -f $(INSTSONAME) $@; \
else \ else \
$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
......
set RPATH (only to be used on ELF platforms) set RPATH (only to be used on ELF platforms)
(currently nothing in LO actually links libpython3.so)
diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
--- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200 --- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200
+++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200 +++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200
...@@ -12,3 +14,15 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in ...@@ -12,3 +14,15 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
platform: $(BUILDPYTHON) pybuilddir.txt platform: $(BUILDPYTHON) pybuilddir.txt
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
--- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200
+++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200
@@ -607,7 +607,7 @@
fi
libpython3.so: libpython$(LDVERSION).so
- $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ -Wl,-rpath,\$$ORIGIN
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
$(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
...@@ -8,7 +8,7 @@ Then you'll start to see your exceptions on the console instead of them getting ...@@ -8,7 +8,7 @@ Then you'll start to see your exceptions on the console instead of them getting
lost at the UNO interface. lost at the UNO interface.
Python also comes with a gdb script Python also comes with a gdb script
libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so-gdb.py libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0-gdb.py
that is copied to instdir and will be auto-loaded by gdb; that is copied to instdir and will be auto-loaded by gdb;
it provides commands like "py-bt" to get a python-level backtrace, it provides commands like "py-bt" to get a python-level backtrace,
and "py-print" to print python variables. and "py-print" to print python variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment