From patchwork Sat Dec 4 21:29:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kroon X-Patchwork-Id: 652 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 7FC7BC433EF for ; Sat, 4 Dec 2021 21:30:22 +0000 (UTC) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web10.30349.1638653421046651254 for ; Sat, 04 Dec 2021 13:30:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tdp8OZO4; spf=pass (domain: gmail.com, ip: 209.85.208.171, mailfrom: jacob.kroon@gmail.com) Received: by mail-lj1-f171.google.com with SMTP id 13so13115654ljj.11 for ; Sat, 04 Dec 2021 13:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NJSfTQp578j79O9Ad2DYbbb3UJ6f9gKVAx8QFVR/cOw=; b=Tdp8OZO4BIMlF0duIbWKE7Add4U6SAbOpVGIBFpDUF0F8c0snx6fRsI0EiDs0HlB6A zUiI/RexlGL+5PECYLo4nhEMyh46qENSDs/fyHxvtftFwULATYAbqJGs3DDYzgFvnEzM XjyO4Mv56fM+BTESsx6tATO8z7FJLsJamz1lGzydizrCrwNIepEhO2bYYE0SQUYi9y/C KNt7X1UxtIb8XFXtzdboe6BufpPE+UunGWEH6OjqCmPrcXAXsJvX6DNRoD/WEQQOFFyk MreBWmoEaWcOvUVRxprl47XvNRQ5vD6yk8Qe9WLZ3obF8aik1xxX6o05LBDSRTrvV72f OQ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NJSfTQp578j79O9Ad2DYbbb3UJ6f9gKVAx8QFVR/cOw=; b=BU1lN7EefG47yT5zwh2QwtAJuKyW2YyAKcG/h3iBwKJTEWZ3u8DTBcmcWK5rWpALvx m1NSSdGl44zLbV8fkXxGyMCApSrTQvIR7CGmikuwxx6dzSMhbCzMrFyFcJIg/+LS2TOn wHDbN089EsfpJr0bJTWGZgDmatfJXmmgPjvO8SkodfUvc+kFt6y28/U2Qsl7PcXSC+2B LHDsUY2gvu1rvI9Sr1SvkFBumkik2dz84I9P3+BYFwnRqa3XWZLN6IIBph2f0IlpneWs QLebhFMSeZd2cZxQ/PKSDp5ud+ExOaR4U6HiivdQgaUBmfAEQn0fQk+T9yUFLgoc0Ie4 CbGg== X-Gm-Message-State: AOAM531mAquydYck0+YXN954hA/pL4RQvbQ8zVN1hXxGRkguYYLreL6V YWqbDnsABjLaNeieCzYVriBSFKLQR+hpVg== X-Google-Smtp-Source: ABdhPJw6eI3xKo1xoRr6VNrEX52yOamG4iubZg8Zd44PF4mL4pZp3Rmj3AKrN5eJsi/AIvW3eCRUoA== X-Received: by 2002:a05:651c:1b0:: with SMTP id c16mr25477309ljn.339.1638653419449; Sat, 04 Dec 2021 13:30:19 -0800 (PST) Received: from localhost.localdomain (37-247-29-68.customers.ownit.se. [37.247.29.68]) by smtp.gmail.com with ESMTPSA id p3sm874262lfh.124.2021.12.04.13.30.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 13:30:19 -0800 (PST) From: Jacob Kroon To: openembedded-core@lists.openembedded.org Subject: [RFC PATCH v3 1/4] kernel: Pass rpaths in BUILD_LDFLAGS Date: Sat, 4 Dec 2021 22:29:37 +0100 Message-Id: <20211204212940.3787349-2-jacob.kroon@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211204212940.3787349-1-jacob.kroon@gmail.com> References: <20211204212940.3787349-1-jacob.kroon@gmail.com> 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 ; Sat, 04 Dec 2021 21:30:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/159182 Building the kernel involves building native tools that are run during the kernel build itself. One of the upcoming patches removes ${STAGING_LIBDIR_NATIVE} and ${STAGING_BASE_LIBDIR_NATIVE} from the rpath, so pass them here so that the kernel tools can continue to run. Signed-off-by: Jacob Kroon --- meta/classes/kernel.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 2d219cb5e5..aae3fc887e 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -228,6 +228,7 @@ KERNEL_EXTRA_ARGS ?= "" EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"" +BUILD_LDFLAGS += "-Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}" KERNEL_ALT_IMAGETYPE ??= "" From patchwork Sat Dec 4 21:29:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kroon X-Patchwork-Id: 653 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 7ECBBC433EF for ; Sat, 4 Dec 2021 21:30:25 +0000 (UTC) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web09.30140.1638653424332914200 for ; Sat, 04 Dec 2021 13:30:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HV1DCInK; spf=pass (domain: gmail.com, ip: 209.85.167.43, mailfrom: jacob.kroon@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id m27so15264704lfj.12 for ; Sat, 04 Dec 2021 13:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=80ebvRFEKUNyu8oaYCykhqwo7lwSTXnIavSShEa7+QE=; b=HV1DCInK6kAis9+Jh/IvS601eXjnc8Yr3Um5eg0a/hJ2SwraJN1y9eHiHjPE/9SdmW 68DvoCrXk4xQBp7kZkopfXQh4hERemGjIm7R8jyVkSBJg9QqvFKQfh8JB0iGlIKVyTrC 9dJMHMmOEDnicfSYtc8ff7J90L4WNzJ7JyMqxwBhZxGA0D9q9wDXS+xb7TPFOB08h1W2 SxfTUFwjRlHRhByn42sFyxMWcSngu1NFux/mFw85Th4xcM/0zmtfmDzgkUVPN66r9Q7c K4BU9TOfM7dmafBBWWgTp/tVv6qXEknHQghcnWQtTTXr++Aahu8FWeaEj+JMIn1VjWQ0 MNKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=80ebvRFEKUNyu8oaYCykhqwo7lwSTXnIavSShEa7+QE=; b=m7wSm1/t/jGVl3GvN1ikYa/UPuopMDKdHtxBCB2VidQuQnXcRe4cyksY3gWI5ngCJ0 uvUzRuWhQKx5nRHagmzG7RvsrX7bW021pTAZisMHIEFh+cyQNNhS5N86/qaTZeQORg8e oDamfurZkxR2UBGMMb5/FUiee1TzPHmCWAtk/l40ovMXg+fBMLm2+RzydCw8sjLAPo5h rTajkSqt18UFmVI9cIQDmiWY7jGC18Q1lkqkWEO2XW9s0/XFysS5EgcuQ0xXX9MfK42C S6UoI4WYpLC0D9yXP2vkB8K1EvgyRrSyGyb58gZbb1Vmp1X8XwcrZMKUDZ+25lErodrU 810w== X-Gm-Message-State: AOAM533WV03BKgdBFZ9Ezm3HkgMRIaDPkR/QyVmaWcjRO+COrIsB0xbg 9Oj2A0MmuWAZ2jPohTTyTqnnlpnDoNgp/w== X-Google-Smtp-Source: ABdhPJzXIQBDTc57TVZTyCcorMTJkWsowjN0kr7n0Cz3NkT6DAPvk6WhqYb8x2YO23cssPSjiFD7Sg== X-Received: by 2002:a05:6512:159d:: with SMTP id bp29mr25033218lfb.257.1638653422175; Sat, 04 Dec 2021 13:30:22 -0800 (PST) Received: from localhost.localdomain (37-247-29-68.customers.ownit.se. [37.247.29.68]) by smtp.gmail.com with ESMTPSA id p3sm874262lfh.124.2021.12.04.13.30.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 13:30:21 -0800 (PST) From: Jacob Kroon To: openembedded-core@lists.openembedded.org Subject: [RFC PATCH v3 2/4] python3-native: Skip testing import of modules Date: Sat, 4 Dec 2021 22:29:38 +0100 Message-Id: <20211204212940.3787349-3-jacob.kroon@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211204212940.3787349-1-jacob.kroon@gmail.com> References: <20211204212940.3787349-1-jacob.kroon@gmail.com> 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 ; Sat, 04 Dec 2021 21:30:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/159183 Building python3-native involves running the resulting native binary as part of a test to import the built modules. If this fails the modules will be renamed with an appended "failed" suffix. One of the upcoming patches removes ${STAGING_LIBDIR_NATIVE} and ${STAGING_BASE_LIBDIR_NATIVE} from the rpath, which means this step will fail. Patch python3 not to perform the import test, so that the modules won't end up with invalid names. Signed-off-by: Jacob Kroon --- .../python/python3/no-import-test.patch | 14 ++++++++++++++ meta/recipes-devtools/python/python3_3.10.0.bb | 1 + 2 files changed, 15 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/no-import-test.patch diff --git a/meta/recipes-devtools/python/python3/no-import-test.patch b/meta/recipes-devtools/python/python3/no-import-test.patch new file mode 100644 index 0000000000..d944e55cc5 --- /dev/null +++ b/meta/recipes-devtools/python/python3/no-import-test.patch @@ -0,0 +1,14 @@ +Index: Python-3.10.0/setup.py +=================================================================== +--- Python-3.10.0.orig/setup.py ++++ Python-3.10.0/setup.py +@@ -644,6 +644,9 @@ class PyBuildExt(build_ext): + if CROSS_COMPILING: + return + ++ # Skip import test ++ return ++ + loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename) + spec = importlib.util.spec_from_file_location(ext.name, ext_filename, + loader=loader) diff --git a/meta/recipes-devtools/python/python3_3.10.0.bb b/meta/recipes-devtools/python/python3_3.10.0.bb index e3300b6495..c9f21b5e16 100644 --- a/meta/recipes-devtools/python/python3_3.10.0.bb +++ b/meta/recipes-devtools/python/python3_3.10.0.bb @@ -40,6 +40,7 @@ SRC_URI:append:class-native = " \ file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ file://12-distutils-prefix-is-inside-staging-area.patch \ file://0001-Don-t-search-system-for-headers-libraries.patch \ + file://no-import-test.patch \ " SRC_URI[sha256sum] = "5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002" From patchwork Sat Dec 4 21:29:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kroon X-Patchwork-Id: 654 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 96DA3C433EF for ; Sat, 4 Dec 2021 21:30:28 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web09.30141.1638653427255145543 for ; Sat, 04 Dec 2021 13:30:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kbv1jJ1P; spf=pass (domain: gmail.com, ip: 209.85.167.48, mailfrom: jacob.kroon@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id r26so15352458lfn.8 for ; Sat, 04 Dec 2021 13:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5tqgAHScgGTkTrk9Gr9nMFvoGlCH0PY/sdx9UXjLCDU=; b=kbv1jJ1PM3P/LW5c7bHPfqWJ+9VH1o3xkEc31GLdybZQSNXgPWtfikCOCqxx+iKd4e CosZYCr2j1D2Zkymje8o4NwbPO5FhRyafdv3EoxK6NsvRoDMOy5Io0aZpuvC0rs/TwSj NM/gePWtNHqHdxrv4qnZC9OosjrUjys1NM+UXsWIcs2U4SrxXlqMv4nHGeKdJurpWcqp aS0nQXsqikCWaTvr93cblwbzibE2IYlVlLrb2TbnOmbv3C+Q7bKPsUWwOESOhusNmTE9 7zNehemIvBf7P/xaYlkKsT7iYERaQ42p4jUUkWFimF/6qbrxK2P4kNRXuehrSh/ZRmx1 +AoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5tqgAHScgGTkTrk9Gr9nMFvoGlCH0PY/sdx9UXjLCDU=; b=bik0PoyIXvKpY1jL6b4Ofo9730N8PJ8jfDXaPD6ymn8nphq9wCiB5fw74bmOS15tte QGhQMhnXKV8yIm2/DsietcQmdGTw3lvRF+l6IKDQ86dNS7w1tI2gJFY7ZQrKLre571Qn cytn5MewlBJ1iQ4gQBIjSLKoye4PRjTJvurm0w8SnI4HAP8fzjmjKvIaeb42aeQXeM9e FP7+671EP4G9GNXgm/d6DyHR3lSLkRSCu0jdmTc+wVn6w7Vqf45pvpjIb0EAf3P0Jy30 NlWbSVLcZ7bKjWT0I42oj6V0gYk7u56W4C5M4GvWuiALbPR+rmN4ebq7eB4yEe+697YH 2W7A== X-Gm-Message-State: AOAM5309bmkjMCcfGKb+b6P7++/6ojdVZdTOOBkcPEd2Ne9vp+juXZif Ktv0tjk+kCZFb7BWyqqWGjeWlgsnNfaMQA== X-Google-Smtp-Source: ABdhPJyZ14SnmAJrkB8o+jHl/pntf+dhOltsEgHS3MMbQjYvnsb3BXYqTxTvW0F2XnhyG9AEyphQPA== X-Received: by 2002:ac2:4e70:: with SMTP id y16mr23822389lfs.436.1638653425253; Sat, 04 Dec 2021 13:30:25 -0800 (PST) Received: from localhost.localdomain (37-247-29-68.customers.ownit.se. [37.247.29.68]) by smtp.gmail.com with ESMTPSA id p3sm874262lfh.124.2021.12.04.13.30.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 13:30:24 -0800 (PST) From: Jacob Kroon To: openembedded-core@lists.openembedded.org Subject: [RFC PATCH v3 3/4] bitbake.conf: Use dummy rpaths in native binaries Date: Sat, 4 Dec 2021 22:29:39 +0100 Message-Id: <20211204212940.3787349-4-jacob.kroon@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211204212940.3787349-1-jacob.kroon@gmail.com> References: <20211204212940.3787349-1-jacob.kroon@gmail.com> 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 ; Sat, 04 Dec 2021 21:30:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/159184 Try to make sure that the RUNTIME dynamic entry size is the same for all binaries produced with the native compiler. This is necessary in order to produce identical binaries when using differently sized buildpaths. This is a first step for producing identical native binaries when using different build paths. 'zstd-native' is a working example. Signed-off-by: Jacob Kroon --- meta/classes/chrpath.bbclass | 5 ++++- meta/conf/bitbake.conf | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass index 26b984c4db..a0f2cf0598 100644 --- a/meta/classes/chrpath.bbclass +++ b/meta/classes/chrpath.bbclass @@ -2,7 +2,7 @@ CHRPATH_BIN ?= "chrpath" PREPROCESS_RELOCATE_DIRS ?= "" def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlinks = False): - import subprocess, oe.qa + import subprocess, oe.qa, re with oe.qa.ELFFile(fpath) as elf: try: @@ -20,6 +20,9 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlin # Throw away everything other than the rpath list curr_rpath = out.partition("RPATH=")[2] #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip())) + # Inject native libdir and baselibdir + curr_rpath = re.sub(r'/non/existent/libdir-native-marker-x+', d.expand('${STAGING_LIBDIR_NATIVE}'), curr_rpath) + curr_rpath = re.sub(r'/non/existent/base-libdir-native-marker-x+', d.expand('${STAGING_BASE_LIBDIR_NATIVE}'), curr_rpath) rpaths = curr_rpath.strip().split(":") new_rpaths = [] modified = False diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index fba99e8f0c..1799127c2a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -585,8 +585,8 @@ export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \ -Wl,--enable-new-dtags \ -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \ -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \ - -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \ - -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \ + -Wl,-rpath,${@'/non/existent/libdir-native-marker-'.ljust(256, 'x')} \ + -Wl,-rpath,${@'/non/existent/base-libdir-native-marker-'.ljust(256, 'x')} \ -Wl,-O1" BUILDSDK_LDFLAGS = "-Wl,-O1" From patchwork Sat Dec 4 21:29:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacob Kroon X-Patchwork-Id: 14107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Jacob Kroon" Subject: [RFC PATCH v3 4/4] Improve native reproducibility in recipes Date: Sat, 4 Dec 2021 22:29:40 +0100 Message-Id: <20211204212940.3787349-5-jacob.kroon@gmail.com> In-Reply-To: <20211204212940.3787349-1-jacob.kroon@gmail.com> References: <20211204212940.3787349-1-jacob.kroon@gmail.com> MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org Avoid encoding build-specific paths in the resulting binaries. Signed-off-by: Jacob Kroon --- ...sysroot-and-debug-prefix-map-from-co.patch | 78 ------------------- .../openssl/openssl/strip-buildinfo.patch | 13 ++++ .../openssl/openssl_3.0.0.bb | 10 +-- meta/recipes-core/ncurses/ncurses.inc | 4 + .../util-linux/util-linux_2.37.2.bb | 2 +- .../libtool/libtool-native_2.4.6.bb | 1 + ...ism.patch => perl-cross-determinism.patch} | 0 .../perl-cross/perlcross_1.3.6.bb | 4 +- meta/recipes-devtools/perl/perl_5.34.0.bb | 3 + .../pkgconfig/pkgconfig_git.bb | 1 + .../python/python3/determinism.patch | 15 ++++ .../recipes-devtools/python/python3_3.10.0.bb | 8 ++ 12 files changed, 53 insertions(+), 86 deletions(-) delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/strip-buildinfo.patch rename meta/recipes-devtools/perl-cross/files/{determinism.patch => perl-cross-determinism.patch} (100%) create mode 100644 meta/recipes-devtools/python/python3/determinism.patch diff --git a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch b/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch deleted file mode 100644 index 60890c666d..0000000000 --- a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= -Date: Tue, 6 Nov 2018 14:50:47 +0100 -Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler - info -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The openssl build system generates buildinf.h containing the full -compiler command line used to compile objects. This breaks -reproducibility, as the compile command is baked into libcrypto, where -it is used when running `openssl version -f`. - -Add stripped build variables for the compiler and cflags lines, and use -those when generating buildinfo.h. - -This is based on a similar patch for older openssl versions: -https://patchwork.openembedded.org/patch/147229/ - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Martin Hundebøll - -Update to fix buildpaths qa issue for '-fmacro-prefix-map'. - -Signed-off-by: Kai Kang - -Update to fix buildpaths qa issue for '-ffile-prefix-map'. - -Signed-off-by: Khem Raj - ---- - Configurations/unix-Makefile.tmpl | 12 +++++++++++- - crypto/build.info | 2 +- - 2 files changed, 12 insertions(+), 2 deletions(-) - -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index f88a70f..528cdef 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -471,13 +471,23 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), - '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} - BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) - --# CPPFLAGS_Q is used for one thing only: to build up buildinf.h -+# *_Q variables are used for one thing only: to build up buildinf.h - CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; - $cppflags2 =~ s|([\\"])|\\$1|g; - $lib_cppflags =~ s|([\\"])|\\$1|g; - join(' ', $lib_cppflags || (), $cppflags2 || (), - $cppflags1 || ()) -} - -+CFLAGS_Q={- for (@{$config{CFLAGS}}) { -+ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g; -+ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g; -+ s|-ffile-prefix-map=[^ ]+|-ffile-prefix-map=|g; -+ } -+ join(' ', @{$config{CFLAGS}}) -} -+ -+CC_Q={- $config{CC} =~ s|--sysroot=[^ ]+|--sysroot=recipe-sysroot|g; -+ join(' ', $config{CC}) -} -+ - PERLASM_SCHEME= {- $target{perlasm_scheme} -} - - # For x86 assembler: Set PROCESSOR to 386 if you want to support -diff --git a/crypto/build.info b/crypto/build.info -index efca6cc..eda433e 100644 ---- a/crypto/build.info -+++ b/crypto/build.info -@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF - - DEPEND[info.o]=buildinf.h - DEPEND[cversion.o]=buildinf.h --GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" -+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC_Q) $(CFLAGS_Q) $(CPPFLAGS_Q)" "$(PLATFORM)" - - GENERATE[uplink-x86.s]=../ms/uplink-x86.pl - GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl diff --git a/meta/recipes-connectivity/openssl/openssl/strip-buildinfo.patch b/meta/recipes-connectivity/openssl/openssl/strip-buildinfo.patch new file mode 100644 index 0000000000..0a4a60273d --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/strip-buildinfo.patch @@ -0,0 +1,13 @@ +Index: openssl-3.0.0/crypto/build.info +=================================================================== +--- openssl-3.0.0.orig/crypto/build.info ++++ openssl-3.0.0/crypto/build.info +@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF + + DEPEND[info.o]=buildinf.h + DEPEND[cversion.o]=buildinf.h +-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" ++GENERATE[buildinf.h]=../util/mkbuildinf.pl "empty" + + GENERATE[uplink-x86.s]=../ms/uplink-x86.pl + GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl diff --git a/meta/recipes-connectivity/openssl/openssl_3.0.0.bb b/meta/recipes-connectivity/openssl/openssl_3.0.0.bb index 4b1ae71a85..5237e12c7a 100644 --- a/meta/recipes-connectivity/openssl/openssl_3.0.0.bb +++ b/meta/recipes-connectivity/openssl/openssl_3.0.0.bb @@ -9,11 +9,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c75985e733726beaba57bc5253e96d04" SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ - file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://afalg.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ file://armv8-32bit.patch \ file://0001-Fix-EVP_PKEY_CTX_get_rsa_pss_saltlen-no.patch \ + file://strip-buildinfo.patch \ " SRC_URI:append:class-nativesdk = " \ @@ -47,10 +47,6 @@ EXTRA_OECONF:append:libc-musl:powerpc64 = " no-asm" EXTRA_OECONF:class-native = "--with-rand-seed=os,devrandom" EXTRA_OECONF:class-nativesdk = "--with-rand-seed=os,devrandom" -# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -CFLAGS:append:class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" -CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" - # This allows disabling deprecated or undesirable crypto algorithms. # The default is to trust upstream choices. DEPRECATED_CRYPTO_FLAGS ?= "" @@ -132,6 +128,10 @@ do_configure () { perl ${B}/configdata.pm --dump } +do_compile:class-native () { + oe_runmake OPENSSLDIR=/non/existent ENGINESDIR=/non/existent MODULESDIR=/non/existent +} + do_install () { oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc index a0ecd8a80b..3c15498dd4 100644 --- a/meta/recipes-core/ncurses/ncurses.inc +++ b/meta/recipes-core/ncurses/ncurses.inc @@ -91,10 +91,14 @@ ncurses_configure() { --with-manpage-format=normal \ --without-manpage-renames \ --disable-stripping \ + ${EXTRA_CLASS_FLAGS} \ "$@" || return 1 cd .. } +EXTRA_CLASS_FLAGS = "" +EXTRA_CLASS_FLAGS:class-native = "--datadir=/non/existent --with-terminfo-dirs=/non/existent" + # Override the function from the autotools class; ncurses requires a # patched autoconf213 to generate the configure script. This autoconf # is not available so that the shipped script will be used. diff --git a/meta/recipes-core/util-linux/util-linux_2.37.2.bb b/meta/recipes-core/util-linux/util-linux_2.37.2.bb index d609c30067..09f83eb4dd 100644 --- a/meta/recipes-core/util-linux/util-linux_2.37.2.bb +++ b/meta/recipes-core/util-linux/util-linux_2.37.2.bb @@ -83,7 +83,7 @@ EXTRA_OECONF = "\ " EXTRA_OECONF:append:class-target = " --enable-setpriv" -EXTRA_OECONF:append:class-native = " --without-cap-ng --disable-setpriv" +EXTRA_OECONF:append:class-native = " --without-cap-ng --disable-setpriv --runstatedir=/non/existent SYSCONFSTATICDIR=/non/existent" EXTRA_OECONF:append:class-nativesdk = " --without-cap-ng --disable-setpriv" EXTRA_OECONF:append = " --disable-hwclock-gplv3" diff --git a/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb b/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb index 3b20ce3e69..ea19b86d4a 100644 --- a/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb +++ b/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb @@ -7,6 +7,7 @@ SRC_URI += "file://prefix.patch" inherit native EXTRA_OECONF = " --with-libtool-sysroot=${STAGING_DIR_NATIVE}" +CACHED_CONFIGUREVARS += "lt_cv_sys_dlsearch_path=/non/existent" do_configure:prepend () { # Remove any existing libtool m4 since old stale versions would break diff --git a/meta/recipes-devtools/perl-cross/files/determinism.patch b/meta/recipes-devtools/perl-cross/files/perl-cross-determinism.patch similarity index 100% rename from meta/recipes-devtools/perl-cross/files/determinism.patch rename to meta/recipes-devtools/perl-cross/files/perl-cross-determinism.patch diff --git a/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb b/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb index 2759ef8a53..dab7f4558f 100644 --- a/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb +++ b/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb @@ -15,7 +15,7 @@ SRC_URI = "https://github.com/arsv/perl-cross/releases/download/${PV}/perl-cross file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \ file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \ file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ - file://determinism.patch \ + file://perl-cross-determinism.patch \ file://0001-cnf-configure_func_sel.sh-disable-thread_safe_nl_lan.patch \ file://0001-Makefile-check-the-file-if-patched-or-not.patch \ " @@ -33,7 +33,7 @@ do_compile () { do_install:class-native() { mkdir -p ${D}/${datadir}/perl-cross/ - cp -rf ${S}/* ${D}/${datadir}/perl-cross/ + cp -rfL ${S}/* ${D}/${datadir}/perl-cross/ } BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/perl/perl_5.34.0.bb b/meta/recipes-devtools/perl/perl_5.34.0.bb index 16d45ccff3..7eeb2393a2 100644 --- a/meta/recipes-devtools/perl/perl_5.34.0.bb +++ b/meta/recipes-devtools/perl/perl_5.34.0.bb @@ -97,6 +97,9 @@ do_configure:class-native() { -Dvendorprefix=${prefix} \ -Ui_xlocale \ ${PACKAGECONFIG_CONFARGS} + + # See the comment above + sed -i -e "s,${STAGING_DIR_NATIVE},/non/existent,g" config.h } do_configure:append() { diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb index c220bafd90..a7b2cae624 100644 --- a/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb +++ b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb @@ -28,6 +28,7 @@ inherit autotools # so just continue that behaviour. # EXTRA_OECONF += "--disable-indirect-deps" +EXTRA_OECONF:append:class-native = " --libdir=/non/existent --with-pc-path=/non/existent" PACKAGECONFIG ??= "glib" PACKAGECONFIG:class-native = "" diff --git a/meta/recipes-devtools/python/python3/determinism.patch b/meta/recipes-devtools/python/python3/determinism.patch new file mode 100644 index 0000000000..eca7755d4e --- /dev/null +++ b/meta/recipes-devtools/python/python3/determinism.patch @@ -0,0 +1,15 @@ +Index: Python-3.10.0/Makefile.pre.in +=================================================================== +--- Python-3.10.0.orig/Makefile.pre.in ++++ Python-3.10.0/Makefile.pre.in +@@ -791,8 +791,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ + + Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ +- -DPREFIX='"$(prefix)"' \ +- -DEXEC_PREFIX='"$(exec_prefix)"' \ ++ -DPREFIX='"/non/existent"' \ ++ -DEXEC_PREFIX='"/non/existent"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ + -o $@ $(srcdir)/Modules/getpath.c diff --git a/meta/recipes-devtools/python/python3_3.10.0.bb b/meta/recipes-devtools/python/python3_3.10.0.bb index c9f21b5e16..ba74bcaa68 100644 --- a/meta/recipes-devtools/python/python3_3.10.0.bb +++ b/meta/recipes-devtools/python/python3_3.10.0.bb @@ -41,6 +41,7 @@ SRC_URI:append:class-native = " \ file://12-distutils-prefix-is-inside-staging-area.patch \ file://0001-Don-t-search-system-for-headers-libraries.patch \ file://no-import-test.patch \ + file://determinism.patch \ " SRC_URI[sha256sum] = "5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002" @@ -80,6 +81,8 @@ DEPENDS:append:class-nativesdk = " python3-native" # force to use the mutex+cond implementation (https://bugs.python.org/issue41710) CFLAGS += "-DHAVE_BROKEN_POSIX_SEMAPHORES" +CFLAGS:append:class-native = " -ffile-prefix-map=${WORKDIR}=/usr/src" + EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib}" EXTRA_OECONF:append:class-native = " --bindir=${bindir}/${PN}" @@ -95,6 +98,7 @@ CACHED_CONFIGUREVARS = " \ ac_cv_file__dev_ptc=no \ ac_cv_working_tzset=yes \ " +CACHED_CONFIGUREVARS:append:class-native = " ac_cv_prog_cc_g=no" # PGO currently causes builds to not be reproducible so disable by default, see YOCTO #13407 PACKAGECONFIG:class-target ??= "readline gdbm ${@bb.utils.filter('DISTRO_FEATURES', 'lto', d)}" @@ -181,6 +185,8 @@ do_install:append() { # More info: http://benno.id.au/blog/2013/01/15/python-determinism rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython* rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython* + + find ${D}${libdir}/python${PYTHON_MAJMIN} -name __pycache__ | xargs -n1 rm -r } do_install:append:class-nativesdk () { @@ -399,3 +405,5 @@ SYSROOT_PREPROCESS_FUNCS += " py3_sysroot_cleanup" py3_sysroot_cleanup () { rm -rf ${SYSROOT_DESTDIR}${libdir}/python${PYTHON_MAJMIN}/test } + +EXTRA_STAGING_FIXMES:append:class-native = " WORKDIR"