All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 04/20] python-profile-opt: rename libpython
Date: Tue, 16 May 2017 16:18:34 +0300	[thread overview]
Message-ID: <48b8649296a998b3514f3f79489d6b1d68c08a9f.1494939394.git.markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <cover.1494939394.git.markus.lehtonen@linux.intel.com>
In-Reply-To: <cover.1494939394.git.markus.lehtonen@linux.intel.com>

The python library needs to be renamed so that the automatic dependency
generation/checking mechanism in bitbake does not get confused.
Otherwise python-profile-opt will depend on libpython from the "normal"
python package.

[YOCTO #9338]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 .../python/python-profile-opt_2.7.13.bb            |  6 +-
 ...rename-libpython-to-libpython-profile-opt.patch | 94 ++++++++++++++++++++++
 2 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python/rename-libpython-to-libpython-profile-opt.patch

diff --git a/meta/recipes-devtools/python/python-profile-opt_2.7.13.bb b/meta/recipes-devtools/python/python-profile-opt_2.7.13.bb
index 058cc63bc9..df5eee89c8 100644
--- a/meta/recipes-devtools/python/python-profile-opt_2.7.13.bb
+++ b/meta/recipes-devtools/python/python-profile-opt_2.7.13.bb
@@ -1,7 +1,6 @@
 require python_${PV}.bb
 
-PROVIDES += "libpython2"
-RPROVIDES_${PN}-core += "libpython2"
+SRC_URI += "file://rename-libpython-to-libpython-profile-opt.patch"
 
 # Use special prefix in order to prevent clash with normal python
 STAGING_INCDIR_DEFAULT = "${STAGING_DIR_HOST}/usr/include"
@@ -12,6 +11,3 @@ prefix = "/opt"
 exec_prefix = "/opt"
 
 PYTHON_MAKE_TARGET = "build_all_generate_profile"
-
-# Force pkgdata not to clash with python recipe
-PKG_libpython-profile-opt2 = "libpython-profile-opt2.7-1.0"
diff --git a/meta/recipes-devtools/python/python/rename-libpython-to-libpython-profile-opt.patch b/meta/recipes-devtools/python/python/rename-libpython-to-libpython-profile-opt.patch
new file mode 100644
index 0000000000..06bb4c02b3
--- /dev/null
+++ b/meta/recipes-devtools/python/python/rename-libpython-to-libpython-profile-opt.patch
@@ -0,0 +1,94 @@
+From bc4690886248d87c019cf3c955d5349327f6fdfc Mon Sep 17 00:00:00 2001
+From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+Date: Mon, 17 Oct 2016 15:58:21 +0300
+Subject: [PATCH] rename libpython to libpython-profile-opt
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ Lib/distutils/command/build_ext.py | 2 +-
+ Makefile.pre.in                    | 2 +-
+ Misc/python-config.in              | 2 +-
+ Misc/python.pc.in                  | 2 +-
+ configure.ac                       | 6 +++---
+ 5 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
+index 3a49454..56cabce 100644
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -758,7 +758,7 @@ class build_ext (Command):
+         else:
+             from distutils import sysconfig
+             if sysconfig.get_config_var('Py_ENABLE_SHARED'):
+-                template = "python%d.%d"
++                template = "python-profile-opt%d.%d"
+                 pythonlib = (template %
+                              (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
+                 return ext.libraries + [pythonlib]
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index d4b81dc..43fe5fe 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -562,7 +562,7 @@ $(LIBRARY): $(LIBRARY_OBJS)
+ 	$(AR) $(ARFLAGS) $@ $(MODOBJS)
+ 	$(RANLIB) $@
+ 
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython-profile-opt$(VERSION).so: $(LIBRARY_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ 		$(LN) -f $(INSTSONAME) $@; \
+diff --git a/Misc/python-config.in b/Misc/python-config.in
+index 9ee0fdf..9fb149d 100644
+--- a/Misc/python-config.in
++++ b/Misc/python-config.in
+@@ -44,7 +44,7 @@ for opt in opt_flags:
+         print ' '.join(flags)
+ 
+     elif opt in ('--libs', '--ldflags'):
+-        libs = ['-lpython' + pyver]
++        libs = ['-lpython-profile-opt' + pyver]
+         libs += getvar('LIBS').split()
+         libs += getvar('SYSLIBS').split()
+         # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+diff --git a/Misc/python.pc.in b/Misc/python.pc.in
+index 08481a9..0822e54 100644
+--- a/Misc/python.pc.in
++++ b/Misc/python.pc.in
+@@ -8,6 +8,6 @@ Description: Python library
+ Requires: 
+ Version: @VERSION@
+ Libs.private: @LIBS@
+-Libs: -L${libdir} -lpython@VERSION@
++Libs: -L${libdir} -lpython-profile-opt@VERSION@
+ Cflags: -I${includedir}/python@VERSION@ 
+ 
+diff --git a/configure.ac b/configure.ac
+index 353b533..0b8e399 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -765,7 +765,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+-	LIBRARY='libpython$(VERSION).a'
++	LIBRARY='libpython-profile-opt$(VERSION).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+ 
+@@ -911,8 +911,8 @@ if test $enable_shared = "yes"; then
+ 	  INSTSONAME="$LDLIBRARY".$SOVERSION
+           ;;
+     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+-	  LDLIBRARY='libpython$(VERSION).so'
+-	  BLDLIBRARY='-L. -lpython$(VERSION)'
++	  LDLIBRARY='libpython-profile-opt$(VERSION).so'
++	  BLDLIBRARY='-L. -lpython-profile-opt$(VERSION)'
+ 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+ 	  case $ac_sys_system in
+ 	      FreeBSD*)
+-- 
+2.6.6
+
-- 
2.12.0



  parent reply	other threads:[~2017-05-16 13:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 13:18 [PATCH v2 00/20] support profile-optimized build for Python Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 01/20] python-native: support profile optimized build Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 02/20] python: add python-profile-opt recipe Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 03/20] python: remove path hack from setup.py Markus Lehtonen
2017-05-16 13:18 ` Markus Lehtonen [this message]
2017-05-16 13:18 ` [PATCH v2 05/20] devtools/images: add python-pgo-image Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 06/20] python: make profile-optimized build possible Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 07/20] python-pgo-image: exclude tests from the default profile target Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 08/20] python: add python-tools subpackage Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 09/20] python-pgo-image: switch python default profile task to pybench Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 10/20] python-pgo-image: enable sstate for do_profile Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 11/20] python3-native: support profile optimized build Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 12/20] python3: fix depends of python-tests Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 13/20] python3: add python-profile-opt3 recipe Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 14/20] python-pgo-image: profiling for python3 Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 15/20] python3: remove two setup.py cross-compile hacks Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 16/20] python3: support profile optimized build Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 17/20] python3: fix profile-optimized build of modules Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 18/20] python-pgo-image: exclude tests from the python3 profile target Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 19/20] python3: add python3-tools subpackage Markus Lehtonen
2017-05-16 13:18 ` [PATCH v2 20/20] python-pgo-image: change python3 profile target to pybench Markus Lehtonen
2017-05-16 13:23 ` [PATCH v2 00/20] support profile-optimized build for Python Alexander Kanavin
2017-05-16 14:07   ` Markus Lehtonen
2017-05-16 14:08     ` Alexander Kanavin
2017-05-16 13:45 ` Richard Purdie
2017-05-16 14:16   ` Markus Lehtonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48b8649296a998b3514f3f79489d6b1d68c08a9f.1494939394.git.markus.lehtonen@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.