Skip to content

Commit 86ee57c

Browse files
authored
Merge pull request #35561 from JuliaLang/jn/gcchecker-tests
[GCChecker] fix tests and add Makefile
2 parents ea669c3 + ad25da2 commit 86ee57c

File tree

8 files changed

+1499
-1284
lines changed

8 files changed

+1499
-1284
lines changed

Make.inc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,25 @@ ifeq ($(USE_SYSTEM_LIBM),1)
13011301
USE_BINARYBUILDER_OPENLIBM := 0
13021302
endif
13031303

1304+
1305+
# Note: we're passing *FLAGS here computed based on your system compiler to
1306+
# clang. If that causes you problems, you might want to build and/or run
1307+
# specific clang-sa-* files with clang explicitly selected:
1308+
# make CC=~+/../usr/tools/clang CXX=~+/../usr/tools/clang USECLANG=1 analyzegc
1309+
# make USECLANG=1 clang-sa-*
1310+
CLANGSA_FLAGS :=
1311+
CLANGSA_CXXFLAGS :=
1312+
ifeq ($(OS), Darwin) # on new XCode, the files are hidden
1313+
CLANGSA_FLAGS += -isysroot $(shell xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
1314+
CLANGSA_CXXFLAGS += -isystem $(shell xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
1315+
endif
1316+
ifeq ($(USEGCC),1)
1317+
# try to help clang find the c++ files for CC by guessing the value for --prefix
1318+
# by dropping lib/gcc/<platform>/<version> from the install directory it reports
1319+
CLANGSA_CXXFLAGS += --gcc-toolchain="$(abspath $(shell LANG=C $(CC) -print-search-dirs | grep '^install: ' | sed -e "s/^install: //")/../../../..)"
1320+
endif
1321+
1322+
13041323
# Make tricks
13051324

13061325
define dir_target

src/Makefile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -372,24 +372,6 @@ ifneq ($(BUILD_LLVM_CLANG),1)
372372
endif
373373
endif
374374

375-
376-
# Note: we're passing *FLAGS here computed based on your system compiler to
377-
# clang. If that causes you problems, you might want to build and/or run
378-
# specific clang-sa-* files with clang explicitly selected:
379-
# make CC=~+/../usr/tools/clang CXX=~+/../usr/tools/clang USECLANG=1 analyzegc
380-
# make USECLANG=1 clang-sa-*
381-
CLANGSA_FLAGS :=
382-
CLANGSA_CXXFLAGS :=
383-
ifeq ($(OS), Darwin) # on new XCode, the files are hidden
384-
CLANGSA_FLAGS += -isysroot $(shell xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
385-
CLANGSA_CXXFLAGS += -isystem $(shell xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
386-
endif
387-
ifeq ($(USEGCC),1)
388-
# try to help clang find the c++ files for CC by guessing the value for --prefix
389-
# by dropping lib/gcc/<platform>/<version> from the install directory it reports
390-
CLANGSA_CXXFLAGS += --gcc-toolchain="$(abspath $(shell LANG=C $(CC) -print-search-dirs | grep '^install: ' | sed -e "s/^install: //")/../../../..)"
391-
endif
392-
393375
clang-sa-%: $(SRCDIR)/%.c $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) | analyzegc-deps-check
394376
@$(call PRINT_ANALYZE, $(build_depsbindir)/clang --analyze -Xanalyzer -analyzer-werror -Xanalyzer -analyzer-output=text -Xclang -load -Xclang $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) $(CLANGSA_FLAGS) $(JCPPFLAGS) $(JCFLAGS) $(DEBUGFLAGS) -Xclang -analyzer-checker=core$(COMMA)julia.GCChecker --analyzer-no-default-checks -fcolor-diagnostics -Werror -x c $<)
395377
clang-sa-%: $(SRCDIR)/%.cpp $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) | analyzegc-deps-check

0 commit comments

Comments
 (0)