From patchwork Mon Oct 17 13:41:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot] Makefile: prevent libgcc to be linked twice Date: Mon, 17 Oct 2011 03:41:15 -0000 From: Nicolas Ferre X-Patchwork-Id: 120213 Message-Id: <1318858875-14201-1-git-send-email-nicolas.ferre@atmel.com> To: U-Boot@lists.denx.de If we define USE_PRIVATE_LIBGCC, PLATFORM_LIBS is used during link. During this last link editing, libgcc may be listed twice and fail. Prevent this using "filter-out" in top Makefile. Signed-off-by: Nicolas Ferre --- Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 5db2e0e..4bdfe11 100644 --- a/Makefile +++ b/Makefile @@ -311,7 +311,8 @@ endif else PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc endif -PLATFORM_LIBS += $(PLATFORM_LIBGCC) +PLATFORM_LIBS := $(PLATFORM_LIBGCC) \ + $(filter-out %$(PLATFORM_LIBGCC), $(PLATFORM_LIBS)) export PLATFORM_LIBS # Special flags for CPP when processing the linker script.