All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 00/18] fix buildpaths QA issue
@ 2016-03-18  9:01 Hongxu Jia
  2016-03-18  9:01 ` [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ Hongxu Jia
                   ` (18 more replies)
  0 siblings, 19 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Changed in V3:

- Drop the improvement on cmake-native and python distutils compile

- Support option '-ffile-prefix-map' for gcc to replace build path
  with target path in __FILE__.
  Details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

- Reuse -fdebug-prefix-map to replace -ffile-prefix-map which could
  be compatible with external toolchain.

- Fix kernel build path issue.

//Hongxu


The following changes since commit 8debfea81e69d038bd2d56314b272cb74f5582ed:

  local.conf.sample: Disable prelink by default (2016-03-13 22:09:05 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib hongxu/fix-buildpath
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/fix-buildpath

Hongxu Jia (18):
  gcc-5.3/gcc-4.9:replace build path with target path in __FILE__
  gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map
  kernel.bbclass: fix buildpath QA issue
  valgrind: fix buildpath QA issue
  dtc.inc: fix buildpaths QA issue
  fix_buildpaths.bbclass: add bbclass to fix build path
  icu: fix buildpaths QA issue
  tcl: fix buildpath QA issue
  python2/3: fix buildpath QA issue
  bbclass distutils/distutils3: fix .pyc/.pyo buildpath
  bbclass distutils/distutils3/setuptools/setuptools3: clean up
    DISTUTILS_INSTALL_ARGS
  python-setuptools/python3-setuptools: use old-style install
  python3-pip: use old-style install
  waf.bbclass: support do patch on extracted files
  python-pycairo: fix buildpath QA issue
  openssl: fix buildpath QA issue
  gconf: fix buildpaths QA issue
  epiphany: fix buildpaths QA issue

 meta/classes/distutils.bbclass                     |   8 +-
 meta/classes/distutils3.bbclass                    |   8 +-
 meta/classes/fix_buildpaths.bbclass                |  44 ++++
 meta/classes/kernel.bbclass                        |   4 +-
 meta/classes/setuptools.bbclass                    |   5 -
 meta/classes/setuptools3.bbclass                   |   5 -
 meta/classes/waf.bbclass                           |  11 +-
 .../openssl/remove-build-path-in-source-code.patch |  44 ++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |   7 +
 meta/recipes-devtools/gcc/gcc-4.9.inc              |   2 +
 .../gcc-4.9/0072-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch |  43 ++++
 meta/recipes-devtools/gcc/gcc-5.3.inc              |   2 +
 .../gcc-5.3/0054-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch |  43 ++++
 ...trip-off-build-path-in-purported-filename.patch |  62 +++++
 .../python/python-pycairo_1.10.0.bb                |  25 +-
 .../python/python-setuptools_19.4.bb               |   2 -
 meta/recipes-devtools/python/python3-pip_8.0.0.bb  |  12 -
 .../python/python3-setuptools_19.4.bb              |   8 +-
 meta/recipes-devtools/python/python3_3.5.1.bb      |  20 +-
 meta/recipes-devtools/python/python_2.7.11.bb      |  27 +-
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb           |  13 +-
 meta/recipes-devtools/valgrind/valgrind_3.11.0.bb  |   5 +-
 meta/recipes-gnome/epiphany/epiphany_3.18.4.bb     |   8 +-
 .../files/use-relative-path-for-build-dir.patch    |  57 +++++
 meta/recipes-gnome/gnome/gconf/gconf.path          |   6 +
 .../gnome/gconf/use-target-path-for-debug.patch    |  31 +++
 meta/recipes-gnome/gnome/gconf_3.2.6.bb            |  12 +
 meta/recipes-kernel/dtc/dtc.inc                    |   3 +
 .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       |  30 +++
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      |  61 +++++
 meta/recipes-support/icu/icu_56.1.bb               |  12 +
 33 files changed, 1115 insertions(+), 73 deletions(-)
 create mode 100644 meta/classes/fix_buildpaths.bbclass
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
 create mode 100644 meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
 create mode 100644 meta/recipes-gnome/gnome/gconf/gconf.path
 create mode 100644 meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch
 create mode 100644 meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch

-- 
1.9.1



^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 02/18] gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map Hongxu Jia
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
directory name (old) to another (new) in __FILE__, __BASE_FILE__and
__builtin_FILE ().

With this patch, it fixes build path issue which caused by __FILE__.
We do not need to use relative path to compile any more.

