Skip to contentSkip to conversation

Update default value of DEBUG_PREFIX_MAP

PATCH In review [email protected] 2 participants 9 messages Feb 15, 2019 – Feb 27, 2019

lore
Share & tools
lore
#0 lore raw

v2 cover Update default value of DEBUG_PREFIX_MAP

From: Kai Kang <[email protected]>

v2:
* add -fmacro-prefix-map rather than -ffile-prefix-map that the latter one could not be recognized by assembly compiler which causes buildpatchs issue for glibc
* other fix for openssl and libidn2

Build core-image-sato for qemux86, qemux86-64 and (qemuarm + musl). oe-selftest -r gotoolchain.oeGoToolchainSelfTest.test_go_dep_build PASS.

$ oe-selftest --skip-tests distrodata.Distrodata.test_checkpkg buildoptions.SourceMirroring.test_yocto_source_mirror -j 15
2 selftest cases failed but seems not realated with my patches.
2019-02-14 05:05:28,054 - oe-selftest - INFO - RESULTS - containerimage.ContainerImageTests.test_expected_files - Testcase 1619: FAILED (483.52s)
2019-02-14 05:05:28,054 - oe-selftest - INFO - RESULTS - distrodata.Distrodata.test_checkpkg - Testcase 1902: FAILED (177.51s)

The following changes since commit 5fa3b5b15229babc9f96606c79436ab83651bf83:

bitbake: bitbake: cookerdata: Check duplicated BBFILE_COLLECTIONS (2019-02-14 11:21:58 +0000)

are available in the Git repository at:

git://git.pokylinux.org/poky-contrib kangkai/prefix-map
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/prefix-map

Kai Kang (4):
bitbake.conf: update DEBUG_PREFIX_MAP with -fmacro-prefix-map
go-cross-canadian: set default value of DEBUG_PREFIX_MAP
libidn2: fix buildpaths qa warning
openssl: update patch to fix buildpaths qa issue for
-fmacro-prefix-map

 meta/conf/bitbake.conf                                    | 3 ++-
 ...dinfo-strip-sysroot-and-debug-prefix-map-from-co.patch | 8 +++++++-
 meta/recipes-devtools/go/go-cross-canadian.inc            | 8 ++++++++
 meta/recipes-extended/libidn/libidn2_2.0.5.bb             | 4 ++++
 4 files changed, 21 insertions(+), 2 deletions(-)

--
2.20.0

#1 lore raw

PATCH v2 1/4 bitbake.conf: update DEBUG_PREFIX_MAP with -fmacro-prefix-map

From: Kai Kang <[email protected]>

Add option '-fmacro-prefix-map' to DEBUG_PREFIX_MAP. It could resolve buildpaths qa warnings which caused by macros '__FILE__' and '__BASE_FILE__'.

Though option '-ffile-prefix-map' could cover '-fdebug-prefix-map' and '-fdebug-prefix-map' both, it is not supported by 'as' and causes buildpaths qa warnings of glibc:

| QA Issue: File
|  /work/i586-poky-linux/glibc/2.29-r0/packages-split/glibc-dev/usr/lib/crti.o
|  in package contained reference to tmpdir

So only add '-fmacro-prefix-map' to DEBUG_PREFIX_MAP rather than replace '-fdebug-prefix-map' with '-ffile-prefix-map'.

---
 meta/conf/bitbake.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +2 -1
index 6e063dc14d..435646a946 100644
@@ -601,7 +601,8 @@ EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} "
 # Optimization flags.
 ##################################################################
 # Beware: applied last to first
-DEBUG_PREFIX_MAP ?= "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+                     -fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
                      -fdebug-prefix-map=${STAGING_DIR_HOST}= \
                      -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
 "
Signature · 1 line
2.20.0
#2 lore raw

PATCH v2 2/4 go-cross-canadian: set default value of DEBUG_PREFIX_MAP

In reply to [email protected]

From: Kai Kang <[email protected]>

It uses gcc on build machine during go-cross-canadian bootstrap, but the gcc version may be old and not support option '-fmacro-prefix-map' which is one of default values of DEBUG_PREFIX_MAP.

So set default value of DEBUG_PREFIX_MAP for go-cross-canadian.

---
 meta/recipes-devtools/go/go-cross-canadian.inc | 8 ++++++++
 1 file changed, 8 insertions(+)
