Skip to content

Commit 028f89d

Browse files
authored
[native_toolchain_c] Compile with -O3 by default (#1747)
[Not all linkers support `-Os`](https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8730301908709004769/+/u/test_results/new_test_failures__logs_), so defaulting to `-O3` is more portable. Issue: * #1267
1 parent fccabe3 commit 028f89d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkgs/native_toolchain_c/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- For Android, produce dylibs with page-size set to 16kb by default.
44
https://github.com/dart-lang/native/issues/1611
5-
- Make optimization level configurable. Defaults to `-Os` and `/Os`.
5+
- Make optimization level configurable. Defaults to `-3s` and `/O3`.
66
https://github.com/dart-lang/native/issues/1267
77

88
## 0.6.0

pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CBuilder extends CTool implements Builder {
6868
super.language = Language.c,
6969
super.cppLinkStdLib,
7070
super.linkModePreference,
71-
super.optimizationLevel = OptimizationLevel.oS,
71+
super.optimizationLevel = OptimizationLevel.o3,
7272
}) : super(type: OutputType.library);
7373

7474
CBuilder.executable({
@@ -89,7 +89,7 @@ class CBuilder extends CTool implements Builder {
8989
super.std,
9090
super.language = Language.c,
9191
super.cppLinkStdLib,
92-
super.optimizationLevel = OptimizationLevel.oS,
92+
super.optimizationLevel = OptimizationLevel.o3,
9393
}) : super(
9494
type: OutputType.executable,
9595
assetName: null,

pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CLinker extends CTool implements Linker {
3737
super.language = Language.c,
3838
super.cppLinkStdLib,
3939
super.linkModePreference,
40-
super.optimizationLevel = OptimizationLevel.oS,
40+
super.optimizationLevel = OptimizationLevel.o3,
4141
}) : super(type: OutputType.library);
4242

4343
/// Runs the C Linker with on this C build spec.

0 commit comments

Comments
 (0)