From 483691dd73e5260fac958c524e0a12e705db43f6 Mon Sep 17 00:00:00 2001 From: Donald Kjer Date: Tue, 17 Aug 2021 14:12:12 -0700 Subject: Fixes for clang not being able to run unit tests (#13546) --- tmk_core/native.mk | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tmk_core/native.mk') diff --git a/tmk_core/native.mk b/tmk_core/native.mk index 3caf644546..f609fd0e6f 100644 --- a/tmk_core/native.mk +++ b/tmk_core/native.mk @@ -1,4 +1,5 @@ SYSTEM_TYPE := $(shell gcc -dumpmachine) +GCC_VERSION := $(shell gcc --version 2>/dev/null) CC = gcc OBJCOPY = @@ -12,7 +13,9 @@ BIN = COMPILEFLAGS += -funsigned-char +ifeq ($(findstring clang, ${GCC_VERSION}),) COMPILEFLAGS += -funsigned-bitfields +endif COMPILEFLAGS += -ffunction-sections COMPILEFLAGS += -fdata-sections COMPILEFLAGS += -fshort-enums @@ -21,7 +24,9 @@ COMPILEFLAGS += -mno-ms-bitfields endif CFLAGS += $(COMPILEFLAGS) +ifeq ($(findstring clang, ${GCC_VERSION}),) CFLAGS += -fno-inline-small-functions +endif CFLAGS += -fno-strict-aliasing CXXFLAGS += $(COMPILEFLAGS) -- cgit v1.2.3