galileo: Revise stdlib static linking
This patch does some refactoring so we are able to statically link against standard libraries in a more usual way.
This commit is contained in:
parent
7043aa41b3
commit
e41bed319f
1 changed files with 3 additions and 6 deletions
|
@ -13,15 +13,12 @@ CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
||||||
include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000
|
include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000
|
||||||
|
|
||||||
CFLAGS += -fno-stack-protector -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
CFLAGS += -fno-stack-protector -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
||||||
LDFLAGS += -nostdlib
|
LDFLAGS += -nostdlib -L$(LIBC)/lib -L$(LIBGCC_PATH)/32
|
||||||
|
|
||||||
|
TARGET_LIBFILES += -lm -lc -lgcc
|
||||||
|
|
||||||
-include $(LIBC_PATH)/Makefile.libc
|
-include $(LIBC_PATH)/Makefile.libc
|
||||||
|
|
||||||
ifndef BUILT_LIBC
|
ifndef BUILT_LIBC
|
||||||
$(error Build the C library by executing $(LIBC_PATH)/build_newlib.sh)
|
$(error Build the C library by executing $(LIBC_PATH)/build_newlib.sh)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Ideally, this should be part of LDFLAGS (-lc -lm etc). However, we found out that archive
|
|
||||||
# static files (.a) must be linked after our own object files, otherwise the linker gets lost
|
|
||||||
# and we get undefined references only.
|
|
||||||
TARGET_LIBFILES = $(LIBC)/lib/libm.a $(LIBC)/lib/libc.a $(LIBGCC_PATH)/32/libgcc.a
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue