From patchwork Mon Mar 11 16:30:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 226608 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 71FF22C02BF for ; Tue, 12 Mar 2013 03:30:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A0EE64A25A; Mon, 11 Mar 2013 17:30:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TRYM9SShqVk4; Mon, 11 Mar 2013 17:30:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ECC2C4A254; Mon, 11 Mar 2013 17:30:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D4934A254 for ; Mon, 11 Mar 2013 17:30:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GIp9GR13Jav4 for ; Mon, 11 Mar 2013 17:30:38 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-gh0-f201.google.com (mail-gh0-f201.google.com [209.85.160.201]) by theia.denx.de (Postfix) with ESMTPS id 48AD14A252 for ; Mon, 11 Mar 2013 17:30:35 +0100 (CET) Received: by mail-gh0-f201.google.com with SMTP id z19so395543ghb.2 for ; Mon, 11 Mar 2013 09:30:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=vuK7Bl90CFsIwRloJftiVSscFJPj3UIhFi8dgXzQlic=; b=QyepzOqm6B7xILTan3KOEjdzgBA3bj1ejjqzI+DwmLXxdeEq0Ai+m0OPqGaIzKy7+x sDO8TtTWMh5QKRMJFmrHmAv3NxZ5iKiVqDU9JY6So4j+rw507bvRNro+Lun9FJrcy+gQ MNpzAuDD+xsMPyR3aGIpkUevjXLO4QPXncrksf7kRUwsFig3PzmHJ/herABERXzdFUjk dLxTcL6uSrnUmCTAEG7+0r9P+1bNzEIL1dDo45LwW1Rm09zAf4CxMFvoe116nRw3cbBr cstYEzOcqZELxs2M5p9zrFJb3Q1mSwrY+09z6iQ7C3huLAiW0cGKhsiGIcyk57SV+hws gB1Q== X-Received: by 10.236.174.7 with SMTP id w7mr7894027yhl.55.1363019433925; Mon, 11 Mar 2013 09:30:33 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id k21si1093058yhh.1.2013.03.11.09.30.33 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 11 Mar 2013 09:30:33 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id A67825A4121; Mon, 11 Mar 2013 09:30:33 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 494E916051A; Mon, 11 Mar 2013 09:30:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 11 Mar 2013 09:30:27 -0700 Message-Id: <1363019427-31520-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 X-Gm-Message-State: ALoCoQlZGTlStENGq4ffQ9JsWvi6aHqSLNzjmmUkN8ij8tJUdeeNSjYCAvE4zaKNSTvBDAPp54yVxHHKuDdxjKuHhC4Eni5pcwNurB7X+8yXKPSc5f7INsHx7UGElMTh4O0rN6JOY5Ar6OOHzGCr7/z7E0DvBT+vNAPzFrcmqWPLBJwh0LaQEpGC4OwoOzyfY8w9zNIC5t43 Cc: Tom Rini , Julius Werner , u-boot-review@google.com, Jerry Van Baren Subject: [U-Boot] [PATCH] fdt: Ensure that libfdt_env.h comes from U-Boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When building host utilities, we include libfdt.h from the host, not from U-Boot. This in turn brings in libfdt_env.h from the host, which can mess up the types and cause a build failure, depending on the host environment. To fix this, force inclusion of U-Boot's libfdt_env.h so that the types are correct. Another way to fix this is to use -nostdinc and -idirafter to ensure that system includes are included after U-Boot ones. Unfortunately this means that U-Boot's errno.h gets included instead of the system one. This in turn requires a hack to errno.h to redirect things, so all in all the solution in this patch is probably cleaner. Signed-off-by: Simon Glass --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index c5952fc..889c897 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -164,7 +164,8 @@ NOPEDOBJS := $(addprefix $(obj),$(NOPED_OBJ_FILES-y)) # Use native tools and options # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps # -HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \ +HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \ + -idirafter $(SRCTREE)/include \ -idirafter $(OBJTREE)/include2 \ -idirafter $(OBJTREE)/include \ -I $(SRCTREE)/lib/libfdt \