From fc22f770aba94a485d27acbf1a5acc73487f9e54 Mon Sep 17 00:00:00 2001 From: Jim Stichnoth Date: Sun, 22 Nov 2015 06:06:34 -0800 Subject: [PATCH] Subzero: Add a makefile config for building with g++. This way, the g++ build for the "make presubmit" target gets a separate build directory, and gets to use ccache. Also, get rid of the "git diff" test, because uncommitted changes are already checked by "git cl upload" and "git cl land". BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1468823002 . --- Makefile.standalone | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile.standalone b/Makefile.standalone index bd65658b8..27578be02 100644 --- a/Makefile.standalone +++ b/Makefile.standalone @@ -96,6 +96,17 @@ else OBJDIR := $(OBJDIR)+Asserts endif +# Use g++ to compile, to check for errors/warnings that clang++ might have +# missed. It's unlikely to link, unless LLVM was also built with g++, so the +# compile_only target should be used. +ifdef GPLUSPLUS + CXX = CCACHE_CPP2=yes $(CCACHE) g++ + STDLIB_FLAGS = + LLVM_EXTRA_WARNINGS="-Wno-unknown-pragmas -Wno-unused-parameter \ + -Wno-comment -Wno-enum-compare -Wno-strict-aliasing" + OBJDIR := $(OBJDIR)+Gplusplus +endif + ifdef UBSAN OBJDIR := $(OBJDIR)+UBSan CXX_EXTRA += -fsanitize=undefined -fno-sanitize=vptr \ @@ -437,16 +448,12 @@ check-presubmit presubmit: # Verify MINIMAL build, plus proper usage of REQUIRES in lit tests. +make -f Makefile.standalone \ MINIMAL=1 check +# Check that there are no g++ build errors or warnings. + +make -f Makefile.standalone \ + GPLUSPLUS=1 compile_only # Check the x86 assembler unit tests. +make -f Makefile.standalone \ DEBUG=1 CHECK_X86_ASM=1 check-unit -# Check that there are no g++ build errors or warnings. - +make -f Makefile.standalone clean - +make -f Makefile.standalone compile_only \ - CXX=g++ STDLIB_FLAGS= \ - LLVM_EXTRA_WARNINGS="-Wno-unknown-pragmas -Wno-unused-parameter \ - -Wno-comment -Wno-enum-compare -Wno-strict-aliasing" - +make -f Makefile.standalone clean # Run spec2k for x86-32. +make -f Makefile.standalone \ check check-spec @@ -465,8 +472,6 @@ check-presubmit presubmit: # Run a few spec2k tests for arm32 using qemu. +make -f Makefile.standalone \ TARGET=arm32 ALLSPEC='176.gcc 181.mcf 254.gap' check-spec -# Verify that all changes are committed (including clang-format above). - git diff --quiet # Provide validation of user awesomeness! echo Success -- 2.11.0