[YOCTO #7058]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc              |   1 +
 .../gcc-4.9/0072-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 meta/recipes-devtools/gcc/gcc-5.3.inc              |   1 +
 .../gcc-5.3/0054-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 4 files changed, 570 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 6412490..22783b2 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -87,6 +87,7 @@ SRC_URI = "\
     file://0069-musl-no-fixincludes.patch \
     file://0070-libstdc-musl.patch \
     file://0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
+    file://0072-support-ffile-prefix-map.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
new file mode 100644
index 0000000..9809a6a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From e863be798ed13312a0faf0b961275f211a8123ab Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:32:17 -0400
+Subject: [PATCH] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
+
+Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
+directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
+__builtin_FILE ().
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/c-family/c-opts.c     |  6 ++++
+ gcc/c-family/c.opt        |  4 +++
+ gcc/dwarf2out.c           |  1 +
+ gcc/gimplify.c            |  2 ++
+ libcpp/Makefile.in        | 10 +++---
+ libcpp/file-map.c         | 92 +++++++++++++++++++++++++++++++++++++++++++++++
+ libcpp/include/file-map.h | 30 ++++++++++++++++
+ libcpp/macro.c            |  2 ++
+ 8 files changed, 142 insertions(+), 5 deletions(-)
+ create mode 100644 libcpp/file-map.c
+ create mode 100644 libcpp/include/file-map.h
+
+diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
+index dd5fd23..9c004a1 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "options.h"
+ #include "plugin.h"		/* For PLUGIN_INCLUDE_FILE event.  */
+ #include "mkdeps.h"
++#include "file-map.h"
+ #include "c-target.h"
+ #include "tm.h"			/* For BYTES_BIG_ENDIAN,
+ 				   DOLLARS_IN_IDENTIFIERS,
+@@ -553,6 +554,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
+       cpp_opts->narrow_charset = arg;
+       break;
+ 
++    case OPT_ffile_prefix_map_:
++      if (add_file_prefix_map (arg) < 0)
++        error ("invalid argument %qs to -ffile-prefix-map", arg);
++      break;
++
+     case OPT_fwide_exec_charset_:
+       cpp_opts->wide_charset = arg;
+       break;
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index f295805..3a99662 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -928,6 +928,10 @@ fexec-charset=
+ C ObjC C++ ObjC++ Joined RejectNegative
+ -fexec-charset=<cset>	Convert all strings and character constants to character set <cset>
+ 
++ffile-prefix-map=
++C ObjC C++ ObjC++ Joined RejectNegative
++-ffile-prefix-map=<old=new>	Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
++
+ fextended-identifiers
+ C ObjC C++ ObjC++
+ Permit universal character names (\\u and \\U) in identifiers
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 99bf6e2..3e58cfd 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19199,6 +19199,7 @@ gen_producer_string (void)
+       case OPT_fltrans_output_list_:
+       case OPT_fresolution_:
+       case OPT_fdebug_prefix_map_:
++      case OPT_ffile_prefix_map_:
+ 	/* Ignore these.  */
+ 	continue;
+       default:
+diff --git a/gcc/gimplify.c b/gcc/gimplify.c
+index 89e7334..a7a97c0 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "omp-low.h"
+ #include "gimple-low.h"
+ #include "cilk.h"
++#include "file-map.h"
+ 
+ #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
+@@ -2288,6 +2289,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+       case BUILT_IN_FILE:
+ 	{
+ 	  expanded_location loc = expand_location (EXPR_LOCATION (*expr_p));
++	  loc.file = remap_file_filename (loc.file);
+ 	  *expr_p = build_string_literal (strlen (loc.file) + 1, loc.file);
+ 	  return GS_OK;
+ 	}
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index 5561c97..5017256 100644
+--- a/libcpp/Makefile.in
++++ b/libcpp/Makefile.in
+@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
+ 
+ 
+ libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
+-	expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
+-	mkdeps.o pch.o symtab.o traditional.o
++	expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
++	macro.o mkdeps.o pch.o symtab.o traditional.o
+ 
+ libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
+-	expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
+-	mkdeps.c pch.c symtab.c traditional.c
++	expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
++	macro.c mkdeps.c pch.c symtab.c traditional.c
+ 
+ all: libcpp.a $(USED_CATALOGS)
+ 
+@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
+ 
+ TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
+     include/line-map.h include/symtab.h include/cpp-id-data.h \
+-    include/cpplib.h include/mkdeps.h system.h
++    include/cpplib.h include/mkdeps.h system.h include/file-map.h
+ 
+ TAGS: $(TAGS_SOURCES)
+ 	cd $(srcdir) && etags $(TAGS_SOURCES)
+diff --git a/libcpp/file-map.c b/libcpp/file-map.c
+new file mode 100644
+index 0000000..04e851b
+--- /dev/null
++++ b/libcpp/file-map.c
+@@ -0,0 +1,92 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++   and __builtin_FILE ().
++   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3.  If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them.   Help stamp out software-hoarding!  */
++
++#include "config.h"
++#include "system.h"
++#include "file-map.h"
++
++/* Structure recording the mapping from source file and directory
++   names at compile time to __FILE__ */
++typedef struct file_prefix_map
++{
++  const char *old_prefix;
++  const char *new_prefix;
++  size_t old_len;
++  size_t new_len;
++  struct file_prefix_map *next;
++} file_prefix_map;
++
++/* Linked list of such structures.  */
++static file_prefix_map *file_prefix_maps;
++
++/* Record prefix mapping of __FILE__.  ARG is the argument to
++   -ffile-prefix-map and must be of the form OLD=NEW.  */
++int
++add_file_prefix_map (const char *arg)
++{
++  file_prefix_map *map;
++  const char *p;
++
++  p = strchr (arg, '=');
++  if (!p)
++  {
++      fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
++      return -1;
++  }
++  map = XNEW (file_prefix_map);
++  map->old_prefix = xstrndup (arg, p - arg);
++  map->old_len = p - arg;
++  p++;
++  map->new_prefix = xstrdup (p);
++  map->new_len = strlen (p);
++  map->next = file_prefix_maps;
++  file_prefix_maps = map;
++
++  return 0;
++}
++
++/* Perform user-specified mapping of __FILE__ prefixes.  Return
++   the new name corresponding to filename.  */
++
++const char *
++remap_file_filename (const char *filename)
++{
++  file_prefix_map *map;
++  char *s;
++  const char *name;
++  size_t name_len;
++
++  for (map = file_prefix_maps; map; map = map->next)
++    if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++      break;
++  if (!map)
++    return filename;
++  name = filename + map->old_len;
++  name_len = strlen (name) + 1;
++  s = (char *) alloca (name_len + map->new_len);
++  memcpy (s, map->new_prefix, map->new_len);
++  memcpy (s + map->new_len, name, name_len);
++
++  return xstrdup (s);
++}
++
++
+diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
+new file mode 100644
+index 0000000..e6f8cbf
+--- /dev/null
++++ b/libcpp/include/file-map.h
+@@ -0,0 +1,30 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++   and __builtin_FILE ().
++   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3.  If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them.   Help stamp out software-hoarding!  */
++
++#ifndef LIBCPP_FILE_MAP_H
++#define LIBCPP_FILE_MAP_H
++
++const char * remap_file_filename (const char *filename);
++
++int add_file_prefix_map (const char *arg);
++
++#endif /* !LIBCPP_FILE_MAP_H  */
+diff --git a/libcpp/macro.c b/libcpp/macro.c
+index 11e50f4..5c6f90e 100644
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -26,6 +26,7 @@ along with this program; see the file COPYING3.  If not see
+ #include "system.h"
+ #include "cpplib.h"
+ #include "internal.h"
++#include "file-map.h"
+ 
+ typedef struct macro_arg macro_arg;
+ /* This structure represents the tokens of a macro argument.  These
+@@ -288,6 +289,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
+ 	    if (!name)
+ 	      abort ();
+ 	  }
++	name = remap_file_filename (name);
+ 	len = strlen (name);
+ 	buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ 	result = buf;
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
index 0bf9f55..4861cfc 100644
--- a/meta/recipes-devtools/gcc/gcc-5.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -83,6 +83,7 @@ SRC_URI = "\
            file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
            file://0052-nios2-use-ret-with-r31.patch \
            file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \
+           file://0054-support-ffile-prefix-map.patch \
 "
 
 BACKPORTS = ""
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
new file mode 100644
index 0000000..da16879
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From ef7c2bda6b4c88f8007ed663b1108cd4651598c8 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 02:27:43 -0400
+Subject: [PATCH] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
+
+Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
+directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
+__builtin_FILE ().
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/c-family/c-opts.c     |  6 ++++
+ gcc/c-family/c.opt        |  4 +++
+ gcc/dwarf2out.c           |  1 +
+ gcc/gimplify.c            |  2 ++
+ libcpp/Makefile.in        | 10 +++---
+ libcpp/file-map.c         | 92 +++++++++++++++++++++++++++++++++++++++++++++++
+ libcpp/include/file-map.h | 30 ++++++++++++++++
+ libcpp/macro.c            |  2 ++
+ 8 files changed, 142 insertions(+), 5 deletions(-)
+ create mode 100644 libcpp/file-map.c
+ create mode 100644 libcpp/include/file-map.h
+
+diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
+index 718a052..3f93c56 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "opts.h"
+ #include "plugin.h"		/* For PLUGIN_INCLUDE_FILE event.  */
+ #include "mkdeps.h"
++#include "file-map.h"
+ #include "c-target.h"
+ #include "tm.h"			/* For BYTES_BIG_ENDIAN,
+ 				   DOLLARS_IN_IDENTIFIERS,
+@@ -510,6 +511,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
+       cpp_opts->narrow_charset = arg;
+       break;
+ 
++    case OPT_ffile_prefix_map_:
++      if (add_file_prefix_map (arg) < 0)
++        error ("invalid argument %qs to -ffile-prefix-map", arg);
++      break;
++
+     case OPT_fwide_exec_charset_:
+       cpp_opts->wide_charset = arg;
+       break;
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 453ec8e..30ad053 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1117,6 +1117,10 @@ fexec-charset=
+ C ObjC C++ ObjC++ Joined RejectNegative
+ -fexec-charset=<cset>	Convert all strings and character constants to character set <cset>
+ 
++ffile-prefix-map=
++C ObjC C++ ObjC++ Joined RejectNegative
++-ffile-prefix-map=<old=new>	Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
++
+ fextended-identifiers
+ C ObjC C++ ObjC++
+ Permit universal character names (\\u and \\U) in identifiers
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 526f114..438a475 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19671,6 +19671,7 @@ gen_producer_string (void)
+       case OPT_fltrans_output_list_:
+       case OPT_fresolution_:
+       case OPT_fdebug_prefix_map_:
++      case OPT_ffile_prefix_map_:
+ 	/* Ignore these.  */
+ 	continue;
+       default:
+diff --git a/gcc/gimplify.c b/gcc/gimplify.c
+index c85f83a..1ffe1e1 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "gimple-low.h"
+ #include "cilk.h"
+ #include "gomp-constants.h"
++#include "file-map.h"
+ 
+ #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
+@@ -2370,6 +2371,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+       case BUILT_IN_FILE:
+ 	{
+ 	  const char *locfile = LOCATION_FILE (EXPR_LOCATION (*expr_p));
++	  locfile = remap_file_filename (locfile);
+ 	  *expr_p = build_string_literal (strlen (locfile) + 1, locfile);
+ 	  return GS_OK;
+ 	}
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index ad35563..c210ff9 100644
+--- a/libcpp/Makefile.in
++++ b/libcpp/Makefile.in
+@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
+ 
+ 
+ libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
+-	expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
+-	mkdeps.o pch.o symtab.o traditional.o
++	expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
++	macro.o mkdeps.o pch.o symtab.o traditional.o
+ 
+ libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
+-	expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
+-	mkdeps.c pch.c symtab.c traditional.c
++	expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
++	macro.c mkdeps.c pch.c symtab.c traditional.c
+ 
+ all: libcpp.a $(USED_CATALOGS)
+ 
+@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
+ 
+ TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
+     include/line-map.h include/symtab.h include/cpp-id-data.h \
+-    include/cpplib.h include/mkdeps.h system.h
++    include/cpplib.h include/mkdeps.h system.h include/file-map.h
+ 
+ TAGS: $(TAGS_SOURCES)
+ 	cd $(srcdir) && etags $(TAGS_SOURCES)
+diff --git a/libcpp/file-map.c b/libcpp/file-map.c
+new file mode 100644
+index 0000000..04e851b
+--- /dev/null
++++ b/libcpp/file-map.c
+@@ -0,0 +1,92 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++   and __builtin_FILE ().
++   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3.  If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them.   Help stamp out software-hoarding!  */
++
++#include "config.h"
++#include "system.h"
++#include "file-map.h"
++
++/* Structure recording the mapping from source file and directory
++   names at compile time to __FILE__ */
++typedef struct file_prefix_map
++{
++  const char *old_prefix;
++  const char *new_prefix;
++  size_t old_len;
++  size_t new_len;
++  struct file_prefix_map *next;
++} file_prefix_map;
++
++/* Linked list of such structures.  */
++static file_prefix_map *file_prefix_maps;
++
++/* Record prefix mapping of __FILE__.  ARG is the argument to
++   -ffile-prefix-map and must be of the form OLD=NEW.  */
++int
++add_file_prefix_map (const char *arg)
++{
++  file_prefix_map *map;
++  const char *p;
++
++  p = strchr (arg, '=');
++  if (!p)
++  {
++      fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
++      return -1;
++  }
++  map = XNEW (file_prefix_map);
++  map->old_prefix = xstrndup (arg, p - arg);
++  map->old_len = p - arg;
++  p++;
++  map->new_prefix = xstrdup (p);
++  map->new_len = strlen (p);
++  map->next = file_prefix_maps;
++  file_prefix_maps = map;
++
++  return 0;
++}
++
++/* Perform user-specified mapping of __FILE__ prefixes.  Return
++   the new name corresponding to filename.  */
++
++const char *
++remap_file_filename (const char *filename)
++{
++  file_prefix_map *map;
++  char *s;
++  const char *name;
++  size_t name_len;
++
++  for (map = file_prefix_maps; map; map = map->next)
++    if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++      break;
++  if (!map)
++    return filename;
++  name = filename + map->old_len;
++  name_len = strlen (name) + 1;
++  s = (char *) alloca (name_len + map->new_len);
++  memcpy (s, map->new_prefix, map->new_len);
++  memcpy (s + map->new_len, name, name_len);
++
++  return xstrdup (s);
++}
++
++
+diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
+new file mode 100644
+index 0000000..e6f8cbf
+--- /dev/null
++++ b/libcpp/include/file-map.h
+@@ -0,0 +1,30 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++   and __builtin_FILE ().
++   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3.  If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them.   Help stamp out software-hoarding!  */
++
++#ifndef LIBCPP_FILE_MAP_H
++#define LIBCPP_FILE_MAP_H
++
++const char * remap_file_filename (const char *filename);
++
++int add_file_prefix_map (const char *arg);
++
++#endif /* !LIBCPP_FILE_MAP_H  */
+diff --git a/libcpp/macro.c b/libcpp/macro.c
+index 1e0a0b5..c3d330c 100644
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -26,6 +26,7 @@ along with this program; see the file COPYING3.  If not see
+ #include "system.h"
+ #include "cpplib.h"
+ #include "internal.h"
++#include "file-map.h"
+ 
+ typedef struct macro_arg macro_arg;
+ /* This structure represents the tokens of a macro argument.  These
+@@ -297,6 +298,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
+ 	    if (!name)
+ 	      abort ();
+ 	  }
++	name = remap_file_filename (name);
+ 	len = strlen (name);
+ 	buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ 	result = buf;
+-- 
+1.9.1
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 02/18] gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
  2016-03-18  9:01 ` [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 03/18] kernel.bbclass: fix buildpath QA issue Hongxu Jia
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

The oe-core may use external toolchain for compiling,
which did not support -ffile-prefix-map.

Since we use -fdebug-prefix-map to do the same thing,
so we could reuse it to replace -ffile-prefix-map.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc              |  1 +
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch | 43 ++++++++++++++++++++++
 meta/recipes-devtools/gcc/gcc-5.3.inc              |  1 +
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch | 43 ++++++++++++++++++++++
 4 files changed, 88 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 22783b2..87aa7da 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -88,6 +88,7 @@ SRC_URI = "\
     file://0070-libstdc-musl.patch \
     file://0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
     file://0072-support-ffile-prefix-map.patch \
+    file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 0000000..94e45ed
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 5e10baff84038d26dc3d59b2412ba1db92cb8274 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:34:01 -0400
+Subject: [PATCH 2/2] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
+
+The oe-core may use external toolchain to compile,
+which may not support -ffile-prefix-map.
+
+Since we use -fdebug-prefix-map to do the same thing,
+so we could reuse it to replace -ffile-prefix-map.
+
+Upstream-Status: Inappropriate[oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/opts-global.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gcc/opts-global.c b/gcc/opts-global.c
+index 111884b..037f6c8 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "toplev.h"
+ #include "tree-pass.h"
+ #include "context.h"
++#include "file-map.h"
+ 
+ typedef const char *const_char_p; /* For DEF_VEC_P.  */
+ 
+@@ -354,6 +355,9 @@ handle_common_deferred_options (void)
+ 
+ 	case OPT_fdebug_prefix_map_:
+ 	  add_debug_prefix_map (opt->arg);
++
++	  /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
++	  add_file_prefix_map (opt->arg);
+ 	  break;
+ 
+ 	case OPT_fdump_:
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
index 4861cfc..aa011fd 100644
--- a/meta/recipes-devtools/gcc/gcc-5.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -84,6 +84,7 @@ SRC_URI = "\
            file://0052-nios2-use-ret-with-r31.patch \
            file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \
            file://0054-support-ffile-prefix-map.patch \
+           file://0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
 "
 
 BACKPORTS = ""
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 0000000..c7caed8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 14b79641ff6b0008aef7fbf7aa300daec11d1e78 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 05:39:59 -0400
+Subject: [PATCH] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
+
+The oe-core may use external toolchain to compile,
+which may not support -ffile-prefix-map.
+
+Since we use -fdebug-prefix-map to do the same thing,
+so we could reuse it to replace -ffile-prefix-map.
+
+Upstream-Status: Inappropriate[oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/opts-global.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gcc/opts-global.c b/gcc/opts-global.c
+index b61bdcf..51bb177 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "rtl.h"
+ #include "dbgcnt.h"
+ #include "debug.h"
++#include "file-map.h"
+ #include "hash-map.h"
+ #include "plugin-api.h"
+ #include "ipa-ref.h"
+@@ -378,6 +379,9 @@ handle_common_deferred_options (void)
+ 
+ 	case OPT_fdebug_prefix_map_:
+ 	  add_debug_prefix_map (opt->arg);
++
++	  /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
++	  add_file_prefix_map (opt->arg);
+ 	  break;
+ 
+ 	case OPT_fdump_:
+-- 
+1.9.1
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 03/18] kernel.bbclass: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
  2016-03-18  9:01 ` [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ Hongxu Jia
  2016-03-18  9:01 ` [PATCH 02/18] gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 04/18] valgrind: " Hongxu Jia
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Since CFLAGS CPPFLAGS CXXFLAGS has been unset, variable DEBUG_FLAGS could
not been passed to compiler, so we explicitly add DEBUG_FLAGS to CC to
replace build path with target path.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/kernel.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index c3eab50..d357ccf 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -207,7 +207,7 @@ kernel_do_compile() {
 		copy_initramfs
 		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
 	fi
-	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
+	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC} ${DEBUG_FLAGS}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
@@ -216,7 +216,7 @@ kernel_do_compile() {
 do_compile_kernelmodules() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
-		oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
+		oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC} ${DEBUG_FLAGS}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
 
 		# Module.symvers gets updated during the 
 		# building of the kernel modules. We need to
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 04/18] valgrind: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (2 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 03/18] kernel.bbclass: fix buildpath QA issue Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 05/18] dtc.inc: fix buildpaths " Hongxu Jia
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Pass DEBUG_FLAGS to SELECTED_OPTIMIZATION which fixes build
path issue in DWARF.

