diff options
author | Tobias Bosch <tbosch@google.com> | 2019-07-15 12:22:50 -0700 |
---|---|---|
committer | Tobias Bosch <tbosch@google.com> | 2019-07-18 09:09:26 +0000 |
commit | 3d89c0b95331323feafcf12181f44ca26bdeb96d (patch) | |
tree | ebbbb6cdae92f550a642aaf9d3c9f4432bb847db /compiler_wrapper | |
parent | 198a3c9519e5d93ffeb8f5e1b6694c34b178c5c4 (diff) | |
download | toolchain-utils-3d89c0b95331323feafcf12181f44ca26bdeb96d.tar.gz |
Create golden tests for sysroot wrapper.
- Golden files can be updated via the new "-updategolden" test flag.
- Golden files contain the wrapper command, commands executed by the wrapper
stdout, stderr, exitcode of the wrapper
- The commands in the golden files are also compared to the old wrapper
to make sure they are correct. We are also mocking less things in
the old wrapper now, allowing to compare against differnet wrappers via
golden tests in the future (e.g. clang_host_wrapper).
- Unit tests are no longer diffing against the old wrapper.
BUG=chromium:773875
TEST=unit test
Change-Id: I0755bfe11cd499474820c9354412d39a0fa04401
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1702633
Tested-by: Tobias Bosch <tbosch@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/config.go | 2 | ||||
-rw-r--r-- | compiler_wrapper/config_test.go | 88 | ||||
-rw-r--r-- | compiler_wrapper/cros_hardened_config_test.go | 432 | ||||
-rw-r--r-- | compiler_wrapper/cros_nonhardened_config_test.go | 17 | ||||
-rw-r--r-- | compiler_wrapper/goldenutil_test.go | 189 | ||||
-rw-r--r-- | compiler_wrapper/main.go | 7 | ||||
-rw-r--r-- | compiler_wrapper/oldwrapper.go | 36 | ||||
-rw-r--r-- | compiler_wrapper/testdata/cros_hardened_golden.json | 3796 | ||||
-rw-r--r-- | compiler_wrapper/testdata/cros_hardened_noccache_golden.json | 1247 | ||||
-rw-r--r-- | compiler_wrapper/testdata/cros_nonhardened_golden.json | 3290 | ||||
-rw-r--r-- | compiler_wrapper/testutil_test.go | 22 |
11 files changed, 8996 insertions, 130 deletions
diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 45e82575..93a8cc53 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -19,8 +19,6 @@ type config struct { oldWrapperPath string // Whether to mock out the calls that the old wrapper does. mockOldWrapperCmds bool - // Whether to overwrite the config in the old wrapper. - overwriteOldWrapperCfg bool // Directory to store errors that were prevented with -Wno-error. newWarningsDir string } diff --git a/compiler_wrapper/config_test.go b/compiler_wrapper/config_test.go index 5578baf0..fd0763a8 100644 --- a/compiler_wrapper/config_test.go +++ b/compiler_wrapper/config_test.go @@ -1,85 +1,9 @@ package main import ( - "path/filepath" "testing" ) -func TestFullHardeningConfigAndGcc(t *testing.T) { - withTestContext(t, func(ctx *testContext) { - initFullHardeningConfig(ctx) - cmd := ctx.must(callCompiler(ctx, ctx.cfg, - ctx.newCommand(gccX86_64, mainCc))) - if err := verifyPath(cmd, "/usr/bin/ccache"); err != nil { - t.Error(err) - } - if err := verifyArgOrder(cmd, gccX86_64+".real", "--sysroot=/usr/x86_64-cros-linux-gnu", "-fno-reorder-blocks-and-partition", - "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fstack-protector-strong", "-fPIE", "-pie", "-D_FORTIFY_SOURCE=2", - "-fno-omit-frame-pointer", "main.cc", "-mno-movbe"); err != nil { - t.Error(err) - } - }) -} - -func TestFullHardeningConfigAndClang(t *testing.T) { - withTestContext(t, func(ctx *testContext) { - initFullHardeningConfig(ctx) - cmd := ctx.must(callCompiler(ctx, ctx.cfg, - ctx.newCommand(clangX86_64, mainCc))) - if err := verifyPath(cmd, "/usr/bin/ccache"); err != nil { - t.Error(err) - } - clangPath, err := filepath.Rel(ctx.tempDir, "/usr/bin/clang") - if err != nil { - t.Error(err) - } - binPath, err := filepath.Rel(ctx.tempDir, "/bin") - if err := verifyArgOrder(cmd, clangPath, "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", "-grecord-gcc-switches", - "-fno-addrsig", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", - "-Wno-section", "-fstack-protector-strong", "-fPIE", "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "main.cc", - "-B"+binPath, "-target", "x86_64-cros-linux-gnu"); err != nil { - t.Error(err) - } - }) -} - -func TestNonHardeningConfigAndGcc(t *testing.T) { - withTestContext(t, func(ctx *testContext) { - initNonHardeningConfig(ctx) - cmd := ctx.must(callCompiler(ctx, ctx.cfg, - ctx.newCommand(gccX86_64, mainCc))) - if err := verifyPath(cmd, "/usr/bin/ccache"); err != nil { - t.Error(err) - } - if err := verifyArgOrder(cmd, gccX86_64+".real", "--sysroot=/usr/x86_64-cros-linux-gnu", - "-Wno-maybe-uninitialized", "-Wno-unused-local-typedefs", "-Wno-deprecated-declarations", - "-Wtrampolines", "main.cc", "-mno-movbe"); err != nil { - t.Error(err) - } - }) -} - -func TestNonHardeningConfigAndClang(t *testing.T) { - withTestContext(t, func(ctx *testContext) { - initNonHardeningConfig(ctx) - cmd := ctx.must(callCompiler(ctx, ctx.cfg, - ctx.newCommand(clangX86_64, mainCc))) - if err := verifyPath(cmd, "/usr/bin/ccache"); err != nil { - t.Error(err) - } - clangPath, err := filepath.Rel(ctx.tempDir, "/usr/bin/clang") - if err != nil { - t.Error(err) - } - binPath, err := filepath.Rel(ctx.tempDir, "/bin") - if err := verifyArgOrder(cmd, clangPath, "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", - "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-unknown-warning-option", "-Wno-section", "main.cc", "-B"+binPath, "-target", "x86_64-cros-linux-gnu"); err != nil { - t.Error(err) - } - }) -} - func TestRealConfigWithUseCCacheFlag(t *testing.T) { resetGlobals() defer resetGlobals() @@ -149,18 +73,6 @@ func isHardened(cfg *config) bool { return false } -func initFullHardeningConfig(ctx *testContext) { - useCCache := true - ctx.updateConfig(oldHardenedWrapperPathForTest, getCrosHardenedConfig(useCCache)) - ctx.cfg.overwriteOldWrapperCfg = false -} - -func initNonHardeningConfig(ctx *testContext) { - useCCache := true - ctx.updateConfig(oldNonHardenedWrapperPathForTest, getCrosNonHardenedConfig(useCCache)) - ctx.cfg.overwriteOldWrapperCfg = false -} - func resetGlobals() { // Set all global variables to a defined state. ConfigName = "unknown" diff --git a/compiler_wrapper/cros_hardened_config_test.go b/compiler_wrapper/cros_hardened_config_test.go new file mode 100644 index 00000000..2efcc403 --- /dev/null +++ b/compiler_wrapper/cros_hardened_config_test.go @@ -0,0 +1,432 @@ +package main + +import ( + "fmt" + "io/ioutil" + "path" + "path/filepath" + "regexp" + "testing" +) + +const oldHardenedWrapperPathForTest = "/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/gcc-bin/4.9.x/sysroot_wrapper.hardened" +const crosHardenedGoldenFile = "testdata/cros_hardened_golden.json" +const crosHardenedNoCCacheGoldenFile = "testdata/cros_hardened_noccache_golden.json" + +func TestCrosHardenedConfig(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + useCCache := true + ctx.updateConfig(oldHardenedWrapperPathForTest, getCrosHardenedConfig(useCCache)) + + runGoldenRecords(ctx, crosHardenedGoldenFile, createSyswrapperGoldenInputs(ctx)) + }) +} + +func TestCrosHardenedConfigWithoutCCache(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + useCCache := false + ctx.updateConfig(oldHardenedWrapperPathForTest, getCrosHardenedConfig(useCCache)) + + // Create a copy of the old wrapper where the CCACHE_DEFAULT is false. + if ctx.cfg.oldWrapperPath != "" { + oldWrapperContent, err := ioutil.ReadFile(ctx.cfg.oldWrapperPath) + if err != nil { + t.Fatal(err) + } + oldWrapperContent = regexp.MustCompile(`True\s+#\s+@CCACHE_DEFAULT@`).ReplaceAll(oldWrapperContent, []byte("False #")) + ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "oldwrapper_noccache") + if err := ioutil.WriteFile(ctx.cfg.oldWrapperPath, oldWrapperContent, 0666); err != nil { + t.Fatal(err) + } + } + + // Only run the subset of the sysroot wrapper tests that execute commands. + gomaPath := path.Join(ctx.tempDir, "gomacc") + ctx.writeFile(gomaPath, "") + gomaEnv := "GOMACC_PATH=" + gomaPath + runGoldenRecords(ctx, crosHardenedNoCCacheGoldenFile, []goldenRecordSection{ + createGccPathGoldenInputs(gomaEnv), + createClangPathGoldenInputs(gomaEnv), + createClangSyntaxGoldenInputs(gomaEnv), + createBisectGoldenInputs(), + createForceDisableWErrorGoldenInputs(), + createClangTidyGoldenInputs(gomaEnv), + }) + }) +} + +func createSyswrapperGoldenInputs(ctx *testContext) []goldenRecordSection { + gomaPath := path.Join(ctx.tempDir, "gomacc") + ctx.writeFile(gomaPath, "") + gomaEnv := "GOMACC_PATH=" + gomaPath + + return []goldenRecordSection{ + createGccPathGoldenInputs(gomaEnv), + createGoldenInputsForAllTargets("gcc", mainCc), + createSysrootWrapperCommonGoldenInputs("gcc", gomaEnv), + { + Name: "gcc specific args", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(gccX86_64, "-march=goldmont", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(gccX86_64, "-march=goldmont-plus", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(gccX86_64, "-march=skylake", mainCc), + Cmds: okResults, + }, + }, + }, + createClangSyntaxGoldenInputs(gomaEnv), + createClangPathGoldenInputs(gomaEnv), + createGoldenInputsForAllTargets("clang", mainCc), + createGoldenInputsForAllTargets("clang", "-ftrapv", mainCc), + createSysrootWrapperCommonGoldenInputs("clang", gomaEnv), + { + Name: "clang specific args", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(clangX86_64, "-mno-movbe", "-pass-exit-codes", "-Wclobbered", "-Wno-psabi", "-Wlogical-op", + "-Wmissing-parameter-type", "-Wold-style-declaration", "-Woverride-init", "-Wunsafe-loop-optimizations", + "-Wstrict-aliasing=abc", "-finline-limit=abc", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-error=cpp", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-error=maybe-uninitialized", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-error=unused-but-set-variable", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-unused-but-set-variable", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Wunused-but-set-variable", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Xclang-only=-someflag", mainCc), + Cmds: okResults, + }, + }, + }, + createBisectGoldenInputs(), + createForceDisableWErrorGoldenInputs(), + createClangTidyGoldenInputs(gomaEnv), + } +} + +func createGoldenInputsForAllTargets(compiler string, args ...string) goldenRecordSection { + return goldenRecordSection{ + Name: fmt.Sprintf("%s %s target specific", compiler, args), + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-eabi-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./x86_64-cros-win-gnu-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv7m-cros-linux-gnu-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv7m-cros-linux-eabi-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv7m-cros-win-gnu-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv8m-cros-linux-gnu-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv8m-cros-linux-eabi-"+compiler, args...), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./armv8m-cros-win-gnu-"+compiler, args...), + Cmds: okResults, + }, + }, + } +} + +func createBisectGoldenInputs() goldenRecordSection { + return goldenRecordSection{ + Name: "bisect", + // Disable comparing to the old wrapper as that calls the bisect_driver + // directly from python, and the new wrapper calls it via a separate + // sub command. + ignoreOldWrapper: true, + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir", + }, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir", + }, + Cmds: errorResults, + }, + }, + } +} + +func createForceDisableWErrorGoldenInputs() goldenRecordSection { + return goldenRecordSection{ + Name: "force disable werror", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{"FORCE_DISABLE_WERROR=1"}, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{"FORCE_DISABLE_WERROR=1"}, + Cmds: []commandResult{ + { + Stderr: "-Werror originalerror", + ExitCode: 1, + }, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{"FORCE_DISABLE_WERROR=1"}, + Cmds: []commandResult{ + { + Stderr: "-Werror originalerror", + ExitCode: 1, + }, + errorResult, + }, + }, + }, + } +} + +func createGccPathGoldenInputs(gomaEnv string) goldenRecordSection { + return goldenRecordSection{ + Name: "gcc path", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-gcc", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-gcc", mainCc), + Cmds: errorResults, + }, + }, + } +} + +func createClangPathGoldenInputs(gomaEnv string) goldenRecordSection { + return goldenRecordSection{ + Name: "clang path", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-clang", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-clang", mainCc), + Cmds: errorResults, + }, + { + WrapperCmd: newGoldenCmd("./x86_64-cros-linux-gnu-clang++", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{"CLANG=somepath/clang"}, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Xclang-path=/somedir", mainCc), + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Xclang-path=/somedir", mainCc), + Env: []string{gomaEnv}, + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, "-Xclang-path=/somedir", mainCc), + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + errorResult, + }, + }, + }, + } +} + +func createClangTidyGoldenInputs(gomaEnv string) goldenRecordSection { + tidyEnv := "WITH_TIDY=1" + return goldenRecordSection{ + Name: "clang-tidy", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{tidyEnv}, + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + okResult, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{tidyEnv, gomaEnv}, + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + okResult, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{tidyEnv, gomaEnv}, + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + errorResult, + // TODO: we don't fail the compilation due to clang-tidy, as that + // is the behavior in the old wrapper. Consider changing this in + // the future. + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(clangX86_64, mainCc), + Env: []string{tidyEnv, gomaEnv}, + Cmds: []commandResult{ + {Stdout: "someResourceDir"}, + okResult, + errorResult, + }, + }, + }, + } +} + +func createClangSyntaxGoldenInputs(gomaEnv string) goldenRecordSection { + return goldenRecordSection{ + Name: "gcc clang-syntax", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(gccX86_64, "-clang-syntax", mainCc), + Cmds: []commandResult{ + okResult, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(gccX86_64, "-clang-syntax", mainCc), + Env: []string{gomaEnv}, + Cmds: []commandResult{ + okResult, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(gccX86_64, "-clang-syntax", mainCc), + Cmds: errorResults, + }, + { + WrapperCmd: newGoldenCmd(gccX86_64, "-clang-syntax", mainCc), + Cmds: []commandResult{ + okResult, + errorResult, + }, + }, + }, + } +} + +func createSysrootWrapperCommonGoldenInputs(compiler string, gomaEnv string) goldenRecordSection { + // We are using a fixed target as all of the following args are target independent. + wrapperPath := "./x86_64-cros-linux-gnu-" + compiler + return goldenRecordSection{ + Name: compiler + " sysroot wrapper common", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(gccX86_64, "-noccache", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, mainCc), + Env: []string{"GOMACC_PATH=someNonExistingPath"}, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, mainCc), + Env: []string{gomaEnv}, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-nopie", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-D__KERNEL__", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-fsanitize=kernel-address", "-Wl,--no-undefined", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-fsanitize=kernel-address", "-Wl,-z,defs", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-fsanitize=kernel-address", "-D_FORTIFY_SOURCE=1", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "-fsanitize=kernel-address", "-D_FORTIFY_SOURCE=2", mainCc), + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(wrapperPath, "--sysroot=xyz", mainCc), + Cmds: okResults, + }, + }, + } +} diff --git a/compiler_wrapper/cros_nonhardened_config_test.go b/compiler_wrapper/cros_nonhardened_config_test.go new file mode 100644 index 00000000..6f677d06 --- /dev/null +++ b/compiler_wrapper/cros_nonhardened_config_test.go @@ -0,0 +1,17 @@ +package main + +import ( + "testing" +) + +const oldNonHardenedWrapperPathForTest = "/usr/x86_64-pc-linux-gnu/arm-none-eabi/gcc-bin/4.9.x/sysroot_wrapper" +const crosNonHardenedGoldenFile = "testdata/cros_nonhardened_golden.json" + +func TestCrosNonHardenedConfig(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + useCCache := true + ctx.updateConfig(oldNonHardenedWrapperPathForTest, getCrosNonHardenedConfig(useCCache)) + + runGoldenRecords(ctx, crosNonHardenedGoldenFile, createSyswrapperGoldenInputs(ctx)) + }) +} diff --git a/compiler_wrapper/goldenutil_test.go b/compiler_wrapper/goldenutil_test.go new file mode 100644 index 00000000..d5d1ec28 --- /dev/null +++ b/compiler_wrapper/goldenutil_test.go @@ -0,0 +1,189 @@ +package main + +import ( + "bytes" + "encoding/json" + "flag" + "io" + "io/ioutil" + "log" + "os" + "path/filepath" + "regexp" + "strings" +) + +var updateGoldenFiles = flag.Bool("updategolden", false, "update golden files") +var filterGoldenTests = flag.String("rungolden", "", "regex filter for golden tests to run") + +type goldenRecordSection struct { + Name string `json:"name"` + ignoreOldWrapper bool + Records []goldenRecord `json:"records"` +} + +type goldenRecord struct { + Wd string `json:"wd"` + Env []string `json:"env,omitempty"` + // runGoldenRecords will read cmd and fill + // stdout, stderr, exitCode. + WrapperCmd commandResult `json:"wrapper"` + // runGoldenRecords will read stdout, stderr, err + // and fill cmd + Cmds []commandResult `json:"cmds"` +} + +func newGoldenCmd(path string, args ...string) commandResult { + return commandResult{ + Cmd: &command{ + Path: path, + Args: args, + }, + } +} + +var okResult = commandResult{} +var okResults = []commandResult{okResult} +var errorResult = commandResult{ + ExitCode: 1, + Stderr: "someerror", + Stdout: "somemessage", +} +var errorResults = []commandResult{errorResult} + +func runGoldenRecords(ctx *testContext, goldenFile string, sections []goldenRecordSection) { + if filterPattern := *filterGoldenTests; filterPattern != "" { + sections = filterGoldenRecords(filterPattern, sections) + } + if len(sections) == 0 { + ctx.t.Errorf("No goldenrecords given.") + return + } + sections = fillGoldenResults(ctx, sections) + if *updateGoldenFiles { + log.Printf("updating golden file under %s", goldenFile) + if err := os.MkdirAll(filepath.Dir(goldenFile), 0777); err != nil { + ctx.t.Fatal(err) + } + goldenFile, err := os.Create(goldenFile) + if err != nil { + ctx.t.Fatal(err) + } + defer goldenFile.Close() + + writeGoldenRecords(ctx, goldenFile, sections) + } else { + compareBuffer := &bytes.Buffer{} + writeGoldenRecords(ctx, compareBuffer, sections) + goldenFileData, err := ioutil.ReadFile(goldenFile) + if err != nil { + ctx.t.Fatal(err) + } + if !bytes.Equal(compareBuffer.Bytes(), goldenFileData) { + ctx.t.Fatalf("Commands don't match the golden file under %s. Please regenerate via -updategolden to check the differences.", + goldenFile) + } + } +} + +func filterGoldenRecords(pattern string, sections []goldenRecordSection) []goldenRecordSection { + matcher := regexp.MustCompile(pattern) + newSections := []goldenRecordSection{} + for _, section := range sections { + newRecords := []goldenRecord{} + for _, record := range section.Records { + cmd := record.WrapperCmd.Cmd + str := strings.Join(append(append(record.Env, cmd.Path), cmd.Args...), " ") + if matcher.MatchString(str) { + newRecords = append(newRecords, record) + } + } + section.Records = newRecords + newSections = append(newSections, section) + } + return newSections +} + +func fillGoldenResults(ctx *testContext, sections []goldenRecordSection) []goldenRecordSection { + oldWrapperPath := ctx.cfg.oldWrapperPath + newSections := []goldenRecordSection{} + for _, section := range sections { + ctx.cfg.oldWrapperPath = oldWrapperPath + if section.ignoreOldWrapper { + ctx.cfg.oldWrapperPath = "" + } + + newRecords := []goldenRecord{} + for _, record := range section.Records { + newCmds := []commandResult{} + ctx.cmdMock = func(cmd *command, stdout io.Writer, stderr io.Writer) error { + if len(newCmds) >= len(record.Cmds) { + ctx.t.Errorf("Not enough commands specified for wrapperCmd %#v and env %#v. Expected: %#v", + record.WrapperCmd.Cmd, record.Env, record.Cmds) + return nil + } + cmdResult := record.Cmds[len(newCmds)] + cmdResult.Cmd = cmd + newCmds = append(newCmds, cmdResult) + io.WriteString(stdout, cmdResult.Stdout) + io.WriteString(stderr, cmdResult.Stderr) + if cmdResult.ExitCode != 0 { + return newExitCodeError(cmdResult.ExitCode) + } + return nil + } + ctx.stdoutBuffer.Reset() + ctx.stderrBuffer.Reset() + ctx.env = record.Env + if record.Wd == "" { + record.Wd = ctx.tempDir + } + ctx.wd = record.Wd + // Create an empty wrapper at the given path. + // Needed as we are resolving symlinks which stats the wrapper file. + ctx.writeFile(record.WrapperCmd.Cmd.Path, "") + record.WrapperCmd.ExitCode = callCompiler(ctx, ctx.cfg, record.WrapperCmd.Cmd) + if hasInternalError(ctx.stderrString()) { + ctx.t.Errorf("found an internal error for wrapperCmd %#v and env #%v. Got: %s", + record.WrapperCmd.Cmd, record.Env, ctx.stderrString()) + } + if len(newCmds) < len(record.Cmds) { + ctx.t.Errorf("Too many commands specified for wrapperCmd %#v and env %#v. Expected: %#v", + record.WrapperCmd.Cmd, record.Env, record.Cmds) + } + record.Cmds = newCmds + record.WrapperCmd.Stdout = ctx.stdoutString() + record.WrapperCmd.Stderr = ctx.stderrString() + newRecords = append(newRecords, record) + } + section.Records = newRecords + newSections = append(newSections, section) + } + return newSections +} + +func writeGoldenRecords(ctx *testContext, writer io.Writer, sections []goldenRecordSection) { + // Replace the temp dir with a stable path so that the goldens stay stable. + stableTempDir := filepath.Join(filepath.Dir(ctx.tempDir), "stable") + writer = &replacingWriter{ + Writer: writer, + old: []byte(ctx.tempDir), + new: []byte(stableTempDir), + } + enc := json.NewEncoder(writer) + enc.SetIndent("", " ") + if err := enc.Encode(sections); err != nil { + ctx.t.Fatal(err) + } +} + +type replacingWriter struct { + io.Writer + old []byte + new []byte +} + +func (writer *replacingWriter) Write(p []byte) (n int, err error) { + p = bytes.ReplaceAll(p, writer.old, writer.new) + return writer.Writer.Write(p) +} diff --git a/compiler_wrapper/main.go b/compiler_wrapper/main.go index 10132543..8cb26158 100644 --- a/compiler_wrapper/main.go +++ b/compiler_wrapper/main.go @@ -9,11 +9,14 @@ // // Test arguments: // - crosroot: Specifies the ChromeOS toolchain root directory (aka chroot). -// If this is given, tests will compare the produced commands against the +// If this is given, golden tests will compare the produced commands against the // old compiler wrapper. +// - updategolden: To update the golden results for the wrapper. Without it, +// the tests will verify that the wrapper output matches the goldens. +// - rungolden: To filter the golden tests by a regex for the wrapper env, path and args. // // Examples: -// - run all tests and compare output against old compiler wrapper: +// - run all tests and compare golden output against old compiler wrapper: // go test third_party/toolchain-utils/compiler_wrapper/ -v --crosroot=$HOME/chromiumos/chroot/ // - run all tests in isolation: // go test third_party/toolchain-utils/compiler_wrapper/ -v diff --git a/compiler_wrapper/oldwrapper.go b/compiler_wrapper/oldwrapper.go index a6324400..45997551 100644 --- a/compiler_wrapper/oldwrapper.go +++ b/compiler_wrapper/oldwrapper.go @@ -8,7 +8,6 @@ import ( "os" "path/filepath" "reflect" - "regexp" "sort" "strings" "text/template" @@ -31,7 +30,6 @@ func compareToOldWrapper(env env, cfg *config, inputCmd *command, newCmdResults }) newCmds = append(newCmds, cmdResult.Cmd) } - oldWrapperCfg.OverwriteConfig = cfg.overwriteOldWrapperCfg stderrBuffer := bytes.Buffer{} oldExitCode, err := callOldWrapper(env, oldWrapperCfg, inputCmd, compareToOldWrapperFilePattern, &bytes.Buffer{}, &stderrBuffer) @@ -115,10 +113,15 @@ func diffCommands(oldCmds []*command, newCmds []*command) string { // Sort the environment as we don't care in which order // it was modified. - newEnvUpdates := newCmd.EnvUpdates - sort.Strings(newEnvUpdates) - oldEnvUpdates := oldCmd.EnvUpdates - sort.Strings(oldEnvUpdates) + copyAndSort := func(data []string) []string { + result := make([]string, len(data)) + copy(result, data) + sort.Strings(result) + return result + } + + newEnvUpdates := copyAndSort(newCmd.EnvUpdates) + oldEnvUpdates := copyAndSort(oldCmd.EnvUpdates) if !reflect.DeepEqual(newEnvUpdates, oldEnvUpdates) { differences = append(differences, "env updates") @@ -154,13 +157,8 @@ func dumpCommands(cmds []*command) string { type oldWrapperConfig struct { CmdPath string OldWrapperContent string - RootRelPath string MockCmds bool CmdResults []oldWrapperCmdResult - OverwriteConfig bool - CommonFlags []string - GccFlags []string - ClangFlags []string } type oldWrapperCmdResult struct { @@ -188,17 +186,9 @@ func newOldWrapperConfig(env env, cfg *config, inputCmd *command) (*oldWrapperCo oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "__name__", "'none'") // Replace sets with lists to make our comparisons deterministic oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "set(", "ListSet(") - // Inject the value of cfg.useCCache - if !cfg.useCCache { - oldWrapperContent = regexp.MustCompile(`True\s+#\s+@CCACHE_DEFAULT@`).ReplaceAllString(oldWrapperContent, "False #") - } return &oldWrapperConfig{ CmdPath: inputCmd.Path, OldWrapperContent: oldWrapperContent, - RootRelPath: cfg.rootRelPath, - CommonFlags: cfg.commonFlags, - GccFlags: cfg.gccFlags, - ClangFlags: cfg.clangFlags, }, nil } @@ -302,14 +292,6 @@ os.execv = execv_mock sys.argv[0] = '{{.CmdPath}}' -ROOT_REL_PATH = '{{.RootRelPath}}' - -{{if .OverwriteConfig}} -FLAGS_TO_ADD=set([{{range .CommonFlags}}'{{.}}',{{end}}]) -GCC_FLAGS_TO_ADD=set([{{range .GccFlags}}'{{.}}',{{end}}]) -CLANG_FLAGS_TO_ADD=set([{{range .ClangFlags}}'{{.}}',{{end}}]) -{{end}} - sys.exit(main()) ` tmpl, err := template.New("mock").Parse(mockTemplate) diff --git a/compiler_wrapper/testdata/cros_hardened_golden.json b/compiler_wrapper/testdata/cros_hardened_golden.json new file mode 100644 index 00000000..94d3e83b --- /dev/null +++ b/compiler_wrapper/testdata/cros_hardened_golden.json @@ -0,0 +1,3796 @@ +[ + { + "name": "gcc path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "gcc [main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-eabi-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-win-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-linux-gnu-gcc.real", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-linux-eabi-gcc.real", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-win-gnu-gcc.real", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-linux-gnu-gcc.real", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-linux-eabi-gcc.real", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-win-gnu-gcc.real", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc sysroot wrapper common", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-noccache", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=someNonExistingPath" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-nopie", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-D__KERNEL__", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fno-stack-protector", + "-D__KERNEL__", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-Wl,--no-undefined", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-Wl,-z,defs", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=1", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=2", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "--sysroot=xyz", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "--sysroot=xyz", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc specific args", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=goldmont", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-march=silvermont", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=goldmont-plus", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-march=silvermont", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=skylake", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-march=corei7", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc clang-syntax", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang++", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang++", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "CLANG=somepath/clang" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "somepath/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang [main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang [-ftrapv main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang sysroot wrapper common", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-noccache", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=someNonExistingPath" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-nopie", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-D__KERNEL__", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-fno-stack-protector", + "-D__KERNEL__", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-Wl,--no-undefined", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-Wl,-z,defs", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=1", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=2", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-fno-omit-frame-pointer", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "--sysroot=xyz", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "--sysroot=xyz", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang specific args", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-mno-movbe", + "-pass-exit-codes", + "-Wclobbered", + "-Wno-psabi", + "-Wlogical-op", + "-Wmissing-parameter-type", + "-Wold-style-declaration", + "-Woverride-init", + "-Wunsafe-loop-optimizations", + "-Wstrict-aliasing=abc", + "-finline-limit=abc", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=cpp", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-Wno-#warnings", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=maybe-uninitialized", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-Wno-error=uninitialized", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=unused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-Wno-error=unused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-unused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-Wno-unused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wunused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-Wunused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-only=-someflag", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-someflag", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "bisect", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/ccache", + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/ccache", + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "force disable werror", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang-tidy", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerrorclang-tidy failed" + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + } +] diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden.json new file mode 100644 index 00000000..9ed9bab8 --- /dev/null +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden.json @@ -0,0 +1,1247 @@ +[ + { + "name": "gcc path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang++", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang++", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "CLANG=somepath/clang" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "somepath/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/somedir/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/somedir/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "gcc clang-syntax", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-fno-reorder-blocks-and-partition", + "-Wno-unused-local-typedefs", + "-Wno-maybe-uninitialized", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-mno-movbe" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "bisect", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "force disable werror", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang-tidy", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerrorclang-tidy failed" + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-grecord-gcc-switches", + "-fno-addrsig", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fstack-protector-strong", + "-fPIE", + "-pie", + "-D_FORTIFY_SOURCE=2", + "-fno-omit-frame-pointer", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + } +] diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden.json b/compiler_wrapper/testdata/cros_nonhardened_golden.json new file mode 100644 index 00000000..c82557da --- /dev/null +++ b/compiler_wrapper/testdata/cros_nonhardened_golden.json @@ -0,0 +1,3290 @@ +[ + { + "name": "gcc path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "gcc [main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-eabi-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-win-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-linux-gnu-gcc.real", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-linux-eabi-gcc.real", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv7m-cros-win-gnu-gcc.real", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-linux-gnu-gcc.real", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-linux-eabi-gcc.real", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./armv8m-cros-win-gnu-gcc.real", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-mthumb", + "main.cc" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc sysroot wrapper common", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-noccache", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=someNonExistingPath" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-nopie", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-D__KERNEL__", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-fno-stack-protector", + "-D__KERNEL__", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-Wl,--no-undefined", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-Wl,-z,defs", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=1", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=2", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-fsanitize=kernel-address", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "--sysroot=xyz", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "--sysroot=xyz", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc specific args", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=goldmont", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-march=silvermont", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=goldmont-plus", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-march=silvermont", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=skylake", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "-march=corei7", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + } + ] + }, + { + "name": "gcc clang-syntax", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-clang-syntax", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-fsyntax-only", + "-stdlib=libstdc++" + ] + } + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "./x86_64-cros-linux-gnu-gcc.real", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang path", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang++", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang++", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "CLANG=somepath/clang" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "somepath/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-path=/somedir", + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "/somedir/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-resource-dir=someResourceDir", + "--gcc-toolchain=/usr", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang [main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang [-ftrapv main.cc] target specific", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv7m-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv7m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv7m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-linux-eabi", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-linux-eabi" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-linux-eabi", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-clang", + "args": [ + "-ftrapv", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/armv8m-cros-win-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-mthumb", + "-ftrapv", + "main.cc", + "-B../../bin", + "-target", + "armv8m-cros-win-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/armv8m-cros-win-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang sysroot wrapper common", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-noccache", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-Wtrampolines", + "main.cc", + "-mno-movbe" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=someNonExistingPath" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-nopie", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-D__KERNEL__", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fno-stack-protector", + "-D__KERNEL__", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-Wl,--no-undefined", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-Wl,-z,defs", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=1", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-fsanitize=kernel-address", + "-D_FORTIFY_SOURCE=2", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-fsanitize=kernel-address", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "--sysroot=xyz", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "--sysroot=xyz", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "clang specific args", + "records": [ + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-mno-movbe", + "-pass-exit-codes", + "-Wclobbered", + "-Wno-psabi", + "-Wlogical-op", + "-Wmissing-parameter-type", + "-Wold-style-declaration", + "-Woverride-init", + "-Wunsafe-loop-optimizations", + "-Wstrict-aliasing=abc", + "-finline-limit=abc", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=cpp", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-Wno-#warnings", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=maybe-uninitialized", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-Wno-error=uninitialized", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-error=unused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-Wno-error=unused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wno-unused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-Wno-unused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Wunused-but-set-variable", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-Wunused-variable", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "-Xclang-only=-someflag", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "-someflag", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + } + ] + }, + { + "name": "bisect", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/ccache", + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "BISECT_STAGE=someBisectStage", + "BISECT_DIR=someBisectDir" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "/usr/bin/python2", + "args": [ + "-c", + "import bisect_driver; sys.exit(bisect_driver.bisect_driver(sys.argv[1], sys.argv[2], sys.argv[3:]))", + "someBisectStage", + "someBisectDir", + "/usr/bin/ccache", + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "force disable werror", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "FORCE_DISABLE_WERROR=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stderr": "-Werror originalerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "ccache", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu", + "-Wno-error" + ], + "env_updates": [ + "CCACHE_BASEDIR=/usr/x86_64-cros-linux-gnu", + "CCACHE_DIR=/var/cache/distfiles/ccache", + "CCACHE_UMASK=002", + "CCACHE_CPP2=yes" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + }, + { + "name": "clang-tidy", + "records": [ + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerrorclang-tidy failed" + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "env": [ + "WITH_TIDY=1", + "GOMACC_PATH=/tmp/stable/gomacc" + ], + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-clang", + "args": [ + "main.cc" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + }, + "cmds": [ + { + "cmd": { + "path": "../../usr/bin/clang", + "args": [ + "--print-resource-dir" + ] + }, + "stdout": "someResourceDir" + }, + { + "cmd": { + "path": "../../usr/bin/clang-tidy", + "args": [ + "-checks=*,google*,-bugprone-narrowing-conversions,-cppcoreguidelines-*,-fuchsia-*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-braces-around-statements,-hicpp-no-array-decay,-hicpp-signed-bitwise,-hicpp-uppercase-literal-suffix,-hicpp-use-auto,-llvm-namespace-comment,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-modernize-*,-readability-*", + "main.cc", + "--", + "-resource-dir=someResourceDir", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + } + }, + { + "cmd": { + "path": "/tmp/stable/gomacc", + "args": [ + "../../usr/bin/clang", + "--sysroot=/usr/x86_64-cros-linux-gnu", + "-Qunused-arguments", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-Wno-section", + "main.cc", + "-B../../bin", + "-target", + "x86_64-cros-linux-gnu" + ] + }, + "stdout": "somemessage", + "stderr": "someerror", + "exitcode": 1 + } + ] + } + ] + } +] diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index 07d84b36..0ffe8d71 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -25,11 +25,9 @@ const gccArmV7Eabi = "./armv7m-cros-linux-eabi-gcc" const gccArmV8 = "./armv8m-cros-linux-gnu-gcc" const gccArmV8Eabi = "./armv8m-cros-linux-eabi-gcc" -const oldHardenedWrapperPathForTest = "/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/gcc-bin/4.9.x/sysroot_wrapper.hardened" -const oldNonHardenedWrapperPathForTest = "/usr/x86_64-pc-linux-gnu/arm-none-eabi/gcc-bin/4.9.x/sysroot_wrapper" - type testContext struct { t *testing.T + wd string tempDir string env []string cfg *config @@ -51,13 +49,12 @@ func withTestContext(t *testing.T, work func(ctx *testContext)) { ctx := testContext{ t: t, + wd: tempDir, tempDir: tempDir, env: nil, cfg: &config{}, } - // Note: It's ok to use the hardened wrapper here, as we replace its config - // on each run. - ctx.updateConfig(oldHardenedWrapperPathForTest, &config{}) + ctx.updateConfig("", &config{}) work(&ctx) } @@ -79,7 +76,7 @@ func (ctx *testContext) environ() []string { } func (ctx *testContext) getwd() string { - return ctx.tempDir + return ctx.wd } func (ctx *testContext) stdout() io.Writer { @@ -141,10 +138,9 @@ func (ctx *testContext) mustFail(exitCode int) string { func (ctx *testContext) updateConfig(wrapperChrootPath string, cfg *config) { *ctx.cfg = *cfg - ctx.cfg.overwriteOldWrapperCfg = true ctx.cfg.mockOldWrapperCmds = true ctx.cfg.newWarningsDir = filepath.Join(ctx.tempDir, "fatal_clang_warnings") - if *crosRootDirFlag != "" { + if *crosRootDirFlag != "" && wrapperChrootPath != "" { ctx.cfg.oldWrapperPath = filepath.Join(*crosRootDirFlag, wrapperChrootPath) } else { ctx.cfg.oldWrapperPath = "" @@ -248,8 +244,12 @@ func verifyNoEnvUpdate(cmd *command, expectedRegex string) error { return nil } +func hasInternalError(stderr string) bool { + return strings.Contains(stderr, "Internal error") +} + func verifyInternalError(stderr string) error { - if !strings.Contains(stderr, "Internal error") { + if !hasInternalError(stderr) { return fmt.Errorf("expected an internal error. Got: %s", stderr) } if ok, _ := regexp.MatchString(`\w+.go:\d+`, stderr); !ok { @@ -259,7 +259,7 @@ func verifyInternalError(stderr string) error { } func verifyNonInternalError(stderr string, expectedRegex string) error { - if strings.Contains(stderr, "Internal error") { + if hasInternalError(stderr) { return fmt.Errorf("expected a non internal error. Got: %s", stderr) } if ok, _ := regexp.MatchString(`\w+.go:\d+`, stderr); ok { |