From patchwork Wed Mar 5 07:59:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 326623 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 399FA2C020A for ; Wed, 5 Mar 2014 19:02:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C36A24B60F; Wed, 5 Mar 2014 09:01:33 +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 fV5lgaXHvQsN; Wed, 5 Mar 2014 09:01:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 471D94B5EB; Wed, 5 Mar 2014 09:00:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C34AC4B61C for ; Wed, 5 Mar 2014 09:00: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 lHNUyFQ7Ztyn for ; Wed, 5 Mar 2014 09:00:31 +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 smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 7052D4B58F for ; Wed, 5 Mar 2014 09:00:13 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile11) with ESMTP id s257xhvc009885; Wed, 5 Mar 2014 16:59:43 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili13) with ESMTP id s257xhJ24154; Wed, 5 Mar 2014 16:59:43 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id s257xhSo020286; Wed, 5 Mar 2014 16:59:43 +0900 Received: from poodle by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s257xhU3020229; Wed, 5 Mar 2014 16:59:43 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 22BEF2740043; Wed, 5 Mar 2014 16:59:43 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 5 Mar 2014 16:59:38 +0900 Message-Id: <1394006380-14192-3-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394006380-14192-1-git-send-email-yamada.m@jp.panasonic.com> References: <1394006380-14192-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Stephen Warren , Tom Warren , Tom Rini Subject: [U-Boot] [PATCH v3 2/4] kbuild: add CONFIG_ prefix to USE_PRIVATE_LIBGCC 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 Before this commit, USE_PRIVATE_LIBGCC was defined in arch-specific config.mk and referenced in arch/$(ARCH)/lib/Makefile. We are not happy about parsing config.mk again and again. We have to keep the same behavior with a different way. By adding "CONFIG_" prefix, this macro appears in include/autoconf.mk, include/spl-autoconf.mk. (And treating USE_PRIVATE_LIBGCC as CONFIG macro is reasonable enough.) Tegra SoC family defined USE_PRIVATE_LIBGCC as "yes" in arch/arm/cpu/arm720t/tegra*/config.mk, whereas did not define it in arch/arm/cpu/armv7/tegra*/config.mk. It means Tegra enables PRIVATE_LIBGCC only for SPL. We can describe the same behavior by adding #ifdef CONFIG_SPL_BUILD # define CONFIG_USE_PRIVATE_LIBGCC #endif to include/configs/tegra-common.h. Signed-off-by: Masahiro Yamada Cc: Tom Warren Cc: Simon Glass Acked-by: Stephen Warren Acked-by: Simon Glass --- Changes in v3: None Changes in v2: - Fix the subject and commit description s/USE_PRIVATE_LIBS/USE_PRIVATE_LIBGCC/ Makefile | 6 +++--- arch/arm/cpu/arm720t/tegra114/config.mk | 19 ------------------- arch/arm/cpu/arm720t/tegra124/config.mk | 7 ------- arch/arm/cpu/arm720t/tegra20/config.mk | 10 ---------- arch/arm/cpu/arm720t/tegra30/config.mk | 19 ------------------- arch/arm/lib/Makefile | 13 ++----------- arch/mips/lib/Makefile | 7 +------ arch/powerpc/lib/Makefile | 6 +----- arch/sh/lib/Makefile | 14 ++------------ arch/x86/config.mk | 2 +- include/configs/tegra-common.h | 4 ++++ spl/Makefile | 2 +- 12 files changed, 15 insertions(+), 94 deletions(-) delete mode 100644 arch/arm/cpu/arm720t/tegra114/config.mk delete mode 100644 arch/arm/cpu/arm720t/tegra124/config.mk delete mode 100644 arch/arm/cpu/arm720t/tegra20/config.mk delete mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk diff --git a/Makefile b/Makefile index 5b7e5e6..b546d76 100644 --- a/Makefile +++ b/Makefile @@ -651,11 +651,11 @@ u-boot-main := $(libs-y) # Add GCC lib -ifdef USE_PRIVATE_LIBGCC -ifeq ("$(USE_PRIVATE_LIBGCC)", "yes") +ifdef CONFIG_USE_PRIVATE_LIBGCC +ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y) PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a else -PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc +PLATFORM_LIBGCC = -L $(CONFIG_USE_PRIVATE_LIBGCC) -lgcc endif else PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc diff --git a/arch/arm/cpu/arm720t/tegra114/config.mk b/arch/arm/cpu/arm720t/tegra114/config.mk deleted file mode 100644 index 7947b50..0000000 --- a/arch/arm/cpu/arm720t/tegra114/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -USE_PRIVATE_LIBGCC = yes diff --git a/arch/arm/cpu/arm720t/tegra124/config.mk b/arch/arm/cpu/arm720t/tegra124/config.mk deleted file mode 100644 index 5e10701..0000000 --- a/arch/arm/cpu/arm720t/tegra124/config.mk +++ /dev/null @@ -1,7 +0,0 @@ -# -# (C) Copyright 2010-2013 -# NVIDIA Corporation -# -# SPDX-License-Identifier: GPL-2.0+ -#/ -USE_PRIVATE_LIBGCC = yes diff --git a/arch/arm/cpu/arm720t/tegra20/config.mk b/arch/arm/cpu/arm720t/tegra20/config.mk deleted file mode 100644 index e073345..0000000 --- a/arch/arm/cpu/arm720t/tegra20/config.mk +++ /dev/null @@ -1,10 +0,0 @@ -# -# (C) Copyright 2010,2011 -# NVIDIA Corporation -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, -# -# SPDX-License-Identifier: GPL-2.0+ -# -USE_PRIVATE_LIBGCC = yes diff --git a/arch/arm/cpu/arm720t/tegra30/config.mk b/arch/arm/cpu/arm720t/tegra30/config.mk deleted file mode 100644 index 2388c56..0000000 --- a/arch/arm/cpu/arm720t/tegra30/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -USE_PRIVATE_LIBGCC = yes diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 45febcf..9fc81cd 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -5,17 +5,8 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Build private libgcc only when asked for -ifdef USE_PRIVATE_LIBGCC -lib-y += _ashldi3.o -lib-y += _ashrdi3.o -lib-y += _divsi3.o -lib-y += _lshrdi3.o -lib-y += _modsi3.o -lib-y += _udivsi3.o -lib-y += _umodsi3.o -lib-y += div0.o -endif +lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _ashldi3.o _ashrdi3.o _divsi3.o \ + _lshrdi3.o _modsi3.o _udivsi3.o _umodsi3.o div0.o ifdef CONFIG_ARM64 obj-y += crt0_64.o diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 3705926..fabeb83 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -8,9 +8,4 @@ obj-y += board.o obj-$(CONFIG_CMD_BOOTM) += bootm.o -# Build private libgcc only when asked for -ifdef USE_PRIVATE_LIBGCC -lib-y += ashldi3.o -lib-y += ashrdi3.o -lib-y += lshrdi3.o -endif +lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index e6d8be5..0f62982 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -7,11 +7,7 @@ ## Build a couple of necessary functions into a private libgcc ## if the user asked for it -ifdef USE_PRIVATE_LIBGCC -lib-y += _ashldi3.o -lib-y += _ashrdi3.o -lib-y += _lshrdi3.o -endif +lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _ashldi3.o _ashrdi3.o _lshrdi3.o MINIMAL= diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 5fc9d9d..8a84b24 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -15,15 +15,5 @@ obj-y += time.o endif obj-$(CONFIG_CMD_SH_ZIMAGEBOOT) += zimageboot.o - - -# Build private libgcc only when asked for -ifdef USE_PRIVATE_LIBGCC -lib-y += ashiftrt.o -lib-y += ashiftlt.o -lib-y += lshiftrt.o -lib-y += ashldi3.o -lib-y += ashrsi3.o -lib-y += lshrdi3.o -lib-y += movmem.o -endif +lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashiftrt.o ashiftlt.o lshiftrt.o \ + ashldi3.o ashrsi3.o lshrdi3.o movmem.o diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 58dff14..1e52a5e 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -31,4 +31,4 @@ LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 export NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC)) -export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) +CONFIG_USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h index 0b102aa..9247aef 100644 --- a/include/configs/tegra-common.h +++ b/include/configs/tegra-common.h @@ -151,6 +151,10 @@ #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT +#ifdef CONFIG_SPL_BUILD +# define CONFIG_USE_PRIVATE_LIBGCC +#endif + #define CONFIG_SYS_GENERIC_BOARD /* Misc utility code */ diff --git a/spl/Makefile b/spl/Makefile index 57bd43b..e1a0601 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -132,7 +132,7 @@ u-boot-spl-dirs := $(patsubst %/,%,$(filter %/, $(libs-y))) libs-y := $(patsubst %/, %/built-in.o, $(libs-y)) # Add GCC lib -ifeq ("$(USE_PRIVATE_LIBGCC)", "yes") +ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y) PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a PLATFORM_LIBS := $(filter-out %/lib.a, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC) endif