From patchwork Wed Jun 12 15:07:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1114608 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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.b="Nh3yiUol"; 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 45P9F93Wxkz9s3l for ; Thu, 13 Jun 2019 01:06:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7DD3E85E35; Wed, 12 Jun 2019 15:06:34 +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 EyxFhme8AfnA; Wed, 12 Jun 2019 15:06:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 74C7B85B11; Wed, 12 Jun 2019 15:06:32 +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 05B2D1BF332 for ; Wed, 12 Jun 2019 15:06:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 02B5B87ED0 for ; Wed, 12 Jun 2019 15:06:31 +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 GSKqhHqYZVGS for ; Wed, 12 Jun 2019 15:06:30 +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 9BDE687FA4 for ; Wed, 12 Jun 2019 15:06:22 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id c6so6943505wml.0 for ; Wed, 12 Jun 2019 08:06:22 -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=H4SKG3XoiWhC0cTjTwOyA1zbxYWZgX/Qvl0VHTFs+MQ=; b=Nh3yiUolkfbEMfy3V6uIYt2hmyEzgD2/wQL+PFLyIi+BJPfVUuXwaJqGfKLyAto3bM pcO8ptjUmGQp3O9l5JFbfsXMrsUxlq46HN/OjLD8EymX0jymCaGSeGrPqeB350D7IjIY XsX+qoyS6SkyVGNapnMwpHHsfAtQUsvdZhttaNfezZbpNgZ5q0vvnRxoovQfk+ngMSNZ oplQwdRFmklmrPcG5vs8JfGy245IRsYJYl7nPhup02P9wbzdX0eVamtfwIeNxm3Q/JQS mZj/GGSUnGjc7FwkI0NZn0f0picZshqVfWHzr2DpROm9AfAberIwU+eVnTIe+5KmDTc9 sM/A== 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=H4SKG3XoiWhC0cTjTwOyA1zbxYWZgX/Qvl0VHTFs+MQ=; b=jU9+F09d+SaE0XQiuFESs+jqB5gsgZ9gbaSY8bM72O5RPViDoo4i6vG5lIHzhrWvbz Vm2/xwzt7LSCV8RePInZ2cZVVLEiDKxBRzK5wSxKrpw0REooIdPHqJywXGWoKlTgC/7J pKA7pojdwd0PFj++h080XLgRG3qoOPKBH3KrL6nBTevtZhfPn3S0M6R3jHze6uBI5rZw QyHi/KgxiJBhJae8IvmPixHy+TJWkHGtXpItkM3BE0WSfE5nP/8wi9CdNRzvczPoTV+G w2A8KmUfCvgBb8JRVJQLm9WuxLsk3DLNa9NjslfdecVEqrmpwx4gpVKsroDRjKEMsACW y6DA== X-Gm-Message-State: APjAAAXjH864R0U2jgqtAv5Tpjgn6iV8/Cft6mWBPms8ArMvgIOXAenw ts+ifY25CvpJu8bULk/n4FWbqc0K X-Google-Smtp-Source: APXvYqy+SdLf1A+xHsTigWtXHOWskXcT9gsU86vBdQK0SMOBnCvfT0pGjwClpeqEj3FUy4OsJyVyog== X-Received: by 2002:a1c:e0c4:: with SMTP id x187mr21537735wmg.177.1560351980728; Wed, 12 Jun 2019 08:06:20 -0700 (PDT) Received: from localhost ([131.228.32.167]) by smtp.gmail.com with ESMTPSA id v204sm352286wma.20.2019.06.12.08.06.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 12 Jun 2019 08:06:19 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Wed, 12 Jun 2019 17:07:52 +0200 Message-Id: <20190612150752.18508-1-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] boot/uboot: cover more u-boot versions when fixing up libfdt include paths 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: Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Arnout Vandecappelle (Essensium/Mind)" The original UBOOT_FIXUP_LIBFDT_INCLUDE hook only works for u-boot versions starting from v2017.11. As older u-boot versions are still in common use today, e.g. in the ci20_defconfig, extend the hook to cover a wider range of u-boot versions. The main code change was proposed by Arnout Vandecappelle in [1]. Testing and comment changes were done by Thomas De Schampheleire. [1] http://lists.busybox.net/pipermail/buildroot/2019-May/251231.html Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas De Schampheleire --- boot/uboot/uboot.mk | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) Arnout: I hope you don't mind attributing this commit to you. Otherwise, do let me know... (I take the blame for all problems with it :-D) diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index ae09c37d84..5417f2b8cc 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -201,15 +201,35 @@ define UBOOT_APPLY_LOCAL_PATCHES endef UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_LOCAL_PATCHES -# This is equivalent to upstream commit -# http://git.denx.de/?p=u-boot.git;a=commitdiff;h=e0d20dc1521e74b82dbd69be53a048847798a90a. It -# fixes a build failure when libfdt-devel is installed system-wide. -# This only works when scripts/dtc/libfdt exists (E.G. versions containing -# http://git.denx.de/?p=u-boot.git;a=commitdiff;h=c0e032e0090d6541549b19cc47e06ccd1f302893) +# Fixup inclusion of libfdt headers, which can fail in older u-boot versions +# when libfdt-devel is installed system-wide. +# The core change is equivalent to upstream commit +# e0d20dc1521e74b82dbd69be53a048847798a90a (first in v2018.03). However, the fixup +# is complicated by the fact that the underlying u-boot code changed multiple +# times in history: +# - The directory scripts/dtc/libfdt only exists since upstream commit +# c0e032e0090d6541549b19cc47e06ccd1f302893 (first in v2017.11). For earlier +# versions, create a dummy scripts/dtc/libfdt directory with symlinks for the +# fdt-related files. This allows to use the same -I option for both +# cases. +# - The variable 'srctree' used to be called 'SRCTREE' before upstream commit +# 01286329b27b27eaeda045b469d41b1d9fce545a (first in v2014.04). +# - The original location for libfdt, 'lib/libfdt/', used to be simply +# 'libfdt' before upstream commit 0de71d507157c4bd4fddcd3a419140d2b986eed2 +# (first in v2010.06). Make the 'lib' part optional in the substitution to +# handle this. define UBOOT_FIXUP_LIBFDT_INCLUDE - if [ -d $(@D)/scripts/dtc/libfdt ]; then \ - $(SED) 's%-I$$(srctree)/lib/libfdt%-I$$(srctree)/scripts/dtc/libfdt%' $(@D)/tools/Makefile; \ + $(Q)if [ ! -d $(@D)/scripts/dtc/libfdt ]; then \ + mkdir -p $(@D)/scripts/dtc/libfdt; \ + cd $(@D)/scripts/dtc/libfdt; \ + ln -s ../../../include/fdt.h .; \ + ln -s ../../../include/libfdt*.h .; \ + ln -s ../../../lib/libfdt/libfdt_internal.h .; \ fi + $(Q)$(SED) \ + 's%-I\ *\$$(srctree)/lib/libfdt%-I$$(srctree)/scripts/dtc/libfdt%; \ + s%-I\ *\$$(SRCTREE)\(/lib\)\?/libfdt%-I$$(SRCTREE)/scripts/dtc/libfdt%' \ + $(@D)/tools/Makefile endef UBOOT_POST_PATCH_HOOKS += UBOOT_FIXUP_LIBFDT_INCLUDE