From: Armin Kuster <akuster808@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Zhang Peng <peng.zhang1.cn@windriver.com>, Khem Raj <raj.khem@gmail.com>
Subject: [meta-oe][styhead][PATCH 06/14] lapack: fix TMPDIR reference in do_package_qa
Date: Sat, 25 Jan 2025 10:03:00 -0800 [thread overview]
Message-ID: <20250125180308.7856-6-akuster808@gmail.com> (raw)
In-Reply-To: <20250125180308.7856-1-akuster808@gmail.com>
From: Zhang Peng <peng.zhang1.cn@windriver.com>
When building the `lapack` package, the following QA error occurs:
"File /usr/lib64/libblas.so.3.12.0 in package lapack contains reference to TMPDIR [buildpaths]"
The issue arises because the `xerbla.o` object file embeds the absolute host path of `xerbla.f`.
This occurs during compilation, where the build command in `build.make` (generated by CMake) specifies:
`gfortran -c <absolute path>/xerbla.f -o`.
As a result, the absolute path is included in `xerbla.o`. Unfortunately, `gfortran` does not support
flags like `-fdebug-prefix-map` or `-ffile-prefix-map` to remove such paths.
To resolve this, the fix involves replacing the absolute path of `xerbla.f` in the generated
`build.make` file with a relative path before the compilation step. This ensures that the
resulting `xerbla.o` does not contain any references to TMPDIR, passing the `do_package_qa` check.
For ptest code, the solution is to replace `${WORKDIR}` with `../../..` in the generated `build.make`
files located in the TESTING directory.
Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit b617496fb08950c155e75c8f21bafb10e301095c)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
.../recipes-devtools/lapack/lapack_3.12.0.bb | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb b/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb
index fef9d3a80e..4357515b71 100644
--- a/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb
+++ b/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb
@@ -33,6 +33,37 @@ OECMAKE_GENERATOR = "Unix Makefiles"
inherit cmake pkgconfig ptest
EXCLUDE_FROM_WORLD = "1"
+# The `xerbla.o` file contains an absolute path in `xerbla.f.o`, but the options
+# `-fdebug-prefix-map` and `-ffile-prefix-map` cannot be used because gfortran does not support them.
+# To address this issue, we manually replace the absolute path with a relative path
+# in the generated `build.make` file.
+#
+# An issue has been reported: https://github.com/Reference-LAPACK/lapack/issues/1087,
+# requesting a fix in the source code.
+#
+# This workaround resolves the TMPDIR [buildpaths] issue by converting the absolute path
+# of `xerbla.f` to a relative path. The steps are as follows:
+#
+# 1. Locate all `build.make` files after the `do_configure` step is completed.
+# 2. Compute the relative path for `xerbla.f` based on the current build directory.
+# 3. Replace the absolute path with the calculated relative path in the `build.make` files
+#
+# Additionally, when ptests are enabled, apply a simpler workaround for ptest code:
+# - Replace occurrences of `${WORKDIR}` in all `build.make` files under the TESTING directory, excluding
+# the MATGEN subdirectory, with a relative path prefix of `"../../.."`.
+do_configure:append(){
+ for file in `find ${B} -name build.make`; do
+ sed -i -e "s#\(.*-c \).*\(/xerbla\.f \)#\1$(grep '\-c .*xerbla\.f' $file | awk -F'cd ' '{print $2}'| \
+ awk '{src=$1; sub(/.*-c /, ""); sub(/xerbla\.f.*/, ""); obj=$0; print src, obj}' | \
+ while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file
+ done
+ if (${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)});then
+ for file in `find . -name build.make -path '*TESTING*' -not -path '*MATGEN*'`; do
+ sed -i -e "s#\(.*-c \)\(${WORKDIR}\)\(.*.[f|F] \)#\1../../..\3#g" $file
+ done
+ fi
+}
+
do_install_ptest () {
rsync -a ${B}/TESTING ${D}${PTEST_PATH} \
--exclude CMakeFiles \
--
2.43.0
next prev parent reply other threads:[~2025-01-25 18:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 18:02 [meta-oe][styhead][PATCH 01/14] gphoto2: Fix /usr/bin/gphoto2 runtime error Armin Kuster
2025-01-25 18:02 ` [meta-oe][styhead][PATCH 02/14] mpd: Upgrade mpd to 0.23.16 Armin Kuster
2025-01-25 18:02 ` [meta-oe][styhead][PATCH 03/14] libtinyxml: set CVE product to tinyxml Armin Kuster
2025-01-25 18:02 ` [meta-oe][styhead][PATCH 04/14] libtinyxml: patch CVE-2021-42260 Armin Kuster
2025-01-25 18:02 ` [meta-oe][styhead][PATCH 05/14] libtinyxml: patch CVE-2023-34194 Armin Kuster
2025-01-25 18:03 ` Armin Kuster [this message]
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 07/14] libtinyxml2: set CVE product to tinyxml2 Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 08/14] procmail: patch CVE-2014-3618 Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 09/14] procmail: patch CVE-2017-16844 Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 10/14] audiofile: fix multiple CVEs Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 11/14] audiofile: patch CVE-2017-6829 Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 12/14] audiofile: fix multiple CVEs Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 13/14] audiofile: patch CVE-2017-6831 Armin Kuster
2025-01-25 18:03 ` [meta-oe][styhead][PATCH 14/14] audiofile: patch CVE-2017-6839 Armin Kuster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250125180308.7856-6-akuster808@gmail.com \
--to=akuster808@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
--cc=peng.zhang1.cn@windriver.com \
--cc=raj.khem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.