diff options
author | Tobias Bosch <tbosch@google.com> | 2019-07-19 06:53:07 -0700 |
---|---|---|
committer | Tobias Bosch <tbosch@google.com> | 2019-07-22 08:06:56 +0000 |
commit | b27c8f27362dca908c880adb45fb1ec537064b9c (patch) | |
tree | 536a9c91991badbaf9839284889800fbf9916557 /compiler_wrapper | |
parent | 31dec2c8cf3e272dc0bd1523e72565d9b2d3bcfb (diff) | |
download | toolchain-utils-b27c8f27362dca908c880adb45fb1ec537064b9c.tar.gz |
Support gcc host wrapper.
This change adds support for the gcc host wrapper.
The implementation is verified via comparing to the old
gcc host wrapper in the golden tests.
BUG=chromium:773875
TEST=unit test
Change-Id: I3af98b81dba6d9299183db01e967003be860972c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1710537
Tested-by: Tobias Bosch <tbosch@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/compiler_wrapper.go | 15 | ||||
-rw-r--r-- | compiler_wrapper/compiler_wrapper_test.go | 2 | ||||
-rw-r--r-- | compiler_wrapper/config.go | 6 | ||||
-rw-r--r-- | compiler_wrapper/cros_host_config_test.go | 22 | ||||
-rw-r--r-- | compiler_wrapper/gcc_flags.go | 36 | ||||
-rw-r--r-- | compiler_wrapper/oldwrapper.go | 76 | ||||
-rw-r--r-- | compiler_wrapper/oldwrapper_test.go | 101 | ||||
-rw-r--r-- | compiler_wrapper/testdata/cros_gcc_host_golden.json | 365 |
8 files changed, 586 insertions, 37 deletions
diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index b2172c6e..521846c9 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -130,12 +130,19 @@ func calcClangCommand(allowCCache bool, builder *commandBuilder) (*command, erro } func calcGccCommand(builder *commandBuilder) *command { - sysroot := processSysrootFlag(builder) + sysroot := "" + if !builder.cfg.isHostWrapper { + sysroot = processSysrootFlag(builder) + } builder.addPreUserArgs(builder.cfg.gccFlags...) - calcCommonPreUserArgs(builder) + if !builder.cfg.isHostWrapper { + calcCommonPreUserArgs(builder) + } processGccFlags(builder) - allowCCache := true - processGomaCCacheFlags(sysroot, allowCCache, builder) + if !builder.cfg.isHostWrapper { + allowCCache := true + processGomaCCacheFlags(sysroot, allowCCache, builder) + } return builder.build() } diff --git a/compiler_wrapper/compiler_wrapper_test.go b/compiler_wrapper/compiler_wrapper_test.go index 64276a60..57bef951 100644 --- a/compiler_wrapper/compiler_wrapper_test.go +++ b/compiler_wrapper/compiler_wrapper_test.go @@ -105,7 +105,7 @@ func TestLogExitCodeErrorWhenComparingToOldWrapper(t *testing.T) { ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "fakewrapper") ctx.cmdMock = func(cmd *command, stdout io.Writer, stderr io.Writer) error { - writeMockWrapper(ctx, &mockWrapperConfig{ + writePythonMockWrapper(ctx, &mockWrapperConfig{ Cmds: []*mockWrapperCmd{ { Path: cmd.Path, diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index f94206ff..7567d0e2 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -139,7 +139,11 @@ func getCrosHostConfig() *config { rootRelPath: "../..", oldWrapperPath: "./host_wrapper.old", commonFlags: []string{}, - gccFlags: []string{}, + gccFlags: []string{ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + }, // Temporarily disable tautological-*-compare chromium:778316. // Temporarily add no-unknown-warning-option to deal with old clang versions. clangFlags: []string{ diff --git a/compiler_wrapper/cros_host_config_test.go b/compiler_wrapper/cros_host_config_test.go index afc5b5ce..901fa896 100644 --- a/compiler_wrapper/cros_host_config_test.go +++ b/compiler_wrapper/cros_host_config_test.go @@ -10,7 +10,9 @@ import ( ) const oldClangHostWrapperPathForTest = "/usr/bin/clang_host_wrapper" +const oldGccHostWrapperPathForTest = "../src/third_party/chromiumos-overlay/sys-devel/gcc/files/host_wrapper" const crosClangHostGoldenFile = "testdata/cros_clang_host_golden.json" +const crosGccHostGoldenFile = "testdata/cros_gcc_host_golden.json" func TestCrosClangHostConfig(t *testing.T) { withTestContext(t, func(ctx *testContext) { @@ -34,3 +36,23 @@ func TestCrosClangHostConfig(t *testing.T) { runGoldenRecords(ctx, crosClangHostGoldenFile, goldenSections) }) } + +func TestCrosGccHostConfig(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + ctx.updateConfig(oldGccHostWrapperPathForTest, getCrosHostConfig()) + + gomaPath := path.Join(ctx.tempDir, "gomacc") + ctx.writeFile(gomaPath, "") + gomaEnv := "GOMACC_PATH=" + gomaPath + + // Note: The old gcc host wrapper is very limited and only adds flags. + // So we only test very few things here. + goldenSections := []goldenRecordSection{ + createGccPathGoldenInputs(gomaEnv), + createGoldenInputsForAllTargets("gcc", mainCc), + createGccArgsGoldenInputs(), + } + + runGoldenRecords(ctx, crosGccHostGoldenFile, goldenSections) + }) +} diff --git a/compiler_wrapper/gcc_flags.go b/compiler_wrapper/gcc_flags.go index b15d55e8..8775b23b 100644 --- a/compiler_wrapper/gcc_flags.go +++ b/compiler_wrapper/gcc_flags.go @@ -5,25 +5,27 @@ package main func processGccFlags(builder *commandBuilder) { - // Flags not supported by GCC. - unsupported := map[string]bool{"-Xcompiler": true} + if !builder.cfg.isHostWrapper { + // Flags not supported by GCC. + unsupported := map[string]bool{"-Xcompiler": true} - // Conversion for flags supported by clang but not gcc. - clangToGcc := map[string]string{ - "-march=goldmont": "-march=silvermont", - "-march=goldmont-plus": "-march=silvermont", - "-march=skylake": "-march=corei7", - } - - builder.transformArgs(func(arg builderArg) string { - if unsupported[arg.value] { - return "" - } - if mapped, ok := clangToGcc[arg.value]; ok { - return mapped + // Conversion for flags supported by clang but not gcc. + clangToGcc := map[string]string{ + "-march=goldmont": "-march=silvermont", + "-march=goldmont-plus": "-march=silvermont", + "-march=skylake": "-march=corei7", } - return arg.value - }) + + builder.transformArgs(func(arg builderArg) string { + if unsupported[arg.value] { + return "" + } + if mapped, ok := clangToGcc[arg.value]; ok { + return mapped + } + return arg.value + }) + } builder.path += ".real" } diff --git a/compiler_wrapper/oldwrapper.go b/compiler_wrapper/oldwrapper.go index 163d8f56..6c4ee0ec 100644 --- a/compiler_wrapper/oldwrapper.go +++ b/compiler_wrapper/oldwrapper.go @@ -12,6 +12,7 @@ import ( "os" "path/filepath" "reflect" + "regexp" "sort" "strings" "text/template" @@ -36,7 +37,12 @@ func compareToOldWrapper(env env, cfg *config, inputCmd *command, newCmdResults } stderrBuffer := bytes.Buffer{} - oldExitCode, err := callOldWrapper(env, oldWrapperCfg, inputCmd, compareToOldWrapperFilePattern, &bytes.Buffer{}, &stderrBuffer) + oldExitCode := 0 + if strings.HasPrefix(oldWrapperCfg.OldWrapperContent, "#!/bin/sh") { + oldExitCode, err = callOldShellWrapper(env, oldWrapperCfg, inputCmd, compareToOldWrapperFilePattern, &bytes.Buffer{}, &stderrBuffer) + } else { + oldExitCode, err = callOldPythonWrapper(env, oldWrapperCfg, inputCmd, compareToOldWrapperFilePattern, &bytes.Buffer{}, &stderrBuffer) + } if err != nil { return err } @@ -159,6 +165,7 @@ func dumpCommands(cmds []*command) string { // Note: field names are upper case so they can be used in // a template via reflection. type oldWrapperConfig struct { + WrapperPath string CmdPath string OldWrapperContent string MockCmds bool @@ -185,18 +192,71 @@ func newOldWrapperConfig(env env, cfg *config, inputCmd *command) (*oldWrapperCo return nil, wrapErrorwithSourceLocf(err, "failed to read old wrapper") } oldWrapperContent := string(oldWrapperContentBytes) - oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "from __future__ import print_function", "") - // Replace sets with lists to make our comparisons deterministic - oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "set(", "ListSet(") - oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "if __name__ == '__main__':", "def runMain():") - oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "__file__", "'"+absWrapperPath+"'") return &oldWrapperConfig{ + WrapperPath: absWrapperPath, CmdPath: inputCmd.Path, OldWrapperContent: oldWrapperContent, }, nil } -func callOldWrapper(env env, cfg *oldWrapperConfig, inputCmd *command, filepattern string, stdout io.Writer, stderr io.Writer) (exitCode int, err error) { +func callOldShellWrapper(env env, cfg *oldWrapperConfig, inputCmd *command, filepattern string, stdout io.Writer, stderr io.Writer) (exitCode int, err error) { + oldWrapperContent := cfg.OldWrapperContent + oldWrapperContent = regexp.MustCompile(`(?m)^exec\b`).ReplaceAllString(oldWrapperContent, "exec_mock") + oldWrapperContent = regexp.MustCompile(`\$EXEC`).ReplaceAllString(oldWrapperContent, "exec_mock") + oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "$0", cfg.CmdPath) + cfg.OldWrapperContent = oldWrapperContent + mockFile, err := ioutil.TempFile("", filepattern) + if err != nil { + return 0, wrapErrorwithSourceLocf(err, "failed to create tempfile") + } + defer os.Remove(mockFile.Name()) + + const mockTemplate = ` +EXEC=exec + +function exec_mock { + echo command:${*}.EnvUpdate: 1>&2 + {{if .MockCmds}} + echo '{{(index .CmdResults 0).Stdout}}' + echo '{{(index .CmdResults 0).Stderr}}' 1>&2 + exit {{(index .CmdResults 0).Exitcode}} + {{else}} + $EXEC ${*} + {{end}} +} + +{{.OldWrapperContent}} +` + tmpl, err := template.New("mock").Parse(mockTemplate) + if err != nil { + return 0, wrapErrorwithSourceLocf(err, "failed to parse old wrapper template") + } + if err := tmpl.Execute(mockFile, cfg); err != nil { + return 0, wrapErrorwithSourceLocf(err, "failed execute old wrapper template") + } + if err := mockFile.Close(); err != nil { + return 0, wrapErrorwithSourceLocf(err, "failed to close temp file") + } + + // Note: Using a self executable wrapper does not work due to a race condition + // on unix systems. See https://github.com/golang/go/issues/22315 + oldWrapperCmd := &command{ + Path: "/usr/bin/sh", + Args: append([]string{mockFile.Name()}, inputCmd.Args...), + EnvUpdates: inputCmd.EnvUpdates, + } + return wrapSubprocessErrorWithSourceLoc(oldWrapperCmd, env.run(oldWrapperCmd, stdout, stderr)) +} + +func callOldPythonWrapper(env env, cfg *oldWrapperConfig, inputCmd *command, filepattern string, stdout io.Writer, stderr io.Writer) (exitCode int, err error) { + oldWrapperContent := cfg.OldWrapperContent + oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "from __future__ import print_function", "") + // Replace sets with lists to make our comparisons deterministic + oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "set(", "ListSet(") + oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "if __name__ == '__main__':", "def runMain():") + oldWrapperContent = strings.ReplaceAll(oldWrapperContent, "__file__", "'"+cfg.WrapperPath+"'") + cfg.OldWrapperContent = oldWrapperContent + mockFile, err := ioutil.TempFile("", filepattern) if err != nil { return 0, wrapErrorwithSourceLocf(err, "failed to create tempfile") @@ -308,8 +368,6 @@ runMain() if err := mockFile.Close(); err != nil { return 0, wrapErrorwithSourceLocf(err, "failed to close temp file") } - buf := bytes.Buffer{} - tmpl.Execute(&buf, cfg) // Note: Using a self executable wrapper does not work due to a race condition // on unix systems. See https://github.com/golang/go/issues/22315 diff --git a/compiler_wrapper/oldwrapper_test.go b/compiler_wrapper/oldwrapper_test.go index 824c152b..9a65168a 100644 --- a/compiler_wrapper/oldwrapper_test.go +++ b/compiler_wrapper/oldwrapper_test.go @@ -13,7 +13,7 @@ import ( "text/template" ) -func TestCompareToOldWrapperCompilerCommand(t *testing.T) { +func TestCompareToOldPythonWrapperCompilerCommand(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.cfg.mockOldWrapperCmds = false ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "fakewrapper") @@ -32,7 +32,7 @@ func TestCompareToOldWrapperCompilerCommand(t *testing.T) { } ctx.cmdMock = func(cmd *command, stdout io.Writer, stderr io.Writer) error { - writeMockWrapper(ctx, &mockWrapperConfig{ + writePythonMockWrapper(ctx, &mockWrapperConfig{ Cmds: []*mockWrapperCmd{ { Path: cmd.Path + pathSuffix, @@ -83,7 +83,7 @@ func TestCompareToOldWrapperCompilerCommand(t *testing.T) { }) } -func TestCompareToOldWrapperNestedCommand(t *testing.T) { +func TestCompareToOldPythonWrapperNestedCommand(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.cfg.mockOldWrapperCmds = false ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "fakewrapper") @@ -108,7 +108,7 @@ func TestCompareToOldWrapperNestedCommand(t *testing.T) { } wrapperCfg.Cmds = append(wrapperCfg.Cmds, wrapperCmd) if !isNestedCmd { - writeMockWrapper(ctx, wrapperCfg) + writePythonMockWrapper(ctx, wrapperCfg) } return nil } @@ -147,7 +147,77 @@ func TestCompareToOldWrapperNestedCommand(t *testing.T) { }) } -func writeMockWrapper(ctx *testContext, cfg *mockWrapperConfig) { +func TestCompareToOldShellWrapperCompilerCommand(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + ctx.cfg.mockOldWrapperCmds = false + ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "fakewrapper") + + pathSuffix := "" + extraArgs := []string{} + exitCode := 0 + newWrapperExitCode := 0 + + reset := func() { + ctx.stderrBuffer.Reset() + pathSuffix = "" + extraArgs = []string{} + exitCode = 0 + newWrapperExitCode = 0 + } + + ctx.cmdMock = func(cmd *command, stdout io.Writer, stderr io.Writer) error { + writeShellMockWrapper(ctx, &mockWrapperConfig{ + Cmds: []*mockWrapperCmd{ + { + Path: cmd.Path + pathSuffix, + Args: append(cmd.Args, extraArgs...), + ExitCode: exitCode, + }, + }, + }) + if newWrapperExitCode != 0 { + return newExitCodeError(newWrapperExitCode) + } + return nil + } + + // Note: This will cause only the compiler command. + inputCmd := ctx.newCommand(gccX86_64) + + reset() + pathSuffix = "xyz" + stderr := ctx.mustFail(callCompiler(ctx, ctx.cfg, inputCmd)) + if !strings.Contains(stderr, "Index 0: path") { + t.Errorf("expected path difference error. Got: %s", stderr) + } + + reset() + extraArgs = []string{"xyz"} + stderr = ctx.mustFail(callCompiler(ctx, ctx.cfg, inputCmd)) + if !strings.Contains(stderr, "Index 0: args") { + t.Errorf("expected args difference error. Got: %s", stderr) + } + + reset() + exitCode = 1 + stderr = ctx.mustFail(callCompiler(ctx, ctx.cfg, inputCmd)) + if !strings.Contains(stderr, "exit codes differ: old 1, new 0") { + t.Errorf("expected exit code difference error. Got: %s", stderr) + } + + reset() + newWrapperExitCode = 1 + stderr = ctx.mustFail(callCompiler(ctx, ctx.cfg, inputCmd)) + if !strings.Contains(stderr, "exit codes differ: old 0, new 1") { + t.Errorf("expected exit code difference error. Got: %s", stderr) + } + + reset() + ctx.must(callCompiler(ctx, ctx.cfg, inputCmd)) + }) +} + +func writePythonMockWrapper(ctx *testContext, cfg *mockWrapperConfig) { const mockTemplate = ` from __future__ import print_function import os @@ -192,6 +262,27 @@ if __name__ == '__main__': ctx.writeFile(ctx.cfg.oldWrapperPath, buf.String()) } +func writeShellMockWrapper(ctx *testContext, cfg *mockWrapperConfig) { + const mockTemplate = `#!/bin/sh +EXEC=fake_exec + +function fake_exec { + exit {{(index .Cmds 0).ExitCode}} +} + +$EXEC {{(index .Cmds 0).Path}}{{range (index .Cmds 0).Args}} {{.}}{{end}} +` + tmpl, err := template.New("mock").Parse(mockTemplate) + if err != nil { + ctx.t.Fatalf("failed to parse old wrapper template. Error: %s", err) + } + buf := bytes.Buffer{} + if err := tmpl.Execute(&buf, cfg); err != nil { + ctx.t.Fatalf("failed to execute the template. Error: %s", err) + } + ctx.writeFile(ctx.cfg.oldWrapperPath, buf.String()) +} + // Note: Fields have to be uppercase so that they can be used with template. type mockWrapperConfig struct { Cmds []*mockWrapperCmd diff --git a/compiler_wrapper/testdata/cros_gcc_host_golden.json b/compiler_wrapper/testdata/cros_gcc_host_golden.json new file mode 100644 index 00000000..b7b79e04 --- /dev/null +++ b/compiler_wrapper/testdata/cros_gcc_host_golden.json @@ -0,0 +1,365 @@ +[ + { + "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": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "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": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + }, + "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": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-eabi-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-win-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv7m-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv7m-cros-linux-eabi-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv7m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv7m-cros-win-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv8m-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-linux-eabi-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv8m-cros-linux-eabi-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./armv8m-cros-win-gnu-gcc", + "args": [ + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./armv8m-cros-win-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "main.cc" + ] + } + } + ] + } + ] + }, + { + "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": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-march=goldmont", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=goldmont-plus", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-march=goldmont-plus", + "main.cc" + ] + } + } + ] + }, + { + "wd": "/tmp/stable", + "wrapper": { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc", + "args": [ + "-march=skylake", + "main.cc" + ] + } + }, + "cmds": [ + { + "cmd": { + "path": "./x86_64-cros-linux-gnu-gcc.real", + "args": [ + "-Wno-maybe-uninitialized", + "-Wno-unused-local-typedefs", + "-Wno-deprecated-declarations", + "-march=skylake", + "main.cc" + ] + } + } + ] + } + ] + } +] |