Skip to contentSkip to conversation

fix buildpath QA Issue

PATCH New Hongxu Jia 1 participant 7 messages Feb 19, 2016

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix buildpath QA Issue

Also fix btrfs-tools and git which were found by workd build

Other buildpath fixes is still on the way.

//Hongxu

The following changes since commit ed20c6ca446a8788615e497bd4452195537deab5:

epiphany: Add libxml2-native to DEPENDS (2016-02-19 01:01:26 +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 (6):
depmodwrapper-cross: nopackages to avoid QA [buildpaths] issue
gcc: use relative path for configure script bison/gettext: add --with-bisonlocaledir to assign BISON_LOCALEDIR
openssl: substitute buildpath in source code
btrfs-tools: fix symlink creation multiple times
git: fix installed-vs-shipped QA Issue

 meta/recipes-connectivity/openssl/openssl.inc      |  2 +-
 .../substitute-buildpath-in-source-code.patch      | 41 +++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2f.bb |  1 +
 .../gettext-0.19.6/add-with-bisonlocaledir.patch   | 58 ++++++++++++++++++++++
 meta/recipes-core/gettext/gettext_0.19.6.bb        |  4 ++
 .../bison/bison/add-with-bisonlocaledir.patch      | 58 ++++++++++++++++++++++
 meta/recipes-devtools/bison/bison_3.0.4.bb         |  1 +
 .../fix-symlink-creation-multiple-times.patch      | 46 +++++++++++++++++
 .../btrfs-tools/btrfs-tools_4.4.bb                 |  1 +
 meta/recipes-devtools/gcc/gcc-runtime.inc          |  3 +-
 meta/recipes-devtools/gcc/gcc-sanitizers.inc       |  3 +-
 meta/recipes-devtools/gcc/libgcc-common.inc        |  3 +-
 meta/recipes-devtools/gcc/libgfortran.inc          |  3 +-
 meta/recipes-devtools/git/git.inc                  |  2 +
 .../recipes-kernel/kmod/depmodwrapper-cross_1.0.bb |  2 +
 15 files changed, 223 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/substitute-buildpath-in-source-code.patch
 create mode 100644 meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch
 create mode 100644 meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
 create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/6 depmodwrapper-cross: nopackages to avoid QA [buildpaths] issue

This depmodwrapper is a wrapper script to support install-corss, which is invoked at do_rootfs time. So the depmodwrapper-cross should not generate packages. The fix could avoids QA buildpaths issue.

[YOCTO #7058]

---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +2 -0
index 8acb3a8..c2c2589 100644
@@ -46,3 +46,5 @@ SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
 depmodwrapper_sysroot_preprocess () {
 	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
 }
+
+inherit nopackages
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/6 gcc: use relative path for configure script

In reply to Hongxu Jia

The absolute path (/path/to/configure) caused __FILE__ to be an absolute path.

If 'assert' invoked, it uses __FILE__, and build path would be in elf files. In assert.h
...
.# define assert(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
: __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
...

Which triggered buildpaths QA issue:
...
| libgcc-5.3.0: File work/core2-64-poky-linux/libgcc/5.3.0-r0/packages-split/ libgcc-dev/usr/lib64/x86_64-poky-linux/5.3.0/libgcc.a in package contained reference to tmpdir [buildpaths]
...

Use relative path to run configure can fix the problem.

[YOCTO #7058]

---
 meta/recipes-devtools/gcc/gcc-runtime.inc    | 3 ++-
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 3 ++-
 meta/recipes-devtools/gcc/libgcc-common.inc  | 3 ++-
 meta/recipes-devtools/gcc/libgfortran.inc    | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)
meta/recipes-devtools/gcc/gcc-runtime.inc +2 -1
index f20d298..844149f 100644
@@ -29,7 +29,8 @@ do_configure () {
 		mkdir -p ${B}/$target/$d/
 		cd ${B}/$target/$d/
 		chmod a+x ${S}/$d/configure
-		${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+		relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
+		$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	done
 }
 
meta/recipes-devtools/gcc/gcc-sanitizers.inc +2 -1
index 03627ff..6091a0b 100644
@@ -23,7 +23,8 @@ do_configure () {
     mkdir -p ${B}/$target/libsanitizer/
     cd ${B}/$target/libsanitizer/
     chmod a+x ${S}/libsanitizer/configure
-    ${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+    relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/libsanitizer")}
+    $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
     # Easiest way to stop bad RPATHs getting into the library since we have a
     # broken libtool here
     sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool
meta/recipes-devtools/gcc/libgcc-common.inc +2 -1
index b09ea65..dae07e9 100644
@@ -12,7 +12,8 @@ do_configure () {
 	mkdir -p ${B}/$target/${BPN}/
 	cd ${B}/${BPN}
 	chmod a+x ${S}/${BPN}/configure
-	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+	relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
+	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 }
 
 do_compile () {
meta/recipes-devtools/gcc/libgfortran.inc +2 -1
index e42843d..58ceb2e 100644
@@ -15,7 +15,8 @@ do_configure () {
 	mkdir -p ${B}/$target/libgfortran/
 	cd ${B}/$target/libgfortran/
 	chmod a+x ${S}/libgfortran/configure
-	${S}/libgfortran/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+	relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
+	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	# Easiest way to stop bad RPATHs getting into the library since we have a
 	# broken libtool here
 	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/6 bison/gettext: add --with-bisonlocaledir to assign BISON_LOCALEDIR

In reply to Hongxu Jia

This issue was triggered by buildpaths QA Warning.
...
|gettext-0.19.6: File work/core2-64-poky-linux/gettext/0.19.6-r0/ packages-split/gettext/usr/bin/msgcmp in package contained reference to tmpdir
...

Previously, variable BISON_LOCALEDIR was assigned only by the output of 'bison --print-localedir' which provided by native bison that has buildpaths in it.

For target compile, we add option --with-bisonlocaledir to set BISON_LOCALEDIR with "/usr/share/locale" to fix the QA issue.

The variable BISON_LOCALEDIR is used for internationalization of the bison parser’s runtime output. Here is the introduction:
http://www.gnu.org/software/bison/manual/html_node/Internationalization.html

[YOCTO #7058]

---
 .../gettext-0.19.6/add-with-bisonlocaledir.patch   | 58 ++++++++++++++++++++++
 meta/recipes-core/gettext/gettext_0.19.6.bb        |  4 ++
 .../bison/bison/add-with-bisonlocaledir.patch      | 58 ++++++++++++++++++++++
 meta/recipes-devtools/bison/bison_3.0.4.bb         |  1 +
 4 files changed, 121 insertions(+)
 create mode 100644 meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch
 create mode 100644 meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch new file +58 -0
new file mode 100644
index 0000000..35a1310
@@ -0,0 +1,58 @@
+From 04bd40fe2c48c6e01ab418a04d27c4aff644ad96 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Wed, 17 Feb 2016 23:54:02 -0500
+Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
+ BISON_LOCALEDIR
+
+The variable BISON_LOCALEDIR is assigned only by the output of
+'bison --print-localedir', we add option --with-bisonlocaledir
+to assign it explicitly. It is helpful for user to split the
+native compile and cross compile.
+
+For backward compatibility, if option not used, it still
+make use of the output of 'bison --print-localedir'.
+
+Upstream-Status: Submitted [[email protected]]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ gettext-tools/gnulib-m4/bison-i18n.m4 | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gettext-tools/gnulib-m4/bison-i18n.m4 b/gettext-tools/gnulib-m4/bison-i18n.m4
+index f5cfd3a..fb6ac4d 100644
+--- a/gettext-tools/gnulib-m4/bison-i18n.m4
++++ b/gettext-tools/gnulib-m4/bison-i18n.m4
+@@ -14,11 +14,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+ dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+ AC_DEFUN([BISON_I18N],
+ [
++  dnl Default is not to set bisonlocaledir
++  AC_ARG_WITH([bisonlocaledir],
++    [  --with-bisonlocaledir   sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
++    BISON_LOCALEDIR=$withval,
++    BISON_LOCALEDIR=)
++
+   if test -z "$USE_NLS"; then
+     echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+     exit 1
+   fi
+-  BISON_LOCALEDIR=
+   BISON_USE_NLS=no
+   if test "$USE_NLS" = yes; then
+     dnl Determine bison's localedir.
+@@ -26,9 +31,10 @@ AC_DEFUN([BISON_I18N],
+     dnl But even is YACC is called "yacc", it may be a script that invokes bison
+     dnl and accepts the --print-localedir option.
+     dnl YACC's default value is empty; BISON's default value is :.
+-    if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
++    if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
+       BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+     fi
++    AC_MSG_RESULT([$BISON_LOCALEDIR])
+     AC_SUBST([BISON_LOCALEDIR])
+     if test -n "$BISON_LOCALEDIR"; then
+       dnl There is no need to enable internationalization if the user doesn't
+-- 
+1.9.1
+
meta/recipes-core/gettext/gettext_0.19.6.bb +4 -0
index 737561d..fead06a 100644
@@ -12,6 +12,7 @@ PROVIDES_class-native = "virtual/gettext-native"
 RCONFLICTS_${PN} = "proxy-libintl"
 SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
 	   file://parallel.patch \
+	   file://add-with-bisonlocaledir.patch \
           "
 
 PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
@@ -38,6 +39,9 @@ EXTRA_OECONF += "--without-lispdir \
                  --with-included-libcroco \
                  --with-included-libunistring \
                 "
+EXTRA_OECONF_append_class-target = " \
+                 --with-bisonlocaledir=${datadir}/locale \
+"
 
 acpaths = '-I ${S}/gettext-runtime/m4 \
            -I ${S}/gettext-tools/m4'
meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch new file +58 -0

58 lines not on this page · raw message

meta/recipes-devtools/bison/bison_3.0.4.bb +1 -0
index 708e9a3..cffcd88 100644
@@ -14,6 +14,7 @@ SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
            file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
            file://dont-depend-on-help2man.patch.patch \
            file://0001-src-local.mk-fix-parallel-issue.patch \
+           file://add-with-bisonlocaledir.patch \
 "
 
 # No point in hardcoding path to m4, just use PATH
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 4/6 openssl: substitute buildpath in source code

In reply to Hongxu Jia

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 do substitution in the above source code which use string TOPDIR to replace variable $TOPDIR.

[YOCTO #7058]

---
 meta/recipes-connectivity/openssl/openssl.inc      |  2 +-
 .../substitute-buildpath-in-source-code.patch      | 41 ++++++++++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2f.bb |  1 +
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/substitute-buildpath-in-source-code.patch
meta/recipes-connectivity/openssl/openssl.inc +1 -1
index 1282115..f17bf94 100644
@@ -28,7 +28,7 @@ CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_END
 export DIRS = "crypto ssl apps"
 export EX_LIBS = "-lgcc -ldl"
 export AS = "${CC} -c"
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "-e MAKEFLAGS= TOPDIR=${TOPDIR}"
 
 inherit pkgconfig siteinfo multilib_header ptest
 
meta/recipes-connectivity/openssl/openssl/substitute-buildpath-in-source-code.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-connectivity/openssl/openssl_1.0.2f.bb +1 -0
index fbc78e1..32b9f97 100644
@@ -38,6 +38,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
             file://openssl-1.0.2a-x32-asm.patch \
             file://ptest_makefile_deps.patch  \
             file://configure-musl-target.patch \
+            file://substitute-buildpath-in-source-code.patch \
            "
 
 SRC_URI[md5sum] = "b3bf73f507172be9292ea2a8c28b659d"
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH 5/6 btrfs-tools: fix symlink creation multiple times

In reply to Hongxu Jia

The rule to create symlink in Makefile caused parallel issue:

$ make -j 40 DESTDIR=/image install BUILD_VERBOSE=1
...
  1     [LN]     libbtrfs.so.0
  2     [LN]     libbtrfs.so
  3 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
  4 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
  5 ln -s -f libbtrfs.so.0.1 libbtrfs.so
  6 ln -s -f libbtrfs.so.0.1 libbtrfs.so
...

It failed occasionally:
...
|symlinkat: couldn't stat 'git/libbtrfs.so' even though symlink creation succeeded (No such file or directory).
|ln: failed to create symbolic link 'libbtrfs.so': No such file or directory
...

---
 .../fix-symlink-creation-multiple-times.patch      | 46 ++++++++++++++++++++++
 .../btrfs-tools/btrfs-tools_4.4.bb                 |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch new file +46 -0
new file mode 100644
index 0000000..a945496
@@ -0,0 +1,46 @@
+From 05ab78e9183575e38f342e05a056cb7bcd1e52e1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 18 Feb 2016 20:41:28 -0500
+Subject: [PATCH] btrfs-progs: fix symlink creation multiple times
+
+The rule to create symlink in Makefile caused parallel issue:
+$ make -j 40 DESTDIR=/image install BUILD_VERBOSE=1
+...
+  1     [LN]     libbtrfs.so.0
+  2     [LN]     libbtrfs.so
+  3 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+  4 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+  5 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+  6 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+...
+
+It failed occasionally:
+...
+|symlinkat: couldn't stat 'git/libbtrfs.so' even though symlink
+creation succeeded (No such file or directory).
+|ln: failed to create symbolic link 'libbtrfs.so': No such file or directory
+...
+
+Upstream-Status: Submitted [[email protected]]
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Makefile.in | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1f4002e..16eeaf9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -236,8 +236,7 @@ $(libs_static): $(libbtrfs_objects)
+ 
+ $(lib_links):
+ 	@echo "    [LN]     $@"
+-	$(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so.0
+-	$(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so
++	$(Q)$(LN_S) -f libbtrfs.so.0.1 $@
+ 
+ # keep intermediate files from the below implicit rules around
+ .PRECIOUS: $(addsuffix .o,$(progs))
+-- 
+1.9.1
+
meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb +1 -0
index 5ca9bb0..9b68edc 100644
@@ -15,6 +15,7 @@ DEPENDS = "util-linux attr e2fsprogs lzo acl"
 SRCREV = "21258fab2caeade405a15ba932d373b364aa6e8c"
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
            file://fix-parallel.patch \
+           file://fix-symlink-creation-multiple-times.patch \
 "
 
 inherit autotools-brokensep pkgconfig
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH 6/6 git: fix installed-vs-shipped QA Issue

In reply to Hongxu Jia

Since commit set default libexecdir to $prefix/libexec
...
commit f35b2e29d9bfa817e64b83df11ebbbfe0f4e8e5c

Author: Ross Burton <[email protected]>
Date:   Tue Apr 30 20:35:54 2013 +0100

bitbake: set default libexecdir to $prefix/libexec
...

It casued '${D}${libdir}' does not exist, and the following
move operation incorrect which triggered QA Issue:
...
ERROR: git-2.7.0-r0 do_package: QA Issue: git: Files/directories were installed but not shipped in any package:
/usr/lib64
/usr/lib64/site_perl
/usr/lib64/site_perl/5.22.1
...

---
 meta/recipes-devtools/git/git.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/git/git.inc +2 -0
index c19e0d4..a1d0300 100644
@@ -50,6 +50,8 @@ perl_native_fixup () {
 
 	# ${libdir} is not applicable here, perl-native files are always
 	# installed to /usr/lib on both 32/64 bits targets.
+
+	mkdir -p ${D}${libdir}
 	mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
 	rmdir -p ${D}${exec_prefix}/lib/perl-native || true
 }
Signature · 1 line
1.9.1