[YOCTO #8457]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/valgrind/valgrind_3.11.0.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
index e8a2357..51c88bf 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
@@ -49,8 +49,9 @@ EXTRA_OEMAKE = "-w"
 
 # valgrind likes to control its own optimisation flags. It generally defaults
 # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
-# (via CFLAGS) means we interfere with that.
-SELECTED_OPTIMIZATION = ""
+# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
+# which fixes build path issue in DWARF.
+SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
 
 CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 05/18] dtc.inc: fix buildpaths QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (3 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 04/18] valgrind: " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18 12:01   ` Jussi Kukkonen
  2016-03-18  9:01 ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Previous Makefile define its own CFLAGS, pass DEBUG_FLAGS to
it could fix build path issue in DWARF.

[YOCTO #8457]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-kernel/dtc/dtc.inc                    |  3 +++
 .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       | 30 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch

diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
index 0c409b0..a1a30fc 100644
--- a/meta/recipes-kernel/dtc/dtc.inc
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -7,8 +7,11 @@ DEPENDS = "flex-native bison-native"
 SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
            file://make_install.patch \
 	  "
+SRC_URI_append_class-target = " file://pass-DEBUG_FLAGS-to-CFLAGS.patch \
+"
 
 EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
+EXTRA_OEMAKE_class-target += 'DEBUG_FLAGS="${DEBUG_FLAGS}"'
 
 S = "${WORKDIR}/git"
 
diff --git a/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch b/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
new file mode 100644
index 0000000..3f17ee9
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
@@ -0,0 +1,30 @@
+From 4019e29b0c1ec441fa43d9969197c24ad73f3b1a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 26 Feb 2016 03:28:15 -0500
+Subject: [PATCH] Makefile: pass DEBUG_FLAGS to CFLAGS
+
+It fixes buildpaths issue while compiling.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 18838cc..4954f32 100644
+--- a/Makefile
++++ b/Makefile
+@@ -18,7 +18,7 @@ CONFIG_LOCALVERSION =
+ CPPFLAGS = -I libfdt -I .
+ WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
+ 	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
+-CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
++CFLAGS = $(DEBUG_FLAGS) -Os -fPIC -Werror $(WARNINGS)
+ 
+ BISON = bison
+ LEX = flex
+-- 
+1.9.1
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (4 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 05/18] dtc.inc: fix buildpaths " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Define variable PACKAGE_BUILDPATH_TEXT_FILES to list files that have
build paths and remove these paths at do_package time.

Define variable PACKAGE_BUILDPATH_TEXT_PATTERNS to list build path
patterns, which used by sed, it removes --sysroot and
-fdebug-prefix-map in text files by default.

Define python function to remove build path in variable.

Define python function to remove build path in python compiled
code.

[YOCTO #9169]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/fix_buildpaths.bbclass | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 meta/classes/fix_buildpaths.bbclass

diff --git a/meta/classes/fix_buildpaths.bbclass b/meta/classes/fix_buildpaths.bbclass
new file mode 100644
index 0000000..49dbf11
--- /dev/null
+++ b/meta/classes/fix_buildpaths.bbclass
@@ -0,0 +1,44 @@
+PACKAGE_PREPROCESS_FUNCS += "${@base_conditional('PACKAGE_BUILDPATH_TEXT_FILES','', '', 'remove_buildpath_package_preprocess', d)}"
+remove_buildpath_package_preprocess () {
+	# Remove build paths in text files
+	for file in ${PACKAGE_BUILDPATH_TEXT_FILES};do
+		sed -i ${PACKAGE_BUILDPATH_TEXT_PATTERNS} ${PKGD}$file
+	done
+}
+
+# List build path patterns, which used by sed, it removes
+# --sysroot and -fdebug-prefix-map by default.
+PACKAGE_BUILDPATH_TEXT_PATTERNS = " \
+    -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:-fdebug-prefix-map=${B}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${S}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_NATIVE}=::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_HOST}=::g' \
+"
+
+# List files which have build paths, and remove these paths.
+PACKAGE_BUILDPATH_TEXT_FILES ??= ""
+
+# Remove build path in variable
+def remove_buildpath_variable(d, var):
+    val = d.getVar(var, True) or ''
+
+    toolchain_opts = d.getVar('TOOLCHAIN_OPTIONS', True)
+    val = val.replace(toolchain_opts, '')
+
+    debug_flags = d.getVar('DEBUG_FLAGS', True).split()
+    for opt in debug_flags:
+        if '-fdebug-prefix-map=' in opt:
+            val = val.replace(opt, '')
+
+    return val
+
+# Remove build path in python compiled code which
+# located in root_path
+def remove_buildpath_bytecode(root_path, byte_code):
+    import py_compile
+
+    file = root_path + byte_code[0:-1]
+    dfile = byte_code[0:-1]
+    py_compile.compile(file, dfile=dfile)
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 07/18] icu: fix buildpaths QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (5 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 08/18] tcl: fix buildpath " Hongxu Jia
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

- Define new variable U_CC and U_CXX which do not have build path.
  The output of icuinfo will not have build path in it:
  ...
  root@qemux86-64:~# icuinfo
   <icuSystemParams type="icu4c">
      [snip]
      <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      [snip]
   </icuSystemParams>
  ...

- Remove build paths in pkgdata.inc, Makefile.inc and
  icu-config.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      | 61 ++++++++++++++++++++++
 meta/recipes-support/icu/icu_56.1.bb               | 12 +++++
 2 files changed, 73 insertions(+)
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch

diff --git a/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch b/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
new file mode 100644
index 0000000..826d934
--- /dev/null
+++ b/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
@@ -0,0 +1,61 @@
+From 3221b108a18edeff5424bc5c66589eb20148d9b2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 2 Mar 2016 21:18:34 -0500
+Subject: [PATCH] add variable U_CC and U_CXX
+
+Define new variable U_CC and U_CXX which do not have build path.
+The output of icuinfo will not have build path in it:
+...
+root@qemux86-64:~# icuinfo
+ <icuSystemParams type="icu4c">
+    [snip]
+    <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    [snip]
+ </icuSystemParams>
+...
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac               | 9 +++++++++
+ tools/toolutil/Makefile.in | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 595bd12..ec05c19 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -673,6 +673,15 @@ AC_SUBST(GENCCODE_ASSEMBLY)
+ 
+ AC_MSG_RESULT($GENCCODE_ASSEMBLY)
+ 
++# U_CC and U_CXX are used for icuinfo which remove
++# --sysroot for cross-compilation
++U_CC=${U_CC}
++AC_SUBST(U_CC)
++AC_MSG_RESULT(U_CC)
++U_CXX=${U_CXX}
++AC_SUBST(U_CXX)
++AC_MSG_RESULT(U_CXX)
++
+ # Checks for header files
+ AC_CHECK_HEADERS(inttypes.h)
+ if test $ac_cv_header_inttypes_h = no; then
+diff --git a/tools/toolutil/Makefile.in b/tools/toolutil/Makefile.in
+index 1fb42ed..a083522 100644
+--- a/tools/toolutil/Makefile.in
++++ b/tools/toolutil/Makefile.in
+@@ -46,7 +46,7 @@ CXXFLAGS += $(LIBCXXFLAGS)
+ CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
+ 
+ # from icuinfo
+-CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
++CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@U_CC@\"" "-DU_CXX=\"@U_CXX@\""
+ CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
+ 
+ DEFS += -DU_TOOLUTIL_IMPLEMENTATION
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/icu/icu_56.1.bb b/meta/recipes-support/icu/icu_56.1.bb
index db0de10..7375170 100644
--- a/meta/recipes-support/icu/icu_56.1.bb
+++ b/meta/recipes-support/icu/icu_56.1.bb
@@ -17,6 +17,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://icu-pkgdata-large-cmd.patch \
            file://fix-install-manx.patch \
            file://icu-release-56-1-flagparser-fix.patch \
+           file://add-variable-U_CC-and-U_CXX.patch \
           "
 
 SRC_URI_append_class-target = "\
@@ -27,3 +28,14 @@ SRC_URI[sha256sum] = "3a64e9105c734dcf631c0b3ed60404531bce6c0f5a64bfe1a6402a4cc2
 
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
 UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
+
+inherit fix_buildpaths
+CACHED_CONFIGUREVARS += "U_CC="${@remove_buildpath_variable(d, 'CC')}" \
+                         U_CXX="${@remove_buildpath_variable(d, 'CXX')}" \
+"
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/${BPN}/${PV}/pkgdata.inc \
+    ${libdir}/${BPN}/${PV}/Makefile.inc \
+    ${bindir}/icu-config \
+"
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 08/18] tcl: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (6 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 09/18] python2/3: " Hongxu Jia
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

- Tweak DEBUG_FLAGS, since ${S} is not normal format

- Remove build path in tclConfig.sh

- Tweak sed expression at tclConfig.sh to strict the pattern

