examples/module. Module should not link with libc because it has out-of-range function calls
This commit is contained in:
parent
ad4bcac7a0
commit
052392f36c
@ -14,7 +14,7 @@ if EXAMPLES_MODULE
|
||||
config EXAMPLES_MODULE_LIBC
|
||||
bool "Link with LIBC"
|
||||
default n
|
||||
depends on !BUILD_KERNEL
|
||||
depends on !BUILD_KERNEL && EXPERIMENTAL
|
||||
---help---
|
||||
Link with the C library (and also math library if it was built).
|
||||
By default, all undefined symbols must be provided via a symbol
|
||||
@ -26,6 +26,15 @@ config EXAMPLES_MODULE_LIBC
|
||||
program greatly increasing the total code size. This option is
|
||||
primarily intended only for testing.
|
||||
|
||||
WARNING: Libc will not be built with -mlong-calls and this may
|
||||
result in runtime linking failures due to out-of-range functions
|
||||
calls.
|
||||
|
||||
config EXAMPLES_MODULE_LIBGCC
|
||||
bool "Link with LIBGCC"
|
||||
default n
|
||||
depends on !BUILD_KERNEL && EXPERIMENTAL
|
||||
|
||||
config EXAMPLES_MODULE_DEVMINOR
|
||||
int "ROMFS Minor Device Number"
|
||||
default 0
|
||||
|
1
examples/module/drivers/.gitignore
vendored
1
examples/module/drivers/.gitignore
vendored
@ -2,5 +2,4 @@
|
||||
/romfs.h
|
||||
/romfs.img
|
||||
/symtab.c
|
||||
/varlist.tmp
|
||||
|
||||
|
@ -44,6 +44,14 @@ endif
|
||||
KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__}
|
||||
CFLAGS += $(KDEFINE)
|
||||
|
||||
ifeq ($(CONFIG_EXAMPLES_MODULE_LIBGCC),y)
|
||||
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name 2>/dev/null}"
|
||||
ifneq ($(LIBGCC),)
|
||||
LDLIBPATH += -L "${shell dirname $(LIBGCC)}"
|
||||
LDLIBS += -lgcc
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_EXAMPLES_MODULE_LIBC),y)
|
||||
LDMODULEFLAGS += -Bstatic
|
||||
LDLIBPATH += -L $(NUTTXLIB)
|
||||
|
Loading…
Reference in New Issue
Block a user