diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-09-21 23:42:52 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-09-21 23:58:03 +0200 |
commit | b078e0d638514b298616838fae090b8294bac32f (patch) | |
tree | d586f1d11ba65670238433877876eaa076fada2f | |
parent | 3d31cf66bb0c3f628cd175b50373f746ec45645f (diff) |
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
-rw-r--r-- | external/python3/ExternalPackage_python3.mk | 5 | ||||
-rw-r--r-- | external/python3/UnpackedTarball_python3.mk | 2 | ||||
-rw-r--r-- | external/python3/python-3.3.3-aix.patch.1 | 7 | ||||
-rw-r--r-- | external/python3/python-3.3.3-elf-rpath.patch.1 | 14 | ||||
-rw-r--r-- | pyuno/README | 2 |
5 files changed, 20 insertions, 10 deletions
diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 347b13acebd5..045b4c194e2f 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -45,9 +45,8 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYT else $(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).$(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-gdb.py,Tools/gdb/libpython.py)) -# versioned lib/libpython3.3m.so.1.0 appears to be unnecessary? +$(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.1.0-gdb.py,Tools/gdb/libpython.py)) # 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 diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 0c471f031d7e..a70005bbb953 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -17,7 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ $(eval $(call gb_UnpackedTarball_add_patches,python3,\ 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-msvc-disable.patch.1 \ external/python3/python-3.3.0-ssl.patch.1 \ diff --git a/external/python3/python-3.3.3-aix.patch.1 b/external/python3/python-3.3.3-aix.patch.1 index 1387e9c8852e..571d69a88f6b 100644 --- a/external/python3/python-3.3.3-aix.patch.1 +++ b/external/python3/python-3.3.3-aix.patch.1 @@ -103,15 +103,12 @@ diff -ru python3.orig/configure.ac python3/configure.ac 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/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200 -@@ -598,14 +598,20 @@ +@@ -598,14 +598,17 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -+ if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \ -+ SONAME="-Wl,-h$(INSTSONAME)"; \ -+ fi; \ -+ $(BLDSHARED) $(SONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ ++ $(BLDSHARED) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 index 945f7a52c690..029d98c0310d 100644 --- a/external/python3/python-3.3.3-elf-rpath.patch.1 +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -1,5 +1,7 @@ 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 --- 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 @@ -12,3 +14,15 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in platform: $(BUILDPYTHON) pybuilddir.txt $(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); \ + diff --git a/pyuno/README b/pyuno/README index a0a40027004b..26f929a28fd8 100644 --- a/pyuno/README +++ b/pyuno/README @@ -8,7 +8,7 @@ Then you'll start to see your exceptions on the console instead of them getting lost at the UNO interface. 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; it provides commands like "py-bt" to get a python-level backtrace, and "py-print" to print python variables. |