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 11aa76e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 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,6 +79,10 @@ CXXINCLUDES-$(CONFIG_LIBCOMPILER_RT) += -I$(LIBCOMPILER_RT_SRC)/include
# Global flags
################################################################################

ifeq ($(CLANG_CHECK), 1)
LIBCOMPILER_RT_SUPRESS_FLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized
endif

LIBCOMPILER_RT_SUPPRESS_FLAGS += -Wno-unused-parameter -Wno-builtin-declaration-mismatch
LIBCOMPILER_RT_CFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS)
LIBCOMPILER_RT_CXXFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS)
Expand Down

0 comments on commit 11aa76e

Please sign in to comment.