Skip to content

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Jul 6, 2018

Contribution description

This fixes building with llvm where newlib-nano header is not used.

Basically, the default newlib directory was put before newlib-nano include directory.

Test command

The first commit can be tested to show it is broken and that the second fixes it

make TOOLCHAIN=llvm BOARD=samr21-xpro ASSERT_NEWLIB_NANO_HEADER=1 -C examples/hello-world/

Output

Without patch:

make TOOLCHAIN=llvm BOARD=samr21-xpro -C examples/hello-world/ info-debug-variable-INCLUDES

-isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/ -nostdinc -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano -I/home/harter/work/git/RIOT/core/include -I/home/harter/work/git/RIOT/drivers/include -I/home/harter/work/git/RIOT/sys/include -I/home/harter/work/git/RIOT/boards/samr21-xpro/include -I/home/harter/work/git/RIOT/cpu/samd21/include -I/home/harter/work/git/RIOT/cpu/sam0_common/include -I/home/harter/work/git/RIOT/cpu/cortexm_common/include -I/home/harter/work/git/RIOT/cpu/cortexm_common/include/vendor -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include-fixed -I/home/harter/work/git/RIOT/sys/libc/include

You can notive that 'newlib-nano' is not in front

With the fix, newlib-nano directory is in front.

-isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/ -nostdinc -I/home/harter/work/git/RIOT/core/include -I/home/harter/work/git/RIOT/drivers/include -I/home/harter/work/git/RIOT/sys/include -I/home/harter/work/git/RIOT/boards/samr21-xpro/include -I/home/harter/work/git/RIOT/cpu/samd21/include -I/home/harter/work/git/RIOT/cpu/sam0_common/include -I/home/harter/work/git/RIOT/cpu/cortexm_common/include -I/home/harter/work/git/RIOT/cpu/cortexm_common/include/vendor -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include -isystem /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include-fixed -I/home/harter/work/git/RIOT/sys/libc/include

Remove first commit before merge

Rebase before merging: This PR includes an arbitrary test for newlib-nano that I do not > want to include in this PR at the end but is required for testing.

Replaced by #9599

Issues/PRs references

Split from #9512

@cladmi cladmi added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Jul 6, 2018
@cladmi cladmi changed the title Pr/make/llvm/nano newlib.mk: llvm, fix newlib-nano header not used Jul 6, 2018
@cladmi cladmi added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 6, 2018
@cladmi cladmi requested review from jnohlgard, kYc0o and smlng July 12, 2018 09:41
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(still) works on macOS, but INCLUDES do not differ from master

INCLUDES: 
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano  
	-I/Volumes/devel/github/smlng/RIOT/core/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/include  
	-I/Volumes/devel/github/smlng/RIOT/boards/samr21-xpro/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/samd21/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/sam0_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include/vendor  
	-I/Volumes/devel/github/smlng/RIOT/sys/libc/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/at86rf2xx/include

@smlng
Copy link
Member

smlng commented Jul 12, 2018

btw. used examples/default and samr21-xpro

@cladmi
Copy link
Contributor Author

cladmi commented Jul 12, 2018

@smlng Can you try the test command in the description to force using llvm ?
Also, it would be cool to see if it is the breakage is indeed detected with only the first commit. There now is the dedicated test tests/libc_newlib.

In the previous state, with llvm and arm for example, newlib-nano include dir
NEWLIB_NANO_INCLUDE_DIR is placed after NEWLIB_INCLUDES and so the default
'newlib.h' is used instead of the nano version.
@cladmi cladmi force-pushed the pr/make/llvm/nano branch from 37adfc3 to f8e1419 Compare July 25, 2018 12:30
@cladmi
Copy link
Contributor Author

cladmi commented Jul 25, 2018

I removed the sanity check commit now that #9599 is merged.

@cladmi cladmi removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Jul 25, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Jul 25, 2018