meta/recipes-devtools/go/go-cross-canadian.inc +8 -0
index 0bc5dce8a1..945d0f9d10 100644
@@ -5,6 +5,14 @@ DEPENDS = "go-native virtual/${HOST_PREFIX}go-crosssdk virtual/nativesdk-${HOST_
            virtual/nativesdk-${HOST_PREFIX}compilerlibs"
 PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
+# it uses gcc on build machine during go-cross-canadian bootstrap, but
+# the gcc version may be old and not support option '-fmacro-prefix-map'
+# which is one of default values of DEBUG_PREFIX_MAP
+DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+                    -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+                    -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+                    "
+
 export GOHOSTOS = "${BUILD_GOOS}"
 export GOHOSTARCH = "${BUILD_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
Signature · 1 line
2.20.0
#3 lore raw

PATCH v2 3/4 libidn2: fix buildpaths qa warning

In reply to [email protected]

From: Kai Kang <[email protected]>

Fix buildpaths qa warning of libidn2:

| WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File
| /work/core2-64-poky-linux/libidn2/2.0.5-r0/packages-split/libidn2-dev/usr/lib/pkgconfig/libidn2.pc
| in package contained reference to tmpdir [buildpaths]
---
 meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-extended/libidn/libidn2_2.0.5.bb +4 -0
index 0daf7a6877..da77c4402d 100644
@@ -26,4 +26,8 @@ EXTRA_OECONF += "--disable-rpath \
 LICENSE_${PN} = "(GPLv2+ | LGPLv3)"
 LICENSE_${PN}-bin = "GPLv3+"
 
+do_install_append () {
+    sed -i 's#${RECIPE_SYSROOT}##' ${D}${libdir}/pkgconfig/libidn2.pc
+}
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.20.0
#4 lore raw

Re: [PATCH 3/4] libidn2: fix buildpaths qa warning

Quoted 26 lines · On Thu, 2019-02-14 at 21:06 -0500, [email protected] wrote:

From: Kai Kang <[email protected]>

Fix buildpaths qa warning of libidn2:

Quoted 4 lines

WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File /work/core2-64-poky-linux/libidn2/2.0.5-r0/packages-split/libidn2- dev/usr/lib/pkgconfig/libidn2.pc
in package contained reference to tmpdir [buildpaths]

---
 meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -0
index 0daf7a6877..da77c4402d 100644
@@ -26,4 +26,8 @@ EXTRA_OECONF += "--disable-rpath \
 LICENSE_${PN} = "(GPLv2+ | LGPLv3)"
 LICENSE_${PN}-bin = "GPLv3+"
 
+do_install_append () {
+    sed -i 's#${RECIPE_SYSROOT}##'

${D}${libdir}/pkgconfig/libidn2.pc

meta/recipes-extended/libidn/libidn2_2.0.5.bb EXTRA_OECONF += "--disable-rpath \ · line 33

Quoted 3 lines
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -0
+}
+
 BBCLASSEXTEND = "native nativesdk"

I have a strong dislike for editing .pc files after the fact. Part of the concern is sed expressions like this bitrot badly, its hard to tell if they still work as intended.

Is there not a way we can generate a correct .pc file in the first place even if that means a patch?

Cheers,

Richard

author
#5 lore raw

Re: [PATCH 3/4] libidn2: fix buildpaths qa warning

Quoted 33 lines · Richard Purdie
Quoted 25 lines · On Thu, 2019-02-14 at 21:06 -0500, [email protected] wrote:

From: Kai Kang <[email protected]>

Fix buildpaths qa warning of libidn2:

Quoted 4 lines

WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File /work/core2-64-poky-linux/libidn2/2.0.5-r0/packages-split/libidn2- dev/usr/lib/pkgconfig/libidn2.pc
in package contained reference to tmpdir [buildpaths]

---
  meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -0
index 0daf7a6877..da77c4402d 100644
@@ -26,4 +26,8 @@ EXTRA_OECONF += "--disable-rpath \
  LICENSE_${PN} = "(GPLv2+ | LGPLv3)"
  LICENSE_${PN}-bin = "GPLv3+"
 
+do_install_append () {
+    sed -i 's#${RECIPE_SYSROOT}##'

${D}${libdir}/pkgconfig/libidn2.pc

meta/recipes-extended/libidn/libidn2_2.0.5.bb

Quoted 3 lines
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -0
+}
+
  BBCLASSEXTEND = "native nativesdk"

I have a strong dislike for editing .pc files after the fact. Part of the concern is sed expressions like this bitrot badly, its hard to tell if they still work as intended.

