- set LD to ld

- simplify the cmd_busybox__ a bit and pass the LDFLAGS via -Wl down to CC
This commit is contained in:
Bernhard Reutner-Fischer 2007-01-08 16:29:15 +00:00
parent 681f183b94
commit c1feac6e9f
2 changed files with 6 additions and 12 deletions

View File

@ -273,8 +273,8 @@ MAKEFLAGS += -rR
# Make variables (CC, etc...) # Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)gcc -nostdlib
CC = $(CROSS_COMPILE)gcc CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
CPP = $(CC) -E CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm NM = $(CROSS_COMPILE)nm
@ -529,7 +529,6 @@ libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
libs-y := $(libs-y1) $(libs-y2) libs-y := $(libs-y1) $(libs-y2)
# Build busybox # Build busybox
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# busybox is build from the objects selected by $(busybox-init) and # busybox is build from the objects selected by $(busybox-init) and
@ -562,18 +561,10 @@ busybox-all := $(core-y) $(libs-y)
# Rule to link busybox - also used during CONFIG_KALLSYMS # Rule to link busybox - also used during CONFIG_KALLSYMS
# May be overridden by arch/$(ARCH)/Makefile # May be overridden by arch/$(ARCH)/Makefile
quiet_cmd_busybox__ ?= LINK $@ quiet_cmd_busybox__ ?= LINK $@
ifdef CONFIG_STATIC cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(patsubst %,-Wl$(comma)%,$(LDFLAGS)) \
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
-static \
-o $@ \ -o $@ \
-Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
-Wl,--start-group $(busybox-all) -Wl,--end-group -Wl,--start-group $(busybox-all) -Wl,--end-group
else
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
-o $@ \
-Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
-Wl,--start-group $(busybox-all) -Wl,--end-group
endif
# Generate System.map # Generate System.map
quiet_cmd_sysmap = SYSMAP quiet_cmd_sysmap = SYSMAP

View File

@ -23,6 +23,9 @@ CFLAGS += \
ifeq ($(CONFIG_DEBUG),y) ifeq ($(CONFIG_DEBUG),y)
CFLAGS += -g CFLAGS += -g
LDFLAGS += -g
endif endif
ifeq ($(CONFIG_STATIC),y)
LDFLAGS += -static
endif
LDFLAGS += -nostdlib