From patchwork Mon Jun 15 22:28:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1309861 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.137; helo=fraxinus.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=QzKO+rox; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49m5cS1mG5z9sR4 for ; Tue, 16 Jun 2020 08:30:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1E44E86AAC; Mon, 15 Jun 2020 22:29:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQtpKn0PVXS0; Mon, 15 Jun 2020 22:29:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3B4C686A57; Mon, 15 Jun 2020 22:29:56 +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 43A7C1BF3A7 for ; Mon, 15 Jun 2020 22:29:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3BACF889CA for ; Mon, 15 Jun 2020 22:29:55 +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 FD-99xEzgSZu for ; Mon, 15 Jun 2020 22:29:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 787EB889AB for ; Mon, 15 Jun 2020 22:29:54 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id l26so1074610wme.3 for ; Mon, 15 Jun 2020 15:29:54 -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=J6K9tvRMqrgE9EGyK8rD4na3SJGiDB4+afEuYXeIVvI=; b=QzKO+roxcIu7crPbzoqHhNn9L/Gsv5+2lRhYVXdYm7VQ7yDBDte9myzELg/rYIVJfx 5DFL5pzp/AVT/xWx/7JgkD4VfHky9JprM5PDAQJBNB77txFGbMiQDQ0y2MiRoszj0MdE Ov6oAn7O8tWWmsXANAG6ehAymoewkDN9ZNnUtAUq7pPD+dCu9lt76Imp5mD+K3cuBfvf 4To6RPwLrHLXpLihJSe1XTR3Hmc3HmkDpgX4qmkOh3PhDaADX7V3XXgLM7Am0/Tgbhp7 mc1kwlzaRYRn7g/mXYWq3Cwi1hYcL2NRUjw6oJq+Y/AX5qBaBSX+b0GqW2oH4hVEYUXk UbbA== 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=J6K9tvRMqrgE9EGyK8rD4na3SJGiDB4+afEuYXeIVvI=; b=ts9CSyqVxWwDnk+pFXmI4/o4MyRE1q0kjOHrsDhHH0gkhp+5QHrVnq/rW0IHERKF31 1AnquVK9w9npUUhYyUSr4upBf4ipNtVpr2VnIjGTu5baUyj4sVLM84bX3OxcumfDBEy/ xp33YZZhW9hsOBLFDAX6LMKVr55750rsSlMf+v68pn9Yev7crjZuwcuZnrLT8yzLQ/3S n0rl8Tl2kbq4RBXlmlVivryGe4cSR4TcDvcnAbR3+sgV+VQgRwglbXZxc9jVsAaQJ0xn oJ/30eJhzZw3CwjLzonWnu/xDFmHbjiwW/cxSsGtFvujMMDUiI6kl+Ih7JV03dA/EaRe aODA== X-Gm-Message-State: AOAM530kzv1szr8LdZnrffEN4iKYtzMMViEnDKicJ+DO5LEsy+Lb3jSD bxaml1meIhWi7ApppJdyv6gG2/61fV8= X-Google-Smtp-Source: ABdhPJzipnDBfuecGlxbUL3uDzBOLqW/9CIdklgtz/eGvetncTKnqvqD3/vQEF05PNlVeEywc452og== X-Received: by 2002:a7b:c186:: with SMTP id y6mr75068wmi.82.1592260192569; Mon, 15 Jun 2020 15:29:52 -0700 (PDT) Received: from localhost.localdomain (84-114-45-16.cable.dynamic.surfer.at. [84.114.45.16]) by smtp.gmail.com with ESMTPSA id i8sm25356419wru.30.2020.06.15.15.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 15:29:51 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Tue, 16 Jun 2020 00:28:55 +0200 Message-Id: <20200615222856.147762-1-nolange79@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] package/systemd: fixup RPATH for more systemd host binaries 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: Norbert Lange , yann.morin.1998@free.fr, Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" All systemd binaries depend on libsystemd-shared and need their RPATH fixed. Use a glob to catch them all Signed-off-by: Norbert Lange --- v1->v2: - dont ignore failure from patchelf v2->v3: - change back to shell loop, the wildcard gets expanded before the install step and is empty the first time - add busctl --- package/systemd/systemd.mk | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index 2cc71ee667..b04391da9e 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -659,6 +659,8 @@ HOST_SYSTEMD_DEPENDENCIES = \ host-libcap \ host-gperf +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) + # Fix RPATH After installation # * systemd provides a install_rpath instruction to meson because the binaries # need to link with libsystemd which is not in a standard path @@ -667,20 +669,13 @@ HOST_SYSTEMD_DEPENDENCIES = \ # * the original path had been tweaked by buildroot via LDFLAGS to add # $(HOST_DIR)/lib # * thus re-tweak rpath after the installation for all binaries that need it -HOST_SYSTEMD_HOST_TOOLS = \ - systemd-analyze \ - systemd-machine-id-setup \ - systemd-mount \ - systemd-nspawn \ - systemctl \ - udevadm - -HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) +HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl udevadm systemd-* define HOST_SYSTEMD_FIX_RPATH - $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \ - $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f) - ) + cd $(HOST_DIR)/bin && for f in $(HOST_SYSTEMD_HOST_TOOLS); do \ + set -e; \ + [ ! -x $$f ] || $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $$f; \ + done endef HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH