introduce the concept of LDLIBS for additional libraries so that when we do the final link, the objects/libraries are in the correct order
This commit is contained in:
parent
2e723237c9
commit
52a9db6bb8
5
Makefile
5
Makefile
@ -302,6 +302,8 @@ AFLAGS_KERNEL =
|
|||||||
CFLAGS := $(CFLAGS)
|
CFLAGS := $(CFLAGS)
|
||||||
CPPFLAGS := $(CPPFLAGS)
|
CPPFLAGS := $(CPPFLAGS)
|
||||||
AFLAGS := $(AFLAGS)
|
AFLAGS := $(AFLAGS)
|
||||||
|
LDFLAGS := $(LDFLAGS)
|
||||||
|
LDLIBS :=
|
||||||
|
|
||||||
# Read KERNELRELEASE from .kernelrelease (if it exists)
|
# Read KERNELRELEASE from .kernelrelease (if it exists)
|
||||||
KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
|
KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
|
||||||
@ -565,7 +567,8 @@ quiet_cmd_busybox__ ?= LINK $@
|
|||||||
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
|
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
|
||||||
-o $@ -Wl,-M \
|
-o $@ -Wl,-M \
|
||||||
-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 \
|
||||||
|
$(LDLIBS)
|
||||||
|
|
||||||
# Generate System.map
|
# Generate System.map
|
||||||
quiet_cmd_sysmap = SYSMAP
|
quiet_cmd_sysmap = SYSMAP
|
||||||
|
@ -56,15 +56,15 @@ LDFLAGS += -static
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_SELINUX),y)
|
ifeq ($(CONFIG_SELINUX),y)
|
||||||
LDFLAGS += -lselinux -lsepol
|
LDLIBS += -lselinux -lsepol
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_EFENCE),y)
|
ifeq ($(CONFIG_EFENCE),y)
|
||||||
LDFLAGS += -lefence
|
LDLIBS += -lefence
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_DMALLOC),y)
|
ifeq ($(CONFIG_DMALLOC),y)
|
||||||
LDFLAGS += -ldmalloc
|
LDLIBS += -ldmalloc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#LDFLAGS += -nostdlib
|
#LDFLAGS += -nostdlib
|
||||||
|
Loading…
Reference in New Issue
Block a user