summaryrefslogtreecommitdiff
authorMike Frysinger <vapier@gentoo.org>2007-03-30 05:44:15 (GMT)
committer Mike Frysinger <vapier@gentoo.org>2007-03-30 05:44:15 (GMT)
commit52a9db6bb874c9ce7a8b7e935ba3ebbefdf3f7d4 (patch)
tree0a00f3190ef9bc4df6e93a4a973080d53b5a66dc
parent2e723237c932f117a74ddaab66277d1a9bb29cc5 (diff)
downloadbusybox-52a9db6bb874c9ce7a8b7e935ba3ebbefdf3f7d4.zip
busybox-52a9db6bb874c9ce7a8b7e935ba3ebbefdf3f7d4.tar.gz
busybox-52a9db6bb874c9ce7a8b7e935ba3ebbefdf3f7d4.tar.bz2
introduce the concept of LDLIBS for additional libraries so that when we do the final link, the objects/libraries are in the correct order
Diffstat
-rw-r--r--Makefile5
-rw-r--r--Makefile.flags6
2 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 6a50a28..4f45ae8 100644
--- a/Makefile
+++ b/Makefile
@@ -302,6 +302,8 @@ AFLAGS_KERNEL =
CFLAGS := $(CFLAGS)
CPPFLAGS := $(CPPFLAGS)
AFLAGS := $(AFLAGS)
+LDFLAGS := $(LDFLAGS)
+LDLIBS :=
# Read KERNELRELEASE from .kernelrelease (if it exists)
KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
@@ -565,7 +567,8 @@ quiet_cmd_busybox__ ?= LINK $@
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
-o $@ -Wl,-M \
-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 \
+ $(LDLIBS)
# Generate System.map
quiet_cmd_sysmap = SYSMAP
diff --git a/Makefile.flags b/Makefile.flags
index 487300d..e4cdc45 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -56,15 +56,15 @@ LDFLAGS += -static
endif
ifeq ($(CONFIG_SELINUX),y)
-LDFLAGS += -lselinux -lsepol
+LDLIBS += -lselinux -lsepol
endif
ifeq ($(CONFIG_EFENCE),y)
-LDFLAGS += -lefence
+LDLIBS += -lefence
endif
ifeq ($(CONFIG_DMALLOC),y)
-LDFLAGS += -ldmalloc
+LDLIBS += -ldmalloc
endif
#LDFLAGS += -nostdlib