LLVM toolchain: set CFLAGS for pkgs#6752
Conversation
|
btw, we should probably remove the ifeq Darwin stuff and just change the default on Darwin to TOOLCHAIN=llvm, because Apple Xcode is clang/LLVM |
pkg/tinydtls/Makefile.include
Outdated
| ifeq ($(shell uname -s),Darwin) | ||
| CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function | ||
| endif | ||
| ifneq (,$(filter $(TOOLCHAIN),llvm clang)) |
There was a problem hiding this comment.
you don't need to filter, there's an override in Makefile.include which replaces TOOLCHAIN=clang with TOOLCHAIN=llvm if the user sets it.
ifeq ($(TOOLCHAIN),llvm)
...
endif
pkg/oonf_api/Makefile.include
Outdated
| ifeq ($(shell uname -s),Darwin) | ||
| CFLAGS += -Wno-reserved-id-macro -Wno-keyword-macro | ||
| endif | ||
| ifneq (,$(filter $(TOOLCHAIN),llvm clang)) |
There was a problem hiding this comment.
ifeq ($(TOOLCHAIN),llvm)
...
endif
a500d1a to
a326648
Compare
|
@gebart addressed your comments, and took the liberty to pick up your suggestions and set |
pkg/tinydtls/Makefile.include
Outdated
| INCLUDES += -I$(PKG_BUILDDIR) | ||
|
|
||
| ifeq ($(shell uname -s),Darwin) | ||
| ifneq (,$(filter $(TOOLCHAIN),llvm)) |
There was a problem hiding this comment.
Could you replace this with
ifeq ($(TOOLCHAIN), llvm)
You don't need filter since it's not a list.
a326648 to
a6bec45
Compare
|
@gebart comments addressed. |
pkg/oonf_api/Makefile.include
Outdated
| ifeq ($(shell uname -s),Darwin) | ||
| CFLAGS += -Wno-reserved-id-macro -Wno-keyword-macro | ||
| ifeq ($(TOOLCHAIN), llvm) | ||
| CFLAGS += -Wno-reserved-id-macro -Wno-keyword-macro -Wno-parentheses-equality |
There was a problem hiding this comment.
What is the error you get if you don't have -Wno-parentheses-equality and -Wno-reserved-id-macro?
I only need -Wno-keyword-macro to build this with Clang (clang version 4.0.0 (tags/RELEASE_400/final))
|
@gebart btw. there is a problem when setting [edit]: hence I think we have to revert this and fix later. |
|
Regarding MacOS, add a check for BOARD=native as well |
a6bec45 to
72e90ae
Compare
Makefile.include
Outdated
| # Use TOOLCHAIN environment variable to select the toolchain to use. | ||
| # Default: gnu | ||
| # Default for macOS: llvm; for other OS: gnu | ||
| ifeq ($(BOARD)$(OS),nativeDarwin) |
There was a problem hiding this comment.
please do this in two steps instead:
ifeq ($(BOARD),native)
ifeq ($(OS),Darwin)
TOOLCHAIN ?= llvm
endif
endif
TOOLCHAIN ?= gnuSince we set TOOLCHAIN with ?= we don't need to do it in an else statement, it will not overwrite the value set inside the if block.
- set no-keyword-macro
- set no-parentheses-equality
- set no-gnu-zero-variadic-macro-arguments
- set no-unused-function
72e90ae to
53b0dd1
Compare
set CFLAGS for packages oonf_api and tinydtls to work around compiler errors when using llvm toolchain on Linux. Is also required by #6600 ...