[YOCTO #8457]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/tcltk/tcl_8.6.4.bb b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
index 8e92b3e..f32419e 100644
--- a/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
+++ b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
@@ -30,6 +30,7 @@ SRC_URI[sha256sum] = "9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416
 SRC_URI_class-native = "${BASE_SRC_URI}"
 
 S = "${WORKDIR}/${BPN}${PV}/unix"
+DEBUG_FLAGS += "-fdebug-prefix-map=${WORKDIR}/${BPN}${PV}=/usr/src/${BPN}"
 
 VER = "${PV}"
 
@@ -54,8 +55,8 @@ do_install() {
 	autotools_do_install install-private-headers
 	ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
 	ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
-	sed -i "s+-L${B}+-L${STAGING_LIBDIR}+g" tclConfig.sh
-	sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tclConfig.sh
+	sed -i "s,-L${B},-L${STAGING_LIBDIR},g" tclConfig.sh
+	sed -i "s,='${WORKDIR},='${STAGING_INCDIR},g" tclConfig.sh
 	sed -i "s,-L${libdir},-L=${libdir},g" tclConfig.sh
 	sed -i "s,-I${includedir},-I=${includedir},g" tclConfig.sh
 	install -d ${D}${bindir_crossscripts}
@@ -73,6 +74,14 @@ tcl_sysroot_preprocess () {
 	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
 }
 
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= "${bindir_crossscripts}/tclConfig.sh \
+                                 ${libdir}/tclConfig.sh \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:-fdebug-prefix-map=${WORKDIR}/${BPN}${PV}=/usr/src/${BPN}::g'\
+"
+
 PACKAGES =+ "tcl-lib"
 FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
 FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 09/18] python2/3: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (7 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 08/18] tcl: fix buildpath " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 10/18] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

- Remove build paths in target file

- Since _sysconfigdata.py was modified at do_package,
  so update _sysconfigdata.pyc manually (Python2 only).

[YOCTO #8446]
[YOCTO #9169]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/python/python3_3.5.1.bb | 20 ++++++++++++++++----
 meta/recipes-devtools/python/python_2.7.11.bb | 27 ++++++++++++++++++++++-----
 2 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-devtools/python/python3_3.5.1.bb b/meta/recipes-devtools/python/python3_3.5.1.bb
index 2fbb3cb..bfcea85 100644
--- a/meta/recipes-devtools/python/python3_3.5.1.bb
+++ b/meta/recipes-devtools/python/python3_3.5.1.bb
@@ -186,12 +186,24 @@ PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
 }
 
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+    ${bindir}/python${PYTHON_BINABI}-config \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
+
 require python-${PYTHON_MAJMIN}-manifest.inc
 
 # manual dependency additions
diff --git a/meta/recipes-devtools/python/python_2.7.11.bb b/meta/recipes-devtools/python/python_2.7.11.bb
index 0c00d6e..1019e29 100644
--- a/meta/recipes-devtools/python/python_2.7.11.bb
+++ b/meta/recipes-devtools/python/python_2.7.11.bb
@@ -128,15 +128,32 @@ do_install_append_class-nativesdk () {
 
 SSTATE_SCAN_FILES += "Makefile"
 PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
-
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+}
+
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+    ${PTEST_PATH}/Makefile \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
 
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+PACKAGE_PREPROCESS_FUNCS += "update_pyc_package_preprocess"
+python update_pyc_package_preprocess () {
+    # Update _sysconfigdata.pyc
+    root_path = d.expand("${PKGD}")
+    byte_code = d.expand("${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.pyc")
+    remove_buildpath_bytecode(root_path, byte_code)
 }
 
 require python-${PYTHON_MAJMIN}-manifest.inc
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 10/18] bbclass distutils/distutils3: fix .pyc/.pyo buildpath
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (8 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 09/18] python2/3: " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 11/18] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Get the "--root" directory supplied to the "install" command,
and use it as a prefix to strip off the purported filename
encoded in bytecode files.

Since --root added, we need to tweak --install-data,
--prefix and --install-lib to use relative path.

[YOCTO #8446]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/distutils.bbclass  | 6 +++---
 meta/classes/distutils3.bbclass | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index cd06713..f054006 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -4,8 +4,8 @@ DISTUTILS_BUILD_ARGS ?= ""
 DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
-    --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --install-data=${datadir}"
 
 distutils_do_compile() {
          STAGING_INCDIR=${STAGING_INCDIR} \
@@ -38,7 +38,7 @@ distutils_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
index 443bf3a..7962d40 100644
--- a/meta/classes/distutils3.bbclass
+++ b/meta/classes/distutils3.bbclass
@@ -5,8 +5,8 @@ DISTUTILS_BUILD_EXT_ARGS ?= ""
 DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
-    --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --install-data=${datadir}"
 
 distutils3_do_compile() {
         if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
@@ -63,7 +63,7 @@ distutils3_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 11/18] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (9 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 10/18] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 12/18] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Since fix .pyc/.pyo buildpaths issue, we have the same
DISTUTILS_INSTALL_ARGS in these bbclass files, so clean
up the duplicate.

[YOCTO #8446]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/distutils.bbclass   | 4 +++-
 meta/classes/distutils3.bbclass  | 4 +++-
 meta/classes/setuptools.bbclass  | 5 -----
 meta/classes/setuptools3.bbclass | 5 -----
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index f054006..18cfb17 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -5,6 +5,8 @@ DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
 DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --root=${D} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
     --install-data=${datadir}"
 
 distutils_do_compile() {
@@ -38,7 +40,7 @@ distutils_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
index 7962d40..1e2924a 100644
--- a/meta/classes/distutils3.bbclass
+++ b/meta/classes/distutils3.bbclass
@@ -6,6 +6,8 @@ DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
 DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --root=${D} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
     --install-data=${datadir}"
 
 distutils3_do_compile() {
@@ -63,7 +65,7 @@ distutils3_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
diff --git a/meta/classes/setuptools.bbclass b/meta/classes/setuptools.bbclass
index 56343b1..0a3f0f9 100644
--- a/meta/classes/setuptools.bbclass
+++ b/meta/classes/setuptools.bbclass
@@ -1,8 +1,3 @@
 inherit distutils
 
 DEPENDS += "python-distribute-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
-    --prefix=${prefix} \
-    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
-    --install-data=${datadir}"
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass
index de6dd94..38e175a 100644
--- a/meta/classes/setuptools3.bbclass
+++ b/meta/classes/setuptools3.bbclass
@@ -1,8 +1,3 @@
 inherit distutils3
 
 DEPENDS += "python3-setuptools-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
-    --prefix=${prefix} \
-    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
-    --install-data=${datadir}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 12/18] python-setuptools/python3-setuptools: use old-style install
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (10 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 11/18] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 13/18] python3-pip: " Hongxu Jia
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Since '--root' is added to 'setup.py install' to fix .pyc/.pyo
buildpaths issue. For python setuptools, the '--root' option
means explicit request for old-style install. There will be
no egg generated. And it do not need setuptools.pth any more.

Rename easy_install to easy_install3.

Ubuntu or Debian did the same thing like us:
https://packages.debian.org/sid/all/python3-setuptools/filelist

[YOCTO #8446]
[YOCTO #9162]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/python/python-setuptools_19.4.bb  | 2 --
 meta/recipes-devtools/python/python3-setuptools_19.4.bb | 8 ++------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-devtools/python/python-setuptools_19.4.bb b/meta/recipes-devtools/python/python-setuptools_19.4.bb
index c172039..01763d4 100644
--- a/meta/recipes-devtools/python/python-setuptools_19.4.bb
+++ b/meta/recipes-devtools/python/python-setuptools_19.4.bb
@@ -7,8 +7,6 @@ DEPENDS_class-native += "python-native"
 
 inherit distutils
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
 RDEPENDS_${PN} = "\
   python-stringold \
   python-email \
diff --git a/meta/recipes-devtools/python/python3-setuptools_19.4.bb b/meta/recipes-devtools/python/python3-setuptools_19.4.bb
index fb2931c..12b0d93 100644
--- a/meta/recipes-devtools/python/python3-setuptools_19.4.bb
+++ b/meta/recipes-devtools/python/python3-setuptools_19.4.bb
@@ -5,13 +5,9 @@ DEPENDS_class-native += "python3-native"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
-# The installer puts the wrong path in the setuptools.pth file.  Correct it.
+# Rename easy_install to avoid confliction with python2's setuptools
 do_install_append() {
-    rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
-    mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
-    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+    mv ${D}${bindir}/easy_install ${D}${bindir}/easy_install3
 }
 
 RDEPENDS_${PN} = "\
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 13/18] python3-pip: use old-style install
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (11 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 12/18] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 14/18] waf.bbclass: support do patch on extracted files Hongxu Jia
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Since '--root' is added to 'setup.py install' to fix .pyc/.pyo
buildpaths issue. For python3-pip, the '--root' option
means there will be no eggs generated.

Ubuntu or Debian did the same thing like us:
https://packages.debian.org/sid/all/python3-pip/filelist

[YOCTO #8446]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/python/python3-pip_8.0.0.bb | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/meta/recipes-devtools/python/python3-pip_8.0.0.bb b/meta/recipes-devtools/python/python3-pip_8.0.0.bb
index 834ecda..b45aeea 100644
--- a/meta/recipes-devtools/python/python3-pip_8.0.0.bb
+++ b/meta/recipes-devtools/python/python3-pip_8.0.0.bb
@@ -19,22 +19,10 @@ S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
-do_install_prepend() {
-    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
-}
-
 # Use setuptools site.py instead, avoid shared state issue
 do_install_append() {
-    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/site.py
-    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/__pycache__/site.cpython-*.pyc
-
     # Install as pip3 and leave pip2 as default
     rm ${D}/${bindir}/pip
-
-    # Installed eggs need to be passed directly to the interpreter via a pth file
-    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
 }
 
 RDEPENDS_${PN} = "\
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 14/18] waf.bbclass: support do patch on extracted files
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (12 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 13/18] python3-pip: " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 15/18] python-pycairo: fix buildpath QA issue Hongxu Jia
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

Along with do_unpack, run './waf --help' to do the self extract,
so we could do patch on the extracted files later.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/waf.bbclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index 5e55833..a36bdd4 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -23,8 +23,17 @@ def get_waf_parallel_make(d):
 
     return ""
 
+do_unpack[postfuncs] += "unpack_waf"
+do_unpack[vardeps] += "unpack_waf"
+unpack_waf() {
+	# Just self extract tarball embedded in waf, do not care help message.
+	# Do not generate bytecode, becuase we may need to patch python file
+        # later
+	PYTHONDONTWRITEBYTECODE=True ./waf --help >/dev/null
+}
+
 waf_do_configure() {
-	${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
+	${CACHED_CONFIGUREVARS} ${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
 }
 
 waf_do_compile()  {
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 15/18] python-pycairo: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (13 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 14/18] waf.bbclass: support do patch on extracted files Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 16/18] openssl: " Hongxu Jia
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

- Inherit waf.bbclass, remove duplicate tasks

- Get "--destdir" directory supplied to the "install" command,
  and use it as a prefix to strip off the purported filename
  encoded in bytecode files.

- Do not need to generate pycairo.pc manually

[YOCTO #8446]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...trip-off-build-path-in-purported-filename.patch | 62 ++++++++++++++++++++++
 .../python/python-pycairo_1.10.0.bb                | 25 +++------
 2 files changed, 68 insertions(+), 19 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch

diff --git a/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch b/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
new file mode 100644
index 0000000..647c4be
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
@@ -0,0 +1,62 @@
+From 86faf604fc8a7f17320db48734cda464119da387 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 25 Feb 2016 04:22:07 -0500
+Subject: [PATCH] strip off build path in purported filename
+
+Get the "--destdir" directory supplied to the "install" command,
+and use it as a prefix to strip off the purported filename
+encoded in bytecode files.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+diff --git a/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py b/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
+--- a/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
++++ b/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
+@@ -26,7 +26,7 @@ int main()
+ INST='''
+ import sys, py_compile
+ for pyfile in sys.argv[1:]:
+-	py_compile.compile(pyfile, pyfile + %r)
++	py_compile.compile(pyfile, pyfile + %r, %r)
+ '''
+ def process_py(self,node):
+ 	try:
+@@ -39,6 +39,16 @@ def process_py(self,node):
+ 	def inst_py(ctx):
+ 		install_pyfile(self,node)
+ 	self.bld.add_post_fun(inst_py)
++
++def get_dfile(dfile):
++	if getattr(Options.options,'destdir'):
++		destdir = Options.options.destdir
++		if dfile[:len(destdir)] != destdir:
++			raise Errors.WafError("invalid destdir: filename %r doesn't start with %r" % ((dfile, destdir)))
++		dfile = dfile[len(destdir):]
++
++	return dfile
++
+ def install_pyfile(self,node):
+ 	tsk=self.bld.install_files(self.install_path,[node],postpone=False)
+ 	path=os.path.join(tsk.get_install_path(),node.name)
+@@ -53,12 +63,14 @@ def install_pyfile(self,node):
+ 		if self.env['PYC']or self.env['PYO']:
+ 			info("+ byte compiling %r"%path)
+ 		if self.env['PYC']:
+-			argv=self.env['PYTHON']+['-c',INST%'c',path]
++			dfile = get_dfile(path+'c')
++			argv=self.env['PYTHON']+['-c',INST%('c',dfile),path]
+ 			ret=Utils.subprocess.Popen(argv).wait()
+ 			if ret:
+ 				raise Errors.WafError('pyc compilation failed %r'%path)
+ 		if self.env['PYO']:
+-			argv=self.env['PYTHON']+[self.env['PYFLAGS_OPT'],'-c',INST%'o',path]
++			dfile = get_dfile(path+'o')
++			argv=self.env['PYTHON']+[self.env['PYFLAGS_OPT'],'-c',INST%('o',dfile),path]
+ 			ret=Utils.subprocess.Popen(argv).wait()
+ 			if ret:
+ 				raise Errors.WafError('pyo compilation failed %r'%path)
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
index 70fe25c..2fbd033 100644
--- a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
+++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -11,31 +11,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
 DEPENDS = "cairo"
 PR = "r2"
 
-SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
+SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2 \
+           file://strip-off-build-path-in-purported-filename.patch \
+"
 
 SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
 SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
 
 S = "${WORKDIR}/py2cairo-${PV}"
 
-inherit distutils pkgconfig
+inherit distutils pkgconfig waf
 
 BBCLASSEXTEND = "native"
 
-do_configure() {
-	BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
-}
-
-do_compile() {
-	./waf build ${PARALLEL_MAKE}
-}
-
-do_install() {
-	./waf install
-	sed \
-		-e 's:@prefix@:${prefix}:' \
-		-e 's:@VERSION@:${PV}:' \
-		-e 's:@includedir@:${includedir}:' \
-		pycairo.pc.in > pycairo.pc
-	install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
-}
+CACHED_CONFIGUREVARS = "BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS}"
+EXTRA_OECONF += "--libdir=${libdir}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 16/18] openssl: fix buildpath QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (14 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 15/18] python-pycairo: fix buildpath QA issue Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18  9:01 ` [PATCH 17/18] gconf: fix buildpaths " Hongxu Jia
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

- The openssl records $CC and $CFLAGS in source code which
  caused buildpaths QA issue:
  In crypto/cversion.c
  ...
      if (t == SSLEAY_CFLAGS) {
          return (CFLAGS);
          return ("compiler: information not available");
      }
  ...
  We should remove build path in the above source code.

- Remove build paths in ${PTEST_PATH}/Makefile  and
  ${PTEST_PATH}/Configure

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../openssl/remove-build-path-in-source-code.patch | 44 ++++++++++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |  7 ++++
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch

diff --git a/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch b/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
new file mode 100644
index 0000000..fd5531b
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
@@ -0,0 +1,44 @@
+From b937d7581a1793cdebbf5829bdaea787ed4128db Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 7 Mar 2016 01:11:42 -0500
+Subject: [PATCH] crypto/Makefile: remove build path in source code
+
+Openssl records $CC and $CFLAGS in source code which
+caused buildpaths QA issue:
+In crypto/cversion.c
+...
+    if (t == SSLEAY_CFLAGS) {
+        return (CFLAGS);
+        return ("compiler: information not available");
+    }
+...
+
+We should remove build path in the above source code.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ crypto/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/crypto/Makefile b/crypto/Makefile
+index 17a87f8..ee630e8 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -54,8 +54,11 @@ top:
+ 
+ all: shared
+ 
++NO_BUILDPATH_CCFLAGS=`echo "$(CC) $(CFLAGS)" | \
++         sed -e 's:--sysroot=[^ ]*::g' \
++             -e 's:-fdebug-prefix-map=[^ ]*::g'`
+ buildinf.h: ../Makefile
+-	$(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
++	$(PERL) $(TOP)/util/mkbuildinf.pl "$(NO_BUILDPATH_CCFLAGS)" "$(PLATFORM)" >buildinf.h
+ 
+ x86cpuid.s:	x86cpuid.pl perlasm/x86asm.pl
+ 	$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
index 290f129..7b27b47 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
@@ -39,6 +39,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
             file://ptest_makefile_deps.patch  \
             file://configure-musl-target.patch \
             file://parallel.patch \
+            file://remove-build-path-in-source-code.patch \
            "
 
 SRC_URI[md5sum] = "f3c710c045cdee5fd114feb69feba7aa"
@@ -47,6 +48,12 @@ SRC_URI[sha256sum] = "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e895
 PACKAGES =+ "${PN}-engines"
 FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
 
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+        ${PTEST_PATH}/Makefile \
+        ${PTEST_PATH}/Configure \
+"
+
 # The crypto_use_bigint patch means that perl's bignum module needs to be
 # installed, but some distributions (for example Fedora 23) don't ship it by
 # default.  As the resulting error is very misleading check for bignum before
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 17/18] gconf: fix buildpaths QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (15 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 16/18] openssl: " Hongxu Jia
@ 2016-03-18  9:01 ` Hongxu Jia
  2016-03-18 16:28   ` Burton, Ross
  2016-03-18  9:02 ` [PATCH 18/18] epiphany: " Hongxu Jia
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
  18 siblings, 1 reply; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:01 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

In ${S}/gconf/gconfd.c, we have:
...
  /* -- Debug only */

  if (addresses == NULL)
    {
      gconf_log(GCL_DEBUG, _("gconfd compiled with debugging; trying to load gconf.path from the source directory"));
      conffile = g_strconcat(GCONF_SRCDIR, "/gconf/gconf.path", NULL);
      addresses = gconf_load_source_path(conffile, NULL);
      g_free(conffile);
    }

  /* -- End of Debug Only */
...

- While --enable-debug=yes, the above works, but the released tarball
  did not have gconf.path, so get a copy from git://git.gnome.org/gconf

- Use target path rather than build path to configure above variable
  GCONF_SRCDIR, by setting absolute_top_srcdir in configure.ac.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-gnome/gnome/gconf/gconf.path          |  6 +++++
 .../gnome/gconf/use-target-path-for-debug.patch    | 31 ++++++++++++++++++++++
 meta/recipes-gnome/gnome/gconf_3.2.6.bb            | 12 +++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-gnome/gnome/gconf/gconf.path
 create mode 100644 meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch

diff --git a/meta/recipes-gnome/gnome/gconf/gconf.path b/meta/recipes-gnome/gnome/gconf/gconf.path
new file mode 100644
index 0000000..573ec68
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf/gconf.path
@@ -0,0 +1,6 @@
+# This file stores the addresses of config sources for GConf
+# When a value is stored or requested, the sources are scanned from top to
+# bottom, and the first one to have a value for the key (or the first one
+# to be writeable) is used to load/store the data.
+# You can also use include statements
+xml:readwrite:$(DEFAULTUSERSOURCE)
diff --git a/meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch b/meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch
new file mode 100644
index 0000000..0698831
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch
@@ -0,0 +1,31 @@
+From 7d03ad64b6a8fd2897b07a92c66a15e871f2efe9 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 2 Mar 2016 03:19:50 -0500
+Subject: [PATCH] use target path for debugging
+
+The variable absolute_top_srcdir is used for
+debugging purposes, use target path rather
+than build path for cross complication.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 69a57e6..1b0739f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -365,7 +365,7 @@ AC_SUBST(CPPFLAGS)
+ AC_SUBST(LDFLAGS)
+ 
+ ## Just for debugging purposes
+-absolute_top_srcdir=`pwd`
++absolute_top_srcdir="/usr/src/${S##*/}"
+ AC_SUBST(absolute_top_srcdir)
+ 
+ AC_CONFIG_FILES([
+-- 
+1.9.1
+
diff --git a/meta/recipes-gnome/gnome/gconf_3.2.6.bb b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
index feaf080..d5dc0b7 100644
--- a/meta/recipes-gnome/gnome/gconf_3.2.6.bb
+++ b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -10,6 +10,8 @@ inherit gnomebase gtk-doc gettext gobject-introspection
 SRC_URI = "${GNOME_MIRROR}/GConf/${@gnome_verdir("${PV}")}/GConf-${PV}.tar.xz;name=archive \
            file://remove_plus_from_invalid_characters_list.patch \
            file://unable-connect-dbus.patch \
+           file://use-target-path-for-debug.patch \
+           file://gconf.path \
 "
 
 SRC_URI[archive.md5sum] = "2b16996d0e4b112856ee5c59130e822c"
@@ -17,6 +19,7 @@ SRC_URI[archive.sha256sum] = "1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e
 
 S = "${WORKDIR}/GConf-${PV}"
 
+CACHED_CONFIGUREVARS += "S=${S}"
 EXTRA_OECONF = "--enable-shared --disable-static --enable-debug=yes \
                 --disable-orbit --with-openldap=no --disable-gtk"
 
@@ -28,6 +31,15 @@ PACKAGECONFIG_libc-uclibc = ""
 
 PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
 
+do_unpack[postfuncs] += "unpack_gconf_debug"
+do_unpack[vardeps] += "unpack_gconf_debug"
+unpack_gconf_debug() {
+	# A copy from git://git.gnome.org/gconf for debug
+	if [ ! -e ${S}/gconf/gconf.path ]; then
+		install -m 0664 ${WORKDIR}/gconf.path ${S}/gconf/
+	fi
+}
+
 do_install_append() {
 	# this directory need to be created to avoid an Error 256 at gdm launch
 	install -d ${D}${sysconfdir}/gconf/gconf.xml.system
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 18/18] epiphany: fix buildpaths QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (16 preceding siblings ...)
  2016-03-18  9:01 ` [PATCH 17/18] gconf: fix buildpaths " Hongxu Jia
@ 2016-03-18  9:02 ` Hongxu Jia
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
  18 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18  9:02 UTC (permalink / raw)
  To: ross.burton, richard.purdie, raj.khem; +Cc: openembedded-core

In order to fix build path issue, we reverts the following commit
in https://github.com/GNOME/epiphany.git
...
commit 54a3122d8626f78338033a704d5849738f6dd2e6
Author: Xan Lopez <xan@igalia.com>
Date:   Wed May 16 18:21:21 2012 +0900

    ephy-profile-utils: use absolute path for build dir

    That way we can run the tests from any directory in debug mode.
...
It did not consider cross-compile situation which we do not need
to run tests in host build.

BTW, the tests suits were compiled but not installed to ${D},
so we explicitly disable it.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-gnome/epiphany/epiphany_3.18.4.bb     |  8 ++-
 .../files/use-relative-path-for-build-dir.patch    | 57 ++++++++++++++++++++++
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch

diff --git a/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb b/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb
index 12d3b07..0b8335b 100644
--- a/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb
+++ b/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb
@@ -9,11 +9,15 @@ inherit gnomebase gsettings distro_features_check upstream-version-is-even
 # libwnck3 is x11 only
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch \
+            file://use-relative-path-for-build-dir.patch \
+"
 SRC_URI[archive.md5sum] = "172b78256100e8d3c629764abd0e1495"
 SRC_URI[archive.sha256sum] = "be699d484371111abae754e669187215df73e21533f461e513b79537d7a1c1c1"
 
-EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO}"
+EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO} \
+                  --disable-tests \
+"
 
 do_configure_prepend() {
     touch ${S}/gnome-doc-utils.make
diff --git a/meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch b/meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
new file mode 100644
index 0000000..21c0912
--- /dev/null
+++ b/meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
@@ -0,0 +1,57 @@
+From 73e46aeea35c7bda7833e635f1bb2dbd39e2b43e Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 2 Mar 2016 02:00:23 -0500
+Subject: [PATCH] ephy-profile-utils: use relative path for build dir
+
+It reverts the following commit in https://github.com/GNOME/epiphany.git
+...
+commit 54a3122d8626f78338033a704d5849738f6dd2e6
+Author: Xan Lopez <xan@igalia.com>
+Date:   Wed May 16 18:21:21 2012 +0900
+
+    ephy-profile-utils: use absolute path for build dir
+
+    That way we can run the tests from any directory in debug mode.
+...
+It did not consider cross-compile situation which we do not need
+to run tests in host build.
+
+It also caused build path issue.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ lib/Makefile.am          | 2 +-
+ lib/ephy-profile-utils.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 24d684b..849a07f 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -88,7 +88,7 @@ libephymisc_la_CPPFLAGS = \
+ 	-DDATADIR="\"$(datadir)\""		    \
+ 	-DSHARE_DIR=\"$(pkgdatadir)\" 		    \
+ 	-DTOP_SRC_DATADIR=\"$(top_srcdir)/data\"    \
+-	-DABS_TOP_BUILD_DIR=\"$(abs_top_builddir)\" \
++	-DTOP_BUILD_DIR=\"$(top_builddir)\"         \
+ 	-DLOCALEDIR=\"$(localedir)\"		    \
+ 	$(AM_CPPFLAGS)
+ 
+diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
+index 0430582..a42ec4e 100644
+--- a/lib/ephy-profile-utils.c
++++ b/lib/ephy-profile-utils.c
+@@ -128,7 +128,7 @@ ephy_profile_utils_do_migration (const char *profile_directory, int test_to_run,
+   argv[i++] = NULL;
+ 
+   if (debug)
+-    argv[0] = ABS_TOP_BUILD_DIR"/lib/"EPHY_PROFILE_MIGRATOR;
++    argv[0] = TOP_BUILD_DIR"/lib/"EPHY_PROFILE_MIGRATOR;
+ 
+   ret = g_spawn_sync (NULL, argv, envp, G_SPAWN_SEARCH_PATH,
+                       NULL, NULL, NULL, NULL,
+-- 
+1.9.1
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 05/18] dtc.inc: fix buildpaths QA issue
  2016-03-18  9:01 ` [PATCH 05/18] dtc.inc: fix buildpaths " Hongxu Jia
@ 2016-03-18 12:01   ` Jussi Kukkonen
  2016-03-18 13:04     ` Hongxu Jia
  0 siblings, 1 reply; 31+ messages in thread
From: Jussi Kukkonen @ 2016-03-18 12:01 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2751 bytes --]

On 18 March 2016 at 11:01, Hongxu Jia <hongxu.jia@windriver.com> wrote:

> Previous Makefile define its own CFLAGS, pass DEBUG_FLAGS to
> it could fix build path issue in DWARF.
>
> [YOCTO #8457]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/recipes-kernel/dtc/dtc.inc                    |  3 +++
>  .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       | 30
> ++++++++++++++++++++++
>  2 files changed, 33 insertions(+)
>  create mode 100644
> meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
>
> diff --git a/meta/recipes-kernel/dtc/dtc.inc
> b/meta/recipes-kernel/dtc/dtc.inc
> index 0c409b0..a1a30fc 100644
> --- a/meta/recipes-kernel/dtc/dtc.inc
> +++ b/meta/recipes-kernel/dtc/dtc.inc
> @@ -7,8 +7,11 @@ DEPENDS = "flex-native bison-native"
>  SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
>             file://make_install.patch \
>           "
> +SRC_URI_append_class-target = " file://pass-DEBUG_FLAGS-to-CFLAGS.patch \
> +"
>
>  EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
> +EXTRA_OEMAKE_class-target += 'DEBUG_FLAGS="${DEBUG_FLAGS}"'
>
>  S = "${WORKDIR}/git"
>
> diff --git a/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
> b/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
> new file mode 100644
> index 0000000..3f17ee9
> --- /dev/null
> +++ b/meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
> @@ -0,0 +1,30 @@
> +From 4019e29b0c1ec441fa43d9969197c24ad73f3b1a Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Fri, 26 Feb 2016 03:28:15 -0500
> +Subject: [PATCH] Makefile: pass DEBUG_FLAGS to CFLAGS
> +
> +It fixes buildpaths issue while compiling.
> +
> +Upstream-Status: Inappropriate [openembedded specific]
>

Is this really an openembedded specific change?

+
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 18838cc..4954f32 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -18,7 +18,7 @@ CONFIG_LOCALVERSION =
> + CPPFLAGS = -I libfdt -I .
> + WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
> +       -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
> +-CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
> ++CFLAGS = $(DEBUG_FLAGS) -Os -fPIC -Werror $(WARNINGS)
> +
> + BISON = bison
> + LEX = flex
> +--
> +1.9.1
> +
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 3946 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 05/18] dtc.inc: fix buildpaths QA issue
  2016-03-18 12:01   ` Jussi Kukkonen
@ 2016-03-18 13:04     ` Hongxu Jia
  0 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-18 13:04 UTC (permalink / raw)
  To: Jussi Kukkonen; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

On 03/18/2016 08:01 PM, Jussi Kukkonen wrote:
>
>
>     +Upstream-Status: Inappropriate [openembedded specific]
>
>
> Is this really an openembedded specific change?
>
>     +
>     +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     +---
>     + Makefile | 2 +-
>     + 1 file changed, 1 insertion(+), 1 deletion(-)
>     +
>     +diff --git a/Makefile b/Makefile
>     +index 18838cc..4954f32 100644
>     +--- a/Makefile
>     ++++ b/Makefile
>     +@@ -18,7 +18,7 @@ CONFIG_LOCALVERSION =
>     + CPPFLAGS = -I libfdt -I .
>     + WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual
>     -Wnested-externs \
>     +       -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls
>     -Wshadow
>     +-CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
>     ++CFLAGS = $(DEBUG_FLAGS) -Os -fPIC -Werror $(WARNINGS)
>

See here, variable DEBUG_FLAGS is oe specific. That's the reason.

//Hongxu

[-- Attachment #2: Type: text/html, Size: 1836 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 17/18] gconf: fix buildpaths QA issue
  2016-03-18  9:01 ` [PATCH 17/18] gconf: fix buildpaths " Hongxu Jia
@ 2016-03-18 16:28   ` Burton, Ross
  2016-03-19  9:09     ` Hongxu Jia
  0 siblings, 1 reply; 31+ messages in thread
From: Burton, Ross @ 2016-03-18 16:28 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

On 18 March 2016 at 09:01, Hongxu Jia <hongxu.jia@windriver.com> wrote:

> In ${S}/gconf/gconfd.c, we have:
> ...
>   /* -- Debug only */
>
>   if (addresses == NULL)
>     {
>       gconf_log(GCL_DEBUG, _("gconfd compiled with debugging; trying to
> load gconf.path from the source directory"));
>       conffile = g_strconcat(GCONF_SRCDIR, "/gconf/gconf.path", NULL);
>       addresses = gconf_load_source_path(conffile, NULL);
>       g_free(conffile);
>     }
>
>   /* -- End of Debug Only */
>

This seems like a lot of effort to remove a build path from the binaries.
Can we just disable the debugging support instead?  GConf is effectively
unmaintained these days anyway.

Ross

[-- Attachment #2: Type: text/html, Size: 1178 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 17/18] gconf: fix buildpaths QA issue
  2016-03-18 16:28   ` Burton, Ross
@ 2016-03-19  9:09     ` Hongxu Jia
  0 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19  9:09 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

On 03/19/2016 12:28 AM, Burton, Ross wrote:
>
> On 18 March 2016 at 09:01, Hongxu Jia <hongxu.jia@windriver.com 
> <mailto:hongxu.jia@windriver.com>> wrote:
>
>     In ${S}/gconf/gconfd.c, we have:
>     ...
>       /* -- Debug only */
>
>       if (addresses == NULL)
>         {
>           gconf_log(GCL_DEBUG, _("gconfd compiled with debugging;
>     trying to load gconf.path from the source directory"));
>           conffile = g_strconcat(GCONF_SRCDIR, "/gconf/gconf.path", NULL);
>           addresses = gconf_load_source_path(conffile, NULL);
>           g_free(conffile);
>         }
>
>       /* -- End of Debug Only */
>
>
> This seems like a lot of effort to remove a build path from the 
> binaries.  Can we just disable the debugging support instead?  GConf 
> is effectively unmaintained these days anyway.
>

Of course yes, I will update it to disable debug support

//Hongxu

> Ross


[-- Attachment #2: Type: text/html, Size: 2456 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH V4 00/18] fix buildpaths QA issue
  2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
                   ` (17 preceding siblings ...)
  2016-03-18  9:02 ` [PATCH 18/18] epiphany: " Hongxu Jia
@ 2016-03-19 14:56 ` Hongxu Jia
  2016-03-19 14:56   ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
                     ` (4 more replies)
  18 siblings, 5 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

(Only send updated patches)

Changed in V4:

- gconf: disable debug mode to fix build paths

- Improve variable PACKAGE_BUILDPATH_TEXT_FILES to supports
  package override while files exist in conditionally generated package.
  (such as ${PN}-ptest is conditionally generated)

The following changes since commit 8debfea81e69d038bd2d56314b272cb74f5582ed:

  local.conf.sample: Disable prelink by default (2016-03-13 22:09:05 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib hongxu/fix-buildpath
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/fix-buildpath

Hongxu Jia (18):
  gcc-5.3/gcc-4.9:replace build path with target path in __FILE__
  gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map
  kernel.bbclass: fix buildpath QA issue
  valgrind: fix buildpath QA issue
  dtc.inc: fix buildpaths QA issue
  fix_buildpaths.bbclass: add bbclass to fix build path
  icu: fix buildpaths QA issue
  tcl: fix buildpath QA issue
  python2/3: fix buildpath QA issue
  bbclass distutils/distutils3: fix .pyc/.pyo buildpath
  bbclass distutils/distutils3/setuptools/setuptools3: clean up
    DISTUTILS_INSTALL_ARGS
  python-setuptools/python3-setuptools: use old-style install
  python3-pip: use old-style install
  waf.bbclass: support do patch on extracted files
  python-pycairo: fix buildpath QA issue
  openssl: fix buildpath QA issue
  epiphany: fix buildpaths QA issue
  gconf: fix buildpaths QA issue

 meta/classes/distutils.bbclass                     |   8 +-
 meta/classes/distutils3.bbclass                    |   8 +-
 meta/classes/fix_buildpaths.bbclass                |  56 ++++
 meta/classes/kernel.bbclass                        |   4 +-
 meta/classes/setuptools.bbclass                    |   5 -
 meta/classes/setuptools3.bbclass                   |   5 -
 meta/classes/waf.bbclass                           |  11 +-
 .../openssl/remove-build-path-in-source-code.patch |  44 ++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |   7 +
 meta/recipes-devtools/gcc/gcc-4.9.inc              |   2 +
 .../gcc-4.9/0072-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch |  43 ++++
 meta/recipes-devtools/gcc/gcc-5.3.inc              |   2 +
 .../gcc-5.3/0054-support-ffile-prefix-map.patch    | 284 +++++++++++++++++++++
 ...ug-prefix-map-to-replace-ffile-prefix-map.patch |  43 ++++
 ...trip-off-build-path-in-purported-filename.patch |  62 +++++
 .../python/python-pycairo_1.10.0.bb                |  25 +-
 .../python/python-setuptools_19.4.bb               |   2 -
 meta/recipes-devtools/python/python3-pip_8.0.0.bb  |  12 -
 .../python/python3-setuptools_19.4.bb              |   8 +-
 meta/recipes-devtools/python/python3_3.5.1.bb      |  20 +-
 meta/recipes-devtools/python/python_2.7.11.bb      |  29 ++-
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb           |  13 +-
 meta/recipes-devtools/valgrind/valgrind_3.11.0.bb  |   5 +-
 meta/recipes-gnome/epiphany/epiphany_3.18.4.bb     |   8 +-
 .../files/use-relative-path-for-build-dir.patch    |  57 +++++
 meta/recipes-gnome/gnome/gconf_3.2.6.bb            |   1 +
 meta/recipes-kernel/dtc/dtc.inc                    |   3 +
 .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       |  30 +++
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      |  61 +++++
 meta/recipes-support/icu/icu_56.1.bb               |  12 +
 31 files changed, 1081 insertions(+), 73 deletions(-)
 create mode 100644 meta/classes/fix_buildpaths.bbclass
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
 create mode 100644 meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
 create mode 100644 meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
 create mode 100644 meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch

-- 
1.9.1



^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
@ 2016-03-19 14:56   ` Hongxu Jia
  2016-03-19 14:56   ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

Define variable PACKAGE_BUILDPATH_TEXT_FILES to list files that have
build paths and remove these paths at do_package time. It supports
package override while files exist in conditionally generated package.
(such as ${PN}-ptest is conditionally generated)

Define variable PACKAGE_BUILDPATH_TEXT_PATTERNS to list build path
patterns, which used by sed, it removes --sysroot and
-fdebug-prefix-map in text files by default.

Define python function to remove build path in variable.

Define python function to remove build path in python compiled
code.

[YOCTO #9169]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/fix_buildpaths.bbclass | 56 +++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 meta/classes/fix_buildpaths.bbclass

diff --git a/meta/classes/fix_buildpaths.bbclass b/meta/classes/fix_buildpaths.bbclass
new file mode 100644
index 0000000..f97057a
--- /dev/null
+++ b/meta/classes/fix_buildpaths.bbclass
@@ -0,0 +1,56 @@
+PACKAGE_PREPROCESS_FUNCS += 'remove_buildpath_package_preprocess'
+
+def list_package_buildpath_text_files(d):
+    files = d.getVar('PACKAGE_BUILDPATH_TEXT_FILES', True) or ''
+
+    # Support package override
+    for pn in d.getVar('PACKAGES', True).split():
+        files += d.getVar('PACKAGE_BUILDPATH_TEXT_FILES_%s' % pn, True) or ''
+
+    return files
+
+remove_buildpath_package_preprocess () {
+	buildpath_files="${@list_package_buildpath_text_files(d)}"
+
+	# Remove build paths in text files
+	for file in $buildpath_files;do
+		sed -i ${PACKAGE_BUILDPATH_TEXT_PATTERNS} ${PKGD}$file
+	done
+}
+
+# List build path patterns, which used by sed, it removes
+# --sysroot and -fdebug-prefix-map by default.
+PACKAGE_BUILDPATH_TEXT_PATTERNS = " \
+    -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:-fdebug-prefix-map=${B}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${S}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_NATIVE}=::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_HOST}=::g' \
+"
+
+# List files which have build paths, and remove these paths.
+PACKAGE_BUILDPATH_TEXT_FILES ??= ""
+
+# Remove build path in variable
+def remove_buildpath_variable(d, var):
+    val = d.getVar(var, True) or ''
+
+    toolchain_opts = d.getVar('TOOLCHAIN_OPTIONS', True)
+    val = val.replace(toolchain_opts, '')
+
+    debug_flags = d.getVar('DEBUG_FLAGS', True).split()
+    for opt in debug_flags:
+        if '-fdebug-prefix-map=' in opt:
+            val = val.replace(opt, '')
+
+    return val
+
+# Remove build path in python compiled code which
+# located in root_path
+def remove_buildpath_bytecode(root_path, byte_code):
+    import py_compile
+
+    file = root_path + byte_code[0:-1]
+    dfile = byte_code[0:-1]
+    py_compile.compile(file, dfile=dfile)
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 07/18] icu: fix buildpaths QA issue
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
  2016-03-19 14:56   ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
@ 2016-03-19 14:56   ` Hongxu Jia
  2016-03-19 14:56   ` [PATCH 09/18] python2/3: fix buildpath " Hongxu Jia
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

- Define new variable U_CC and U_CXX which do not have build path.
  The output of icuinfo will not have build path in it:
  ...
  root@qemux86-64:~# icuinfo
   <icuSystemParams type="icu4c">
      [snip]
      <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      [snip]
   </icuSystemParams>
  ...

- Remove build paths in pkgdata.inc, Makefile.inc and
  icu-config.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      | 61 ++++++++++++++++++++++
 meta/recipes-support/icu/icu_56.1.bb               | 12 +++++
 2 files changed, 73 insertions(+)
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch

diff --git a/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch b/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
new file mode 100644
index 0000000..826d934
--- /dev/null
+++ b/meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
@@ -0,0 +1,61 @@
+From 3221b108a18edeff5424bc5c66589eb20148d9b2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 2 Mar 2016 21:18:34 -0500
+Subject: [PATCH] add variable U_CC and U_CXX
+
+Define new variable U_CC and U_CXX which do not have build path.
+The output of icuinfo will not have build path in it:
+...
+root@qemux86-64:~# icuinfo
+ <icuSystemParams type="icu4c">
+    [snip]
+    <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    [snip]
+ </icuSystemParams>
+...
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac               | 9 +++++++++
+ tools/toolutil/Makefile.in | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 595bd12..ec05c19 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -673,6 +673,15 @@ AC_SUBST(GENCCODE_ASSEMBLY)
+ 
+ AC_MSG_RESULT($GENCCODE_ASSEMBLY)
+ 
++# U_CC and U_CXX are used for icuinfo which remove
++# --sysroot for cross-compilation
++U_CC=${U_CC}
++AC_SUBST(U_CC)
++AC_MSG_RESULT(U_CC)
++U_CXX=${U_CXX}
++AC_SUBST(U_CXX)
++AC_MSG_RESULT(U_CXX)
++
+ # Checks for header files
+ AC_CHECK_HEADERS(inttypes.h)
+ if test $ac_cv_header_inttypes_h = no; then
+diff --git a/tools/toolutil/Makefile.in b/tools/toolutil/Makefile.in
+index 1fb42ed..a083522 100644
+--- a/tools/toolutil/Makefile.in
++++ b/tools/toolutil/Makefile.in
+@@ -46,7 +46,7 @@ CXXFLAGS += $(LIBCXXFLAGS)
+ CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
+ 
+ # from icuinfo
+-CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
++CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@U_CC@\"" "-DU_CXX=\"@U_CXX@\""
+ CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
+ 
+ DEFS += -DU_TOOLUTIL_IMPLEMENTATION
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/icu/icu_56.1.bb b/meta/recipes-support/icu/icu_56.1.bb
index db0de10..1fd4dfc 100644
--- a/meta/recipes-support/icu/icu_56.1.bb
+++ b/meta/recipes-support/icu/icu_56.1.bb
@@ -17,6 +17,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://icu-pkgdata-large-cmd.patch \
            file://fix-install-manx.patch \
            file://icu-release-56-1-flagparser-fix.patch \
+           file://add-variable-U_CC-and-U_CXX.patch \
           "
 
 SRC_URI_append_class-target = "\
@@ -27,3 +28,14 @@ SRC_URI[sha256sum] = "3a64e9105c734dcf631c0b3ed60404531bce6c0f5a64bfe1a6402a4cc2
 
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
 UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
+
+inherit fix_buildpaths
+CACHED_CONFIGUREVARS += "U_CC="${@remove_buildpath_variable(d, 'CC')}" \
+                         U_CXX="${@remove_buildpath_variable(d, 'CXX')}" \
+"
+PACKAGE_BUILDPATH_TEXT_FILES_${PN}-dev ?= " \
+    ${libdir}/${BPN}/${PV}/pkgdata.inc \
+    ${libdir}/${BPN}/${PV}/Makefile.inc \
+    ${bindir}/icu-config \
+"
+
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 09/18] python2/3: fix buildpath QA issue
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
  2016-03-19 14:56   ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
  2016-03-19 14:56   ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
@ 2016-03-19 14:56   ` Hongxu Jia
  2016-03-19 14:56   ` [PATCH 16/18] openssl: " Hongxu Jia
  2016-03-19 14:56   ` [PATCH 18/18] gconf: fix buildpaths " Hongxu Jia
  4 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

- Remove build paths in target file

- Since _sysconfigdata.py was modified at do_package,
  so update _sysconfigdata.pyc manually (Python2 only).

[YOCTO #8446]
[YOCTO #9169]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/python/python3_3.5.1.bb | 20 ++++++++++++++----
 meta/recipes-devtools/python/python_2.7.11.bb | 29 ++++++++++++++++++++++-----
 2 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-devtools/python/python3_3.5.1.bb b/meta/recipes-devtools/python/python3_3.5.1.bb
index 2fbb3cb..bfcea85 100644
--- a/meta/recipes-devtools/python/python3_3.5.1.bb
+++ b/meta/recipes-devtools/python/python3_3.5.1.bb
@@ -186,12 +186,24 @@ PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
 }
 
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+    ${bindir}/python${PYTHON_BINABI}-config \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
+
 require python-${PYTHON_MAJMIN}-manifest.inc
 
 # manual dependency additions
diff --git a/meta/recipes-devtools/python/python_2.7.11.bb b/meta/recipes-devtools/python/python_2.7.11.bb
index 0c00d6e..3cf8642 100644
--- a/meta/recipes-devtools/python/python_2.7.11.bb
+++ b/meta/recipes-devtools/python/python_2.7.11.bb
@@ -128,15 +128,34 @@ do_install_append_class-nativesdk () {
 
 SSTATE_SCAN_FILES += "Makefile"
 PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
-
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+}
+
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+"
+PACKAGE_BUILDPATH_TEXT_FILES_${PN}-ptest ?= " \
+    ${PTEST_PATH}/Makefile \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
 
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+PACKAGE_PREPROCESS_FUNCS += "update_pyc_package_preprocess"
+python update_pyc_package_preprocess () {
+    # Update _sysconfigdata.pyc
+    root_path = d.expand("${PKGD}")
+    byte_code = d.expand("${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.pyc")
+    remove_buildpath_bytecode(root_path, byte_code)
 }
 
 require python-${PYTHON_MAJMIN}-manifest.inc
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 16/18] openssl: fix buildpath QA issue
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
                     ` (2 preceding siblings ...)
  2016-03-19 14:56   ` [PATCH 09/18] python2/3: fix buildpath " Hongxu Jia
@ 2016-03-19 14:56   ` Hongxu Jia
  2016-03-19 14:56   ` [PATCH 18/18] gconf: fix buildpaths " Hongxu Jia
  4 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

- The openssl records $CC and $CFLAGS in source code which
  caused buildpaths QA issue:
  In crypto/cversion.c
  ...
      if (t == SSLEAY_CFLAGS) {
          return (CFLAGS);
          return ("compiler: information not available");
      }
  ...
  We should remove build path in the above source code.

- Remove build paths in ${PTEST_PATH}/Makefile  and
  ${PTEST_PATH}/Configure

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../openssl/remove-build-path-in-source-code.patch | 44 ++++++++++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |  7 ++++
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch

diff --git a/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch b/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
new file mode 100644
index 0000000..fd5531b
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
@@ -0,0 +1,44 @@
+From b937d7581a1793cdebbf5829bdaea787ed4128db Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 7 Mar 2016 01:11:42 -0500
+Subject: [PATCH] crypto/Makefile: remove build path in source code
+
+Openssl records $CC and $CFLAGS in source code which
+caused buildpaths QA issue:
+In crypto/cversion.c
+...
+    if (t == SSLEAY_CFLAGS) {
+        return (CFLAGS);
+        return ("compiler: information not available");
+    }
+...
+
+We should remove build path in the above source code.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ crypto/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/crypto/Makefile b/crypto/Makefile
+index 17a87f8..ee630e8 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -54,8 +54,11 @@ top:
+ 
+ all: shared
+ 
++NO_BUILDPATH_CCFLAGS=`echo "$(CC) $(CFLAGS)" | \
++         sed -e 's:--sysroot=[^ ]*::g' \
++             -e 's:-fdebug-prefix-map=[^ ]*::g'`
+ buildinf.h: ../Makefile
+-	$(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
++	$(PERL) $(TOP)/util/mkbuildinf.pl "$(NO_BUILDPATH_CCFLAGS)" "$(PLATFORM)" >buildinf.h
+ 
+ x86cpuid.s:	x86cpuid.pl perlasm/x86asm.pl
+ 	$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
index 290f129..078f60e 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
@@ -39,6 +39,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
             file://ptest_makefile_deps.patch  \
             file://configure-musl-target.patch \
             file://parallel.patch \
+            file://remove-build-path-in-source-code.patch \
            "
 
 SRC_URI[md5sum] = "f3c710c045cdee5fd114feb69feba7aa"
@@ -47,6 +48,12 @@ SRC_URI[sha256sum] = "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e895
 PACKAGES =+ "${PN}-engines"
 FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
 
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES_${PN}-ptest ?= " \
+        ${PTEST_PATH}/Makefile \
+        ${PTEST_PATH}/Configure \
+"
+
 # The crypto_use_bigint patch means that perl's bignum module needs to be
 # installed, but some distributions (for example Fedora 23) don't ship it by
 # default.  As the resulting error is very misleading check for bignum before
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 18/18] gconf: fix buildpaths QA issue
  2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
                     ` (3 preceding siblings ...)
  2016-03-19 14:56   ` [PATCH 16/18] openssl: " Hongxu Jia
@ 2016-03-19 14:56   ` Hongxu Jia
  2016-03-21 14:47     ` Burton, Ross
  4 siblings, 1 reply; 31+ messages in thread
From: Hongxu Jia @ 2016-03-19 14:56 UTC (permalink / raw)
  To: ross.burton; +Cc: openembedded-core

The build paths come from debug mode, and GConf is effectively
unmaintained these days anyway. So explicitly disable debug
to fix build paths QA issue.

[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-gnome/gnome/gconf_3.2.6.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-gnome/gnome/gconf_3.2.6.bb b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
index feaf080..91c5366 100644
--- a/meta/recipes-gnome/gnome/gconf_3.2.6.bb
+++ b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -27,6 +27,7 @@ PACKAGECONFIG_class-native = ""
 PACKAGECONFIG_libc-uclibc = ""
 
 PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
+PACKAGECONFIG[debug] = "--enable-debug=yes, --enable-debug=no"
 
 do_install_append() {
 	# this directory need to be created to avoid an Error 256 at gdm launch
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 18/18] gconf: fix buildpaths QA issue
  2016-03-19 14:56   ` [PATCH 18/18] gconf: fix buildpaths " Hongxu Jia
@ 2016-03-21 14:47     ` Burton, Ross
  2016-03-22  1:16       ` Hongxu Jia
  0 siblings, 1 reply; 31+ messages in thread
From: Burton, Ross @ 2016-03-21 14:47 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

On 19 March 2016 at 14:56, Hongxu Jia <hongxu.jia@windriver.com> wrote:

> +PACKAGECONFIG[debug] = "--enable-debug=yes, --enable-debug=no"
>

There's an explicit --enable-debug in EXTRA_OECONF, and reading the
configure --help shows that the "off" mode should be --enable-debug=minimum
as "no" removes the GLib checks which can result in crashes if bad data is
passed to the API.

Ross

[-- Attachment #2: Type: text/html, Size: 839 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 18/18] gconf: fix buildpaths QA issue
  2016-03-21 14:47     ` Burton, Ross
@ 2016-03-22  1:16       ` Hongxu Jia
  0 siblings, 0 replies; 31+ messages in thread
From: Hongxu Jia @ 2016-03-22  1:16 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

On 03/21/2016 10:47 PM, Burton, Ross wrote:
>
> On 19 March 2016 at 14:56, Hongxu Jia <hongxu.jia@windriver.com 
> <mailto:hongxu.jia@windriver.com>> wrote:
>
>     +PACKAGECONFIG[debug] = "--enable-debug=yes, --enable-debug=no"
>
>
> There's an explicit --enable-debug in EXTRA_OECONF,

Yes, we should remove the duplicated --enable-debug in EXTRA_OECONF

> and reading the configure --help shows that the "off" mode should be 
> --enable-debug=minimum as "no" removes the GLib checks which can 
> result in crashes if bad data is passed to the API.

./configure --help
...
   --enable-debug          Compile with debug checks. [no/yes/minimum,
                           default=minimum]
...

vim ./configure.ac
...
121 dnl Default to debug spew in unstable branch
122 AC_ARG_ENABLE(debug,
123   AS_HELP_STRING([--enable-debug],
124     [Compile with debug checks. @<:@no/yes/minimum, 
default=minimum@:>@]),
125   , enable_debug=minimum)
126
127 if test "x$enable_debug" = "xyes"; then
128   CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1"
129   AC_MSG_NOTICE([Will build with debugging spew and checks])
130 else
131   if test "x$enable_debug" = "xno"; then
132     CFLAGS="$CFLAGS -DG_DISABLE_CHECKS=1 -DG_DISABLE_ASSERT=1"
133     AC_MSG_NOTICE([Will build without *any* debugging code])
134   else
135     AC_MSG_NOTICE([Will build with debug checks but no debug spew])
136   fi
137 fi
...

vim gconf/gconfd.c
...
  384 #ifdef GCONF_ENABLE_DEBUG
  385   /* -- Debug only */
  386
  387   if (addresses == NULL)
  388     {
  389       gconf_log(GCL_DEBUG, _("gconfd compiled with debugging; 
trying to load gconf.path from the source directory"));
  390       conffile = g_strconcat(GCONF_SRCDIR, "/gconf/gconf.path", NULL);
  391       addresses = gconf_load_source_path(conffile, NULL);
  392       g_free(conffile);
  393     }
  394
  395   /* -- End of Debug Only */
  396 #endif
...

If we could not use '--enable-debug=yes' to fix build paths issue,
and as your suggested it should not remove check and assert,
so minimum is the best choice.

//Hongxu

>
> Ross


[-- Attachment #2: Type: text/html, Size: 4166 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2016-03-22  1:16 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ Hongxu Jia
2016-03-18  9:01 ` [PATCH 02/18] gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map Hongxu Jia
2016-03-18  9:01 ` [PATCH 03/18] kernel.bbclass: fix buildpath QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 04/18] valgrind: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 05/18] dtc.inc: fix buildpaths " Hongxu Jia
2016-03-18 12:01   ` Jussi Kukkonen
2016-03-18 13:04     ` Hongxu Jia
2016-03-18  9:01 ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-18  9:01 ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 08/18] tcl: fix buildpath " Hongxu Jia
2016-03-18  9:01 ` [PATCH 09/18] python2/3: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 10/18] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
2016-03-18  9:01 ` [PATCH 11/18] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
2016-03-18  9:01 ` [PATCH 12/18] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
2016-03-18  9:01 ` [PATCH 13/18] python3-pip: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 14/18] waf.bbclass: support do patch on extracted files Hongxu Jia
2016-03-18  9:01 ` [PATCH 15/18] python-pycairo: fix buildpath QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 16/18] openssl: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 17/18] gconf: fix buildpaths " Hongxu Jia
2016-03-18 16:28   ` Burton, Ross
2016-03-19  9:09     ` Hongxu Jia
2016-03-18  9:02 ` [PATCH 18/18] epiphany: " Hongxu Jia
2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
2016-03-19 14:56   ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-19 14:56   ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
2016-03-19 14:56   ` [PATCH 09/18] python2/3: fix buildpath " Hongxu Jia
2016-03-19 14:56   ` [PATCH 16/18] openssl: " Hongxu Jia
2016-03-19 14:56   ` [PATCH 18/18] gconf: fix buildpaths " Hongxu Jia
2016-03-21 14:47     ` Burton, Ross
2016-03-22  1:16       ` Hongxu Jia

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.