compile with NewLibNano (none)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

compile with NewLibNano (none)

1,661 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by miccio on Mon Jul 27 08:04:24 MST 2015
Hello everyone,
I am working on a LPCOpen C++ project, and upon switching from "NewLibNano (no host)" to "NewLibNano (none)" i get this:

Building target: firmware.axf
Invoking: MCU C++ Linker
arm-none-eabi-c++ -nostdlib -L"/[...]/lpc_chip_11cxx_lib/Debug" -Xlinker -Map="firmware.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "proj_Debug.ld" -o "firmware.axf"  ./sys/board_sett.o ./sys/cr_cpp_config.o ./sys/cr_startup_lpc11xx.o ./sys/sysinit.o  ./src/irq_handlers.o ./src/main.o  ./libuavcan_src/transport/uc_can_io.o ./libuavcan_src/transport/uc_crc.o ./libuavcan_src/transport/uc_dispatcher.o ./libuavcan_src/transport/uc_frame.o ./libuavcan_src/transport/uc_outgoing_transfer_registry.o ./libuavcan_src/transport/uc_transfer.o ./libuavcan_src/transport/uc_transfer_buffer.o ./libuavcan_src/transport/uc_transfer_listener.o ./libuavcan_src/transport/uc_transfer_receiver.o ./libuavcan_src/transport/uc_transfer_sender.o  ./libuavcan_src/protocol/uc_dynamic_node_id_client.o ./libuavcan_src/protocol/uc_node_status_provider.o  ./libuavcan_src/node/uc_generic_publisher.o ./libuavcan_src/node/uc_generic_subscriber.o ./libuavcan_src/node/uc_global_data_type_registry.o ./libuavcan_src/node/uc_scheduler.o ./libuavcan_src/node/uc_service_client.o ./libuavcan_src/node/uc_timer.o  ./libuavcan_src/marshal/uc_bit_array_copy.o ./libuavcan_src/marshal/uc_bit_stream.o ./libuavcan_src/marshal/uc_float_spec.o ./libuavcan_src/marshal/uc_scalar_codec.o  ./libuavcan_src/driver/uc_can.o  ./libuavcan_src/uc_data_type.o ./libuavcan_src/uc_dynamic_memory.o ./libuavcan_src/uc_error.o  ./libuavcan_driver_src/can.o ./libuavcan_driver_src/clock.o  ./inc/board.o ./inc/node.o  ./chip_libs/iap.o   -llpc_chip_11cxx_lib
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x2): undefined reference to `_getpid'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x10): undefined reference to `_write'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0xc): undefined reference to `_close'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'
/usr/local/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/libc_nano.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x10): undefined reference to `_read'
collect2: error: ld returned 1 exit status
make: *** [firmware.axf] Error 1


I know this is because of the library's lack of implementation for the aforementioned functions, but I am not using those system calls in my code. Is there a way to see where they are being required?
Thanks in advance!
0 Kudos
Reply
2 Replies

1,277 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by miccio on Mon Jul 27 10:37:32 MST 2015
Worked like a charm, thank you support! :)

for reference sake, most of these functions were needed by "assert()".
0 Kudos
Reply

1,277 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jul 27 08:09:35 MST 2015
Any C/C++ I/O will cause these functions to be required, such as printf etc.

You could try using "No Libraries" and seeing all of the C library functions you are using become unresolved, so you can work out which I/O functions you are using.
0 Kudos
Reply