From patchwork Fri Jul 31 07:48:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 1339284 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ELvGsf37; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BHztB1mwBz9sRK for ; Fri, 31 Jul 2020 17:48:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 02E71207EF; Fri, 31 Jul 2020 07:48:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z39RQhWB3Jgm; Fri, 31 Jul 2020 07:48:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F39C7203A6; Fri, 31 Jul 2020 07:48:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0A6D11BF2F3 for ; Fri, 31 Jul 2020 07:48:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 067DA88763 for ; Fri, 31 Jul 2020 07:48:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LKiz9qLQcWKh for ; Fri, 31 Jul 2020 07:48:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 529AE8874A for ; Fri, 31 Jul 2020 07:48:27 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id k23so30787494iom.10 for ; Fri, 31 Jul 2020 00:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJiGjv8pwW2W1km2DnWzzJeM6lWDXRNkJufrm6tjVtY=; b=ELvGsf37OM5bS0SspPx0IPsHUC609xMurwfV1GLVhzBUxn8H0NuDdvHXgPkxJ10QY5 y+XA7vObjs1vzn9zBhDTiQYhA6QUUDo7VWi27P8XklMxLGQ0GcsGq7fKe6XisH85U3dc mnx20O3l57R66EU4r7WcYumsEqAWFwrnEwN3jQNnQhTuouXOFrUmHq6Hp7JuUf2TT1ET yCwyIRlrJF/MpNR88QYyBE/ze0e6GVyZfTD03M39+F9tCwPsc/bDNgigmOK03MQrMhwc 15p7n8+zzjR2gUYagI3Jr5HH+yOZu8ZenhpsUIgKvmxiIS7ENXwlBKjaczydris6kT70 J4jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJiGjv8pwW2W1km2DnWzzJeM6lWDXRNkJufrm6tjVtY=; b=FJV4uf62PVhtUqPL9irQwzYEfQP1JVDuVLRlH5PpbGTDHjAwPG12xrJ+KvPBQZw35t AVuUlZnHP4pShiZH5WlZhUwL/kMsF7zqigv3xJ6XTNHf1+Q9opA4Yw03VFIm0+V4iL14 OE/BuiqrJyhswQCIzh4JqqdaEUWRmQGFhqlN4i3kTFUumPZp0ckA+c06ocu3Bi44mSft Yd2DZDUTt7WLdPhuNdLOQBkyYeE3N6RMD53JLm4kAo0/54Bg0LUTs2UjXSioOr6Csa+l B0nilLnuoF3LDzpbfIxbNlpsk1JV9xFykhuU5cIEFwOl2x9f31XPElG39jQ+YiQOsRMo tR8g== X-Gm-Message-State: AOAM531s23KbaWehvTKASEG95I0TxlGGUnbE5JL39WQSWUt7hdqnFis6 d01JTINDJYQnCmktI1f7tG5zh6MZ X-Google-Smtp-Source: ABdhPJyFjxMKS9pPpSJM5ErAbk4KGLfj9gvsLlgqzweJ/QxORmJy4BwpBwQdtOg1qv6iHfMC6iPwmA== X-Received: by 2002:a02:5803:: with SMTP id f3mr3714839jab.126.1596181705886; Fri, 31 Jul 2020 00:48:25 -0700 (PDT) Received: from james-x399.localdomain (71-218-100-23.hlrn.qwest.net. [71.218.100.23]) by smtp.gmail.com with ESMTPSA id q14sm3759778ioi.48.2020.07.31.00.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 00:48:24 -0700 (PDT) From: James Hilliard To: buildroot@buildroot.org Date: Fri, 31 Jul 2020 01:48:21 -0600 Message-Id: <20200731074821.4137503-1-james.hilliard1@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/meson: update rpath patch to upstream version X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , James Hilliard Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The version of this patch merged by upstream has some changes to rpath syntax matching and handling for additional syntax edge cases. Signed-off-by: James Hilliard --- ...003-backends-fix-rpath-match-pattern.patch | 77 +++++++++++++++---- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/package/meson/0003-backends-fix-rpath-match-pattern.patch b/package/meson/0003-backends-fix-rpath-match-pattern.patch index 5fd5b73ade..f4477b59d2 100644 --- a/package/meson/0003-backends-fix-rpath-match-pattern.patch +++ b/package/meson/0003-backends-fix-rpath-match-pattern.patch @@ -1,4 +1,4 @@ -From af4ac0284714842535106f3d5f8a973c20e95105 Mon Sep 17 00:00:00 2001 +From 1ce4258c219fe08b6d6eaa6aa944f27d91d054cb Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sat, 18 Jul 2020 17:01:33 -0600 Subject: [PATCH] backends: fix rpath match pattern @@ -6,23 +6,45 @@ Subject: [PATCH] backends: fix rpath match pattern Since -Wl,-rpath= is not the only valid rpath ldflags syntax we need to try and match all valid rpath ldflags. +In addition we should prevent -Wl,--just-symbols from being used to +set rpath due to inconsistent compiler support. + Signed-off-by: James Hilliard -[Upstream status: -https://github.com/mesonbuild/meson/pull/7472] +[james.hilliard1@gmail.com: backport from upstream commit +1ce4258c219fe08b6d6eaa6aa944f27d91d054cb] --- - mesonbuild/backend/backends.py | 6 ++++-- - run_unittests.py | 26 +++++++++++++++----------- - 2 files changed, 19 insertions(+), 13 deletions(-) + mesonbuild/backend/backends.py | 30 ++++++++++++++++++++++++-- + run_unittests.py | 39 +++++++++++++++++++++++----------- + 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py -index cfd3a397f..6f44abc13 100644 +index cfd3a397f..e053f67e6 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py -@@ -455,9 +455,11 @@ class Backend: +@@ -14,6 +14,7 @@ + + from collections import OrderedDict + from functools import lru_cache ++from pathlib import Path + import enum + import json + import os +@@ -455,10 +456,35 @@ class Backend: args.extend(self.environment.coredata.get_external_link_args(target.for_machine, lang)) except Exception: pass -+ rpath_regex = re.compile(r'-Wl,-rpath(?:-link)?[=,]([^,@\-][^,]+)') ++ # Match rpath formats: ++ # -Wl,-rpath= ++ # -Wl,-rpath, ++ rpath_regex = re.compile(r'-Wl,-rpath[=,]([^,]+)') ++ # Match solaris style compat runpath formats: ++ # -Wl,-R ++ # -Wl,-R, ++ runpath_regex = re.compile(r'-Wl,-R[,]?([^,]+)') ++ # Match symbols formats: ++ # -Wl,--just-symbols= ++ # -Wl,--just-symbols, ++ symbols_regex = re.compile(r'-Wl,--just-symbols[=,]([^,]+)') for arg in args: - if arg.startswith('-Wl,-rpath='): - for dir in arg.replace('-Wl,-rpath=','').split(':'): @@ -30,15 +52,30 @@ index cfd3a397f..6f44abc13 100644 + if rpath_match: + for dir in rpath_match.group(1).split(':'): dirs.add(dir) ++ runpath_match = runpath_regex.match(arg) ++ if runpath_match: ++ for dir in runpath_match.group(1).split(':'): ++ # The symbols arg is an rpath if the path is a directory ++ if Path(dir).is_dir(): ++ dirs.add(dir) ++ symbols_match = symbols_regex.match(arg) ++ if symbols_match: ++ for dir in symbols_match.group(1).split(':'): ++ # Prevent usage of --just-symbols to specify rpath ++ if Path(dir).is_dir(): ++ raise MesonException('Invalid arg for --just-symbols, {} is a directory.'.format(dir)) return dirs + def rpaths_for_bundled_shared_libraries(self, target, exclude_system=True): diff --git a/run_unittests.py b/run_unittests.py -index 820b705b5..2c3ffc2e9 100755 +index b5294b9f8..73131c75b 100755 --- a/run_unittests.py +++ b/run_unittests.py -@@ -6421,17 +6421,21 @@ class LinuxlikeTests(BasePlatformTests): +@@ -6473,19 +6473,34 @@ class LinuxlikeTests(BasePlatformTests): + self.init(yonder_dir) + self.build() self.install(use_destdir=False) - self.new_builddir() +- self.new_builddir() - # Build an app that uses that installed library. - # Supply the rpath to the installed library via LDFLAGS @@ -53,14 +90,26 @@ index 820b705b5..2c3ffc2e9 100755 - self.assertEqual(got_rpath, yonder_libdir) + # Since rpath has multiple valid formats we need to + # test that they are all properly used. -+ rpath_formats = ['-Wl,-rpath=', '-Wl,-rpath,', '-Wl,-rpath-link=', '-Wl,-rpath-link,'] -+ for rpath_format in rpath_formats: ++ rpath_formats = [ ++ ('-Wl,-rpath=', False), ++ ('-Wl,-rpath,', False), ++ ('-Wl,--just-symbols=', True), ++ ('-Wl,--just-symbols,', True), ++ ('-Wl,-R', False), ++ ('-Wl,-R,', False) ++ ] ++ for rpath_format, exception in rpath_formats: + # Build an app that uses that installed library. + # Supply the rpath to the installed library via LDFLAGS + # (as systems like buildroot and guix are wont to do) + # and verify install preserves that rpath. ++ self.new_builddir() + env = {'LDFLAGS': rpath_format + yonder_libdir, + 'PKG_CONFIG_PATH': os.path.join(yonder_libdir, 'pkgconfig')} ++ if exception: ++ with self.assertRaises(subprocess.CalledProcessError): ++ self.init(testdir, override_envvars=env) ++ break + self.init(testdir, override_envvars=env) + self.build() + self.install(use_destdir=False)