It is required for enabling llvm support in murdock #9398

@cladmi cladmi added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Jul 31, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Jul 31, 2018

@smlng up, can you retry with TOOLCHAIN=llvm ? I would like to have it in the release

@smlng
Copy link
Member

smlng commented Aug 1, 2018

I retested on macOS but got several issues, used examples/default.

native macOS

includes

make -C examples/default info-build
[...]
INCLUDES: 
	-I/Volumes/devel/github/smlng/RIOT/core/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/include  
	-I/Volumes/devel/github/smlng/RIOT/boards/native/include  
	-DNATIVE_INCLUDES  
	-I/Volumes/devel/github/smlng/RIOT/boards/native/include/  
	-I/Volumes/devel/github/smlng/RIOT/core/include/  
	-I/Volumes/devel/github/smlng/RIOT/drivers/include/  
	-I/Volumes/devel/github/smlng/RIOT/cpu/native/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/native/osx-libc-extra  
	-I/Volumes/devel/github/smlng/RIOT/cpu/native/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/include
[...]

but error when compiling

/RIOT/cpu/native/syscalls.c:278:42: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
        int n = vsnprintf(message, size, format, argp);
                                         ^~~~~~
/usr/include/secure/_stdio.h:75:63: note: expanded from macro 'vsnprintf'
  __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
                                                              ^~~~~~
1 error generated.

setting TOOLCHAIN=llvm explicitly produces the same output and errors, as expected (because llvm is default toolchain for macOS).

However: fails on master, too 😟

samr21-xpro, macOS

Note no toolchain set

includes:

BOARD=samr21-xpro make -C examples/default info-build
[...]
INCLUDES: 
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano  
	-I/Volumes/devel/github/smlng/RIOT/core/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/include  
	-I/Volumes/devel/github/smlng/RIOT/boards/samr21-xpro/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/samd21/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/sam0_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include/vendor  
	-I/Volumes/devel/github/smlng/RIOT/sys/libc/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/at86rf2xx/include
[...]

compiling, all good:

BOARD=samr21-xpro make -C examples/default clean all
Building application "default" for "samr21-xpro" with MCU "samd21".

"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/boards/samr21-xpro
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/core
d"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/samd21
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/cortexm_common
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/periph
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/sam0_common
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/sam0_common/periph
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/samd21/periph
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/at86rf2xx
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/netdev_ieee802154
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/periph_common
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/saul
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init/netif
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init/saul
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/div
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/fmt
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/isrpipe
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/luid
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netapi
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/hdr
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netreg
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pkt
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktbuf
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktbuf_static
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktdump
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/link_layer/ieee802154
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/newlib_syscalls_default
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/od
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/phydat
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/pm_layered
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/ps
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/random
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/random/tinymt32
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/saul_reg
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/shell
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/shell/commands
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/tsrb
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/uart_stdio
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/xtimer
   text	   data	    bss	    dec	    hex	filename
  39488	    508	   6044	  46040	   b3d8	/Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/default.elf

samr21-xpro, macOS, llvm

includes (note: linker is gcc):

TOOLCHAIN=llvm BOARD=samr21-xpro make -C examples/default info-build
[...]
INCLUDES: 
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano  
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/  
	-nostdinc  
	-I/Volumes/devel/github/smlng/RIOT/core/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/include  
	-I/Volumes/devel/github/smlng/RIOT/boards/samr21-xpro/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/samd21/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/sam0_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include  
	-I/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/include/vendor  
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/include  
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/include-fixed  
	-I/Volumes/devel/github/smlng/RIOT/sys/libc/include  
	-I/Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/include  
	-I/Volumes/devel/github/smlng/RIOT/drivers/at86rf2xx/include

