diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2013-05-29 10:36:57 +0200 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2013-06-28 22:02:44 +0200 |
commit | f1c092da8ba4d03125387a337ab45c9b5a1315dc (patch) | |
tree | 02bdcd2a5e84cb6e39f7e824804007b5ebea9211 /package/python3/python3-008-no-rpath.patch | |
parent | fc034397fc5c85115a7cc29b8dcc6738a1f8cdc3 (diff) | |
download | buildroot-novena-f1c092da8ba4d03125387a337ab45c9b5a1315dc.tar.gz buildroot-novena-f1c092da8ba4d03125387a337ab45c9b5a1315dc.zip |
python3: Port python2 patches to reduce the interpreter size
Some of the python2 patches were left behind when doing the python3
package. This was because the python build system can now autodetect
what packages can be built in the system.
However, some of these patches are actually useful to reduce drastically
the size of the interpreter.
This patch ports the relevant patches to the python3 package, and adds a
new patch to remove the idle3 IDE as well from the interpreter.
Fixes #5696
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/python3/python3-008-no-rpath.patch')
-rw-r--r-- | package/python3/python3-008-no-rpath.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/package/python3/python3-008-no-rpath.patch b/package/python3/python3-008-no-rpath.patch new file mode 100644 index 000000000..cdeec22ce --- /dev/null +++ b/package/python3/python3-008-no-rpath.patch @@ -0,0 +1,51 @@ +Remove runtime library paths + +For some extensions (sqlite and dbm), Python setup.py script +hardcode a runtime path (rpath) into the extension. However, this +runtime path is incorrect (because it points to the location of the +library directory on the development machine) and useless (because on +the target, all useful libraries are in a standard directory searched +by the dynamic loader). For those reasons, we just get rid of the +runtime paths in cross-compilation mode. + +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> +--- + setup.py | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +Index: Python-3.3.0/setup.py +=================================================================== +--- Python-3.3.0.orig/setup.py ++++ Python-3.3.0/setup.py +@@ -1134,11 +1134,15 @@ + # can end up with a bad search path order. + if sqlite_incdir not in self.compiler.include_dirs: + include_dirs.append(sqlite_incdir) ++ if cross_compiling: ++ sqlite_runtime_libdir = None ++ else: ++ sqlite_runtime_libdir = sqlite_libdir + exts.append(Extension('_sqlite3', sqlite_srcs, + define_macros=sqlite_defines, + include_dirs=include_dirs, + library_dirs=sqlite_libdir, +- runtime_library_dirs=sqlite_libdir, ++ runtime_library_dirs=sqlite_runtime_libdir, + extra_link_args=sqlite_extra_link_args, + libraries=["sqlite3",])) + else: +@@ -1205,9 +1209,13 @@ + elif cand == "bdb": + if db_incs is not None: + if dbm_setup_debug: print("building dbm using bdb") ++ if cross_compiling: ++ dblib_runtime_libdir = None ++ else: ++ dblib_runtime_libdir = dblib_dir + dbmext = Extension('_dbm', ['_dbmmodule.c'], + library_dirs=dblib_dir, +- runtime_library_dirs=dblib_dir, ++ runtime_library_dirs=dblib_runtime_libdir, + include_dirs=db_incs, + define_macros=[ + ('HAVE_BERKDB_H', None), |