Skip to content

Commit

Permalink
Makefile.uk: Don't add unsupported warnings when built with clang
Browse files Browse the repository at this point in the history
GitHub-Fixes: unikraft#1

Co-authored-by: Nikos Oikonomou <[email protected]>
Signed-off-by: Nikos Oikonomou <[email protected]>
Signed-off-by: Groute <[email protected]>
  • Loading branch information
ntua-el20014 authored and iAmGroute committed Mar 31, 2023
1 parent 60ba9f5 commit 6bbb7a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ $(error Require libunwind)
endif
endif

CLANG_CHECK = 0
cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
ifeq ($(cc-name), clang)
CLANG_CHECK = 1
endif
export CLANG_CHECK


################################################################################
# Sources
################################################################################
Expand Down Expand Up @@ -71,7 +79,10 @@ CXXINCLUDES-$(CONFIG_LIBCOMPILER_RT) += -I$(LIBCOMPILER_RT_SRC)/include
# Global flags
################################################################################

LIBCOMPILER_RT_SUPPRESS_FLAGS += -Wno-unused-parameter -Wno-builtin-declaration-mismatch
ifeq ($(CLANG_CHECK), 0)
LIBCOMPILER_RT_SUPPRESS_FLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-builtin-declaration-mismatch
endif
LIBCOMPILER_RT_SUPPRESS_FLAGS += -Wno-unused-parameter
LIBCOMPILER_RT_CFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS)
LIBCOMPILER_RT_CXXFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS)

Expand Down

0 comments on commit 6bbb7a2

Please sign in to comment.