CC:      clang
CFLAGS: 
	-Werror  
	-Wno-implicit-fallthrough  
	-mcpu=cortex-m0plus  
	-mlittle-endian  
	-mthumb  
	-mfloat-abi=soft  
	-ffunction-sections  
	-fdata-sections  
	-fno-builtin  
	-fshort-enums  
	-ggdb  
	-g3  
	-Os  
	-target  
	arm-none-eabi  
	-std=c99  
	-fdiagnostics-color  
	-Wstrict-prototypes  
	-Wold-style-definition  
	-fno-common  
	-Wall  
	-Wextra  
	-Wformat=2  
	-Wmissing-include-dirs  
	-include  
	/Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/riotbuild/riotbuild.h  
	-DIEEE802154_DEFAULT_CHANNEL=26

CXX:     clang++
CXXUWFLAGS: 
	-std=%  
	-Wstrict-prototypes  
	-Wold-style-definition
CXXEXFLAGS:

LINK:    arm-none-eabi-gcc
LINKFLAGS: 
	-L/Volumes/devel/github/smlng/RIOT/cpu/samd21/ldscripts  
	-L/Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/ldscripts  
	-Tcortexm.ld  
	-Wl,--fatal-warnings  
	-mcpu=cortex-m0plus  
	-mlittle-endian  
	-mthumb  
	-mfloat-abi=soft  
	-ggdb  
	-g3  
	-Os  
	-static  
	-lgcc  
	-nostartfiles  
	-Wl,--gc-sections  
	-Wl,--defsym=_rom_start_addr=0x00000000  
	-Wl,--defsym=_ram_start_addr=0x20000000  
	-Wl,--defsym=_rom_length=0x40000  
	-Wl,--defsym=_ram_length=0x8000  
	-specs=nano.specs  
	-lc
[...]

compiling

TOOLCHAIN=llvm BOARD=samr21-xpro make -C examples/default clean all
Building application "default" for "samr21-xpro" with MCU "samd21".

"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/boards/samr21-xpro
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/board.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/core
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/core.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/samd21
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/cortexm_common
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/cortexm_common/periph
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/cortexm_common_periph.a the table of contents is empty (no object file members in the library define global symbols)
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/cortexm_common.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/sam0_common
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/sam0_common/periph
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/sam0_common_periph.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/cpu/samd21/periph
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/periph.a the table of contents is empty (no object file members in the library define global symbols)
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/cpu.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/at86rf2xx
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/at86rf2xx.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/netdev_ieee802154
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/netdev_ieee802154.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/periph_common
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/periph_common.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/drivers/saul
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/saul.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init/netif
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/auto_init_gnrc_netif.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/auto_init/saul
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/auto_init_saul.a the table of contents is empty (no object file members in the library define global symbols)
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/auto_init.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/div
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/div.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/fmt
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/fmt.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/isrpipe
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/isrpipe.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/luid
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/luid.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netapi
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_netapi.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_netif.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netif/hdr
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_netif_hdr.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/netreg
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_netreg.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pkt
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_pkt.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktbuf
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_pktbuf.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktbuf_static
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_pktbuf_static.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/gnrc/pktdump
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/gnrc_pktdump.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/net/link_layer/ieee802154
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/ieee802154.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/newlib_syscalls_default
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/newlib_syscalls_default.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/od
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/od.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/phydat
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/phydat.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/pm_layered
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/pm_layered.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/ps
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/ps.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/random
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/random/tinymt32
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/tinymt32.a the table of contents is empty (no object file members in the library define global symbols)
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/random.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/saul_reg
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/saul_reg.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/shell
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/shell.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/shell/commands
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/shell_commands.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/tsrb
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/tsrb.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/uart_stdio
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/uart_stdio.a the table of contents is empty (no object file members in the library define global symbols)
"/Library/Developer/CommandLineTools/usr/bin/make" -C /Volumes/devel/github/smlng/RIOT/sys/xtimer
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/xtimer.a the table of contents is empty (no object file members in the library define global symbols)
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: /Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/application_default.a the table of contents is empty (no object file members in the library define global symbols)
/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol reset_handler_default; defaulting to 0000000000000000
/Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/cpu/vectors.o: In function `dummy_handler':
/Volumes/devel/github/smlng/RIOT/cpu/samd21/vectors.c:28: undefined reference to `dummy_handler_default'
/Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/newlib_syscalls_default/syscalls.o: In function `_init':
/Volumes/devel/github/smlng/RIOT/sys/newlib_syscalls_default/syscalls.c:(.text._init+0x4): undefined reference to `uart_stdio_init'
collect2: error: ld returned 1 exit status
make: *** [/Volumes/devel/github/smlng/RIOT/examples/default/bin/samr21-xpro/default.elf] Error 1

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

