Files
xen/config/StdGNU.mk
T
Tim Deegan a7721bee28 Automatically check xen's public headers for C++ pitfalls.
Add a check, like the existing check for non-ANSI C in the public
headers, that runs the public headers through a C++ compiler to
flag non-C++-friendly constructs.

Unlike the ANSI C check, we accept GCC-isms (gnu++98), and we also
check various tools-only headers.

Also tidy up the runes for these checks to be a bit more readable.

io/ring.h uses 'private' as a field name, which is a keyword in C++;
this patch doesn't change that.  Instead the check works around it.

Reported-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <JBeulich@suse.com>
Tested-by: Don Slutz <dslutz@verizon.com>
2015-02-27 09:46:34 +00:00

50 lines
1.1 KiB
Makefile

AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
ifeq ($(clang),y)
CC = $(CROSS_COMPILE)clang
CXX = $(CROSS_COMPILE)clang++
LD_LTO = $(CROSS_COMPILE)llvm-ld
else
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
LD_LTO = $(CROSS_COMPILE)ld
endif
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
SIZEUTIL = $(CROSS_COMPILE)size
# Allow git to be wrappered in the environment
GIT ?= git
INSTALL = install
INSTALL_DIR = $(INSTALL) -d -m0755 -p
INSTALL_DATA = $(INSTALL) -m0644 -p
INSTALL_PROG = $(INSTALL) -m0755 -p
BOOT_DIR ?= /boot
SOCKET_LIBS =
UTIL_LIBS = -lutil
DLOPEN_LIBS = -ldl
SONAME_LDFLAG = -soname
SHLIB_LDFLAGS = -shared
ifneq ($(debug),y)
CFLAGS += -O2 -fomit-frame-pointer
else
# Less than -O1 produces bad code and large stack frames
CFLAGS += -O1 -fno-omit-frame-pointer
CFLAGS-$(gcc) += -fno-optimize-sibling-calls
endif
ifeq ($(lto),y)
CFLAGS += -flto
LDFLAGS-$(clang) += -plugin LLVMgold.so
endif