Quoted 2 lines

Is there not a way we can generate a correct .pc file in the first place even if that means a patch?

The buildpaths qa issue is caused by a patch to fix compile-host-path qa issue. But I could NOT reproduce compile-host-path issue when revert the patch. I'll turn Khem for some help to check whether could revert that patch.

commit e87b501659eecc22f48b3e3ca8cde6b4de9f663a
Author: Khem Raj <[email protected]>
Date:   Sun Aug 19 10:23:41 2018 -0700

    libidn2: Fix libunistring detection

    libunistring is one such library which many autotooled packages mistake to use from build system if its installed on it. This is specifically toxic when build host arch is same as target arch since we only see the problem during runtime but thankfully OE has build time QA which warns about it.

    QA Issue: libidn2: The compile log indicates that host include and/or library paths were used.

    Using --with-libunistring-prefix nudges the autoconf system for the component to first look into target sysroot before going on to search on the build host

    (From OE-Core rev: 9a4ea4ff856e2379888ea5cdcc0e761956e1f53b)

meta/recipes-extended/libidn/libidn2_2.0.5.bb +0 -0
index 0d7bddbc7f..0daf7a6877 100644
@@ -19,6 +19,10 @@ DEPENDS = "virtual/libiconv libunistring"
 

 inherit pkgconfig autotools gettext texinfo gtk-doc lib_package

+EXTRA_OECONF += "--disable-rpath \
+ --with-libunistring-prefix=${STAGING_EXECPREFIXDIR} \
+                 "
+
 LICENSE_${PN} = "(GPLv2+ | LGPLv3)" LICENSE_${PN}-bin = "GPLv3+"

Thanks.
Kai

Quoted 7 lines

Cheers,

Richard

Signature · 1 line
Kai Kang
#6 lore raw

PATCH 1/1 libidn2: fix buildpaths qa issue in .pc file

In reply to [email protected]

From: Kai Kang <[email protected]>

When enable buildpaths qa check, it show warning of libidn2:

| WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File /work/armv5e-poky-linux-gnueabi/libidn2/2.0.5-r0/packages-split/libidn2-dev/usr/lib/pkgconfig/libidn2.pc in package contained reference to tmpdir [buildpaths]

Fix the issue by substituting @LTLIBUNISTRING@ in the .pc file.

---
 .../fix-host-contamination-in-pc-file.patch   | 22 +++++++++++++++++++
 meta/recipes-extended/libidn/libidn2_2.0.5.bb |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/libidn/libidn2/fix-host-contamination-in-pc-file.patch
meta/recipes-extended/libidn/libidn2/fix-host-contamination-in-pc-file.patch new file +22 -0
new file mode 100644
index 0000000000..026312ab0a
@@ -0,0 +1,22 @@
+Configure option --with-libunistring-prefix is set to fix compile-host-path qa
+issue. It causes @LTLIBUNISTRING@ in line 'Libs.private' of libidn2.pc replaced
+with ${STAGING_EXECPREFIXDIR} which causes buildpaths qa issue.
+
+libunistring is a dependency of libidn2 and installs libraries to standard
+library path, so just substitute @LTLIBUNISTRING@ with standard library path
+and -lunistring in libidn2.pc.in.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+diff --git a/libidn2.pc.in b/libidn2.pc.in
+index 0dade23..24cc29d 100644
+--- a/libidn2.pc.in
++++ b/libidn2.pc.in
+@@ -8,4 +8,4 @@ Description: Library implementing IDNA2008 and TR46
+ Version: @PACKAGE_VERSION@
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -lidn2
+-Libs.private: @LTLIBICONV@ @LTLIBUNISTRING@
++Libs.private: @LTLIBICONV@ -L${libdir} -lunistring
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -1
index 0daf7a6877..a243a9181e 100644
@@ -11,7 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ab90e75ef97cc6318ce4f2fbda62fe4d \
 
 SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
            file://Unset-need_charset_alias-when-building-for-musl.patch \
-          "
+           file://fix-host-contamination-in-pc-file.patch \
+           "
 SRC_URI[md5sum] = "eaf9a5b9d03b0cce3760f34b3124eb36"
 SRC_URI[sha256sum] = "53f69170886f1fa6fa5b332439c7a77a7d22626a82ef17e2c1224858bb4ca2b8"
 
Signature · 1 line
2.20.0
author
#7 lore raw

Re: [PATCH v2] libidn2: fix buildpaths qa issue in .pc file

