-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompilerflags_test.go
More file actions
41 lines (35 loc) · 1.02 KB
/
compilerflags_test.go
File metadata and controls
41 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package tinybench
var gccLinkFlags = map[string][]string{
"n-body": {"-lm"}, // Math library.
"n-body-nosqrt": {"-lm"}, // Math library.
"spectral-norm": {"-lm"}, // Math library.
}
var gccBaseFlags = []string{
// "-O2"=="-O=ReleaseSafe" Same reasoning as with Zig.
// It seems serious projects compile with memory limits and safety on.
"-O2",
"-o", "c.bin",
}
var zigBaseFlags = []string{
"build-exe",
"-femit-bin=zig.bin",
"-fno-incremental",
// Prominent Zig projects use ReleaseSafe instead of ReleaseFast.
// This would seem to be a more realistic measure of how zig would perform in real circumstances.
// Also puts the compiler to the test of how well it can eliminate bounds checks.
// https://github.com/tigerbeetle/tigerbeetle/blob/ae7f25dbd904f27498673bf2d60a51f21759cdb8/build.zig#L470
"-O", "ReleaseSafe",
}
var goBaseFlags = []string{
"build",
"-o=go.bin",
}
var tinygoBaseFlags = []string{
"build",
"-opt=2",
"-o=tinybin",
}
var rustBaseFlags = []string{
"-Copt-level=2",
"-o", "rust.bin",
}