From patchwork Mon Jan 27 08:54:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 56142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E98FC0218F for ; Mon, 27 Jan 2025 08:54:49 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.web11.47416.1737968082530720252 for ; Mon, 27 Jan 2025 00:54:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aD3PwCRi; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: martin.jansa@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-ab2b29dfc65so669263866b.1 for ; Mon, 27 Jan 2025 00:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737968081; x=1738572881; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SdxxLRSUsILSxyTCV8RmdqQS/RcPmsciQap9rHqjF7c=; b=aD3PwCRihiZdELWvszDJy/zUiDhoVKFT3TgdymFoSrCL3770r1s1OTeZwwWgKaCnaR cdcox6Oa0qMW6US+SP4sEqS0KO79WvfYNnku+l6rB8uPAET3NBQRBnZnuR2PzAAuLG7O 0ulq7F84B1WAYE9syBqJDBzNs7GozBmaRwdjUNhSk3JfOWj0OwDak40rIYLKT6o8mUUA uxSlo0jS2qjJL9NpuOT84snF4gT8NDwi81jjIF6B1JBuXd2gqz8mkhLDMT7RuXUBJu/Z bDV1RQ9FDmut6Qnrv5K8O1Jq6JHUxv7Dj/BOu/a7uwwOXjnNhPVU3vgNN2pWorC+jtuv hPhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737968081; x=1738572881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SdxxLRSUsILSxyTCV8RmdqQS/RcPmsciQap9rHqjF7c=; b=X8NluX85GHWY4bPfcNJ8AdC6Q+3K19oUdP16vJqNsncnd3UMu3YIlpC5TH+UU5lS5J EUCZvgf/2xuDq2nI5ed6qEZM4Dnr+OtYGJMj8egyIDJlFhZFzVIrz5gu09z32gpBQEdz YUuJl1O538GUpnfnb/izosm3hzdtXahTNyDkZruVeNupLUmouTKhfZkt4CGpouYCjaeQ RoqNjtXiF3r16L8qgYdhgGGGzSrhgvteu6MFj6HYBqUh38rV7rVunkum2uUPb/tPqDSx rEY7OZT+P1UlPgsh0NcX7COe4q/0e9EL8ESZH+RrM3GmD8FInqV1fAEuNF8OrpOKpI7V a05A== X-Gm-Message-State: AOJu0YyszJdif9wBBqNCvvPkiO9BNINBYC62Gld3S6bB+HcCeMiq6X+A iRq00B8a3QoDgkm+0H0zzO68ieRH5bHWUllganSgMr5i8g59YSdaYNq+1Q== X-Gm-Gg: ASbGncskmJTtSIz9SJsJSYq7iJqpYY0L9jbSRgECChVSkup9a85/tzpNVOMtaDO44vV k50AGJhe+SYZ2moBU5GnL+y/nYYYaF5lvLJcxV9ov9WjuINdxqgZXfYOEWXMwT13DXJnE/bbTDI tYSwDbPNZMHTEPjTXbGoZN0FBefyBu15+MDox7t7rSpyX64bZ+RsUwDsjf0BX9tPbHEhf6lD7CG 1Eq462pETJ6VSc9e4Ht257SurBwB9Hx3EJLyo5H3sd3xXjsaixrS+Iz4XIrrjASLgYCyr6GThnF C/IDJs9pYGGq/EZwo8XcxDe+G90hIQzPuWIRAg== X-Google-Smtp-Source: AGHT+IEzKuxwPeiWMZEV6vKOO7JkZ0TlT/VcGPlKQ8L38Rk6DFFsJD8Zn7Q4vB3RwnG1BN656nRkrg== X-Received: by 2002:a17:907:706:b0:ab3:2b9a:4a5a with SMTP id a640c23a62f3a-ab38b3c6a1emr4277631666b.51.1737968080598; Mon, 27 Jan 2025 00:54:40 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-ab676116b23sm552406666b.178.2025.01.27.00.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 00:54:40 -0800 (PST) From: Martin Jansa To: openembedded-devel@lists.openembedded.org Cc: akuster808@gmail.com, Zhang Peng , Khem Raj Subject: [meta-oe][scarthgap][PATCH 1/3] lapack: fix TMPDIR reference in do_package_qa Date: Mon, 27 Jan 2025 09:54:35 +0100 Message-ID: <20250127085437.54643-1-martin.jansa@gmail.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 27 Jan 2025 08:54:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/115106 From: Zhang Peng 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 /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 Signed-off-by: Khem Raj --- .../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 \