Quoted 9 lines · On 2019/2/19 下午2:57, [email protected] wrote:

From: Kai Kang <[email protected]>

When enable buildpaths qa check, it show warning of libidn2:

| WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File /work/armv5e-poky-linux-gnueabi/libidn2/2.0.5-r0/packages-split/libidn2-dev/usr/lib/pkgconfig/libidn2.pc in package contained reference to tmpdir [buildpaths]

Fix the issue by substituting @LTLIBUNISTRING@ in the .pc file.

Ping.

Quoted 50 lines
---
  .../fix-host-contamination-in-pc-file.patch   | 22 +++++++++++++++++++
  meta/recipes-extended/libidn/libidn2_2.0.5.bb |  3 ++-
  2 files changed, 24 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-extended/libidn/libidn2/fix-host-contamination-in-pc-file.patch

meta/recipes-extended/libidn/libidn2/fix-host-contamination-in-pc-file.patch new file +22 -0
new file mode 100644
index 0000000000..026312ab0a
@@ -0,0 +1,22 @@
+Configure option --with-libunistring-prefix is set to fix compile-host-path qa
+issue. It causes @LTLIBUNISTRING@ in line 'Libs.private' of libidn2.pc replaced
+with ${STAGING_EXECPREFIXDIR} which causes buildpaths qa issue.
+
+libunistring is a dependency of libidn2 and installs libraries to standard
+library path, so just substitute @LTLIBUNISTRING@ with standard library path
+and -lunistring in libidn2.pc.in.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+diff --git a/libidn2.pc.in b/libidn2.pc.in
+index 0dade23..24cc29d 100644
+--- a/libidn2.pc.in
++++ b/libidn2.pc.in
+@@ -8,4 +8,4 @@ Description: Library implementing IDNA2008 and TR46
+ Version: @PACKAGE_VERSION@
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -lidn2
+-Libs.private: @LTLIBICONV@ @LTLIBUNISTRING@
++Libs.private: @LTLIBICONV@ -L${libdir} -lunistring
meta/recipes-extended/libidn/libidn2_2.0.5.bb +2 -1
index 0daf7a6877..a243a9181e 100644
@@ -11,7 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ab90e75ef97cc6318ce4f2fbda62fe4d \
 
  SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
             file://Unset-need_charset_alias-when-building-for-musl.patch \
-          "
+           file://fix-host-contamination-in-pc-file.patch \
+           "
  SRC_URI[md5sum] = "eaf9a5b9d03b0cce3760f34b3124eb36"
  SRC_URI[sha256sum] = "53f69170886f1fa6fa5b332439c7a77a7d22626a82ef17e2c1224858bb4ca2b8"
 
Signature · 1 line
Kai Kang
#8 lore raw

PATCH v2 4/4 openssl: update patch to fix buildpaths qa issue for -fmacro-prefix-map

In reply to [email protected]

From: Kai Kang <[email protected]>

Gcc option '-fmacro-prefix-map' is added to DEBUG_PREFIX_MAP. It has a patch to deal option '-fdebug-prefix-map' already. Update the patch 0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch to fix buildpaths qa issue for '-fmacro-prefix-map' too.

---
 ...dinfo-strip-sysroot-and-debug-prefix-map-from-co.patch | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +7 -1
index 80b62ab18c..949c788344 100644
@@ -20,6 +20,11 @@ https://patchwork.openembedded.org/patch/147229/
 
 Upstream-Status: Inappropriate [OE specific]
 Signed-off-by: Martin Hundebøll <[email protected]>
+
+
+Update to fix buildpaths qa issue for '-fmacro-prefix-map'.
+
+Signed-off-by: Kai Kang <[email protected]>
 ---
  Configurations/unix-Makefile.tmpl | 10 +++++++++-
  crypto/build.info                 |  2 +-
@@ -29,7 +34,7 @@ diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tm
 index 16af4d2087..54c162784c 100644
 --- a/Configurations/unix-Makefile.tmpl
 +++ b/Configurations/unix-Makefile.tmpl
-@@ -317,13 +317,21 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
+@@ -317,13 +317,22 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
                           '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
  BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
  
@@ -43,6 +48,7 @@ index 16af4d2087..54c162784c 100644
  
 +CFLAGS_Q={- for (@{$config{CFLAGS}}) {
 +              s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g;
++              s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g;
 +            }
 +            join(' ', @{$config{CFLAGS}}) -}
 +
Signature · 1 line
2.20.0