native macOS

[…]

setting TOOLCHAIN=llvm explicitly produces the same output and errors, as expected (because llvm is default toolchain for macOS).

However: fails on master, too 😟

It's a known problem. Also irrelevant for this PR since native doesn't use newlib.

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

(the fix is provided within #9398, but I can cherry-pick it out of there if desired)

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

See #9513

@cladmi
Copy link
Contributor Author

cladmi commented Aug 1, 2018

@smlng Thank you for testing and the detailed output, it works as I expected.
I can also use it as reference for the other newlib related PRs.

newlib-nano is correctly before include/ with llvm.

TOOLCHAIN=llvm BOARD=samr21-xpro make -C examples/default info-build
[...]
INCLUDES: 
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/newlib-nano  
	-isystem  
	/usr/local/Caskroom/gcc-arm-embedded/7-2017-q4-major/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/  
	-nostdinc
	-I/Volumes/devel/github/smlng/RIOT/core/include

The other native issue was unrelated and fixed.

I still let you hit merge in case you had any other remarks.

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

(note: linker is gcc)

@cladmi does it make sense to change the LINK and LINKXX variable in llvm.inc.mk in a separate PR?

@cladmi
Copy link
Contributor Author

cladmi commented Aug 1, 2018

@miri64: for me it is on purpose to link with GCC according to the comment, so it should be investigated before changing it:

# LLVM does have a linker, however, it is not entirely
# compatible with GCC. For instance spec files as used in
# `makefiles/libc/newlib.mk` are not supported. Therefore
# we just use GCC for now.
export LINK        = $(PREFIX)gcc
export LINKXX      = $(PREFIX)g++

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

Ah... I did not read the comment ^^"

@miri64
Copy link
Member

miri64 commented Aug 1, 2018

(yepp, linking doesn't work then for newlib-supported boards :-/)

@cladmi
Copy link
Contributor Author

cladmi commented Aug 1, 2018

Then it could be only for non newlib-nano boards if it helps finding bugs, but it would be a task on its own. Lets get murdock building with llvm first.

@cladmi cladmi added this to the Release 2018.07 milestone Aug 1, 2018
miri64 added a commit to miri64/RIOT that referenced this pull request Aug 1, 2018
@cladmi cladmi added the Community: help wanted The contributors require help from other members of the community label Aug 2, 2018
@miri64
Copy link
Member

miri64 commented Aug 2, 2018

I guess this can be merged?!?

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 2, 2018
@miri64
Copy link
Member

miri64 commented Aug 2, 2018

Ping @smlng @cladmi?

@smlng
Copy link
Member

smlng commented Aug 2, 2018

does work on macOS, I get a bit confused with all those newlib PRs open here 😕, the other is #9515 right?

@miri64
Copy link
Member

miri64 commented Aug 2, 2018

I interpret this as a "yes" ;-).

@miri64 miri64 merged commit d4bdac7 into RIOT-OS:master Aug 2, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Aug 2, 2018

@smlng yes the other is a different one for the newly introduced issues. This ones fixed a loooooooong lasting bug.

@cladmi
Copy link
Contributor Author

cladmi commented Aug 2, 2018

Backport provided in #9685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Community: help wanted The contributors require help from other members of the community Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants