mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
x86_64: hide --whole-archive behind Kconfig option
Hide --whole-archive behind Kconfig option for x86. This option is not needed and breaks ELF modules build. Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
committed by
Xiang Xiao
parent
7e342b3422
commit
09146beee9
@@ -113,7 +113,7 @@ nuttx$(EXEEXT): board/libboard$(LIBEXT) $(ARCHSCRIPT)
|
|||||||
@echo "LD: nuttx$(EXEEXT)"
|
@echo "LD: nuttx$(EXEEXT)"
|
||||||
$(Q) $(LD) $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
$(Q) $(LD) $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||||
-o $(NUTTX) $(EXTRA_OBJS) \
|
-o $(NUTTX) $(EXTRA_OBJS) \
|
||||||
$(LDSTARTGROUP) $(EXTRA_LIBS) --whole-archive --no-relax $(LDLIBS) $(LDENDGROUP)
|
$(LDSTARTGROUP) $(EXTRA_LIBS) --no-relax $(LDLIBS) $(LDENDGROUP)
|
||||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||||
$(Q) $(NM) $(NUTTX) | \
|
$(Q) $(NM) $(NUTTX) | \
|
||||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
|
|||||||
@@ -116,6 +116,10 @@ if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
|
|||||||
add_compile_options(-ffunction-sections -fdata-sections)
|
add_compile_options(-ffunction-sections -fdata-sections)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE)
|
||||||
|
add_link_options(-Wl,--whole-archive)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_ARCH_INTEL64_HAVE_RDRAND)
|
if(CONFIG_ARCH_INTEL64_HAVE_RDRAND)
|
||||||
add_compile_options(-mrdrnd)
|
add_compile_options(-mrdrnd)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ ifeq ($(CONFIG_HOST_MACOS),y)
|
|||||||
CROSSDEV = x86_64-elf-
|
CROSSDEV = x86_64-elf-
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
|
||||||
|
LDFLAGS += --whole-archive
|
||||||
|
endif
|
||||||
|
|
||||||
CC = $(CROSSDEV)gcc
|
CC = $(CROSSDEV)gcc
|
||||||
CPP = $(CROSSDEV)gcc -E -x c
|
CPP = $(CROSSDEV)gcc -E -x c
|
||||||
LD = $(CROSSDEV)ld
|
LD = $(CROSSDEV)ld
|
||||||
|
|||||||
Reference in New Issue
Block a user