Skip to content

Commit 94cf07e

Browse files
committed
[GR-64834] Specify the optimization level in all ninja-native projects
PullRequest: graal/20748
2 parents f734b47 + 1a68707 commit 94cf07e

File tree

7 files changed

+25
-21
lines changed

7 files changed

+25
-21
lines changed

espresso/mx.espresso/suite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
"os_arch": {
274274
"windows": {
275275
"<others>": {
276-
"cflags": ["-Wall"],
276+
"cflags": ["-g", "-O3", "-Wall"],
277277
},
278278
},
279279
"linux-musl": {
@@ -301,7 +301,7 @@
301301
"os_arch": {
302302
"linux": {
303303
"<others>": {
304-
"cflags" : ["-g", "-fPIC", "-Wall", "-Werror", "-D_GNU_SOURCE"],
304+
"cflags" : ["-g", "-O3", "-fPIC", "-Wall", "-Werror", "-D_GNU_SOURCE"],
305305
"ldflags": [
306306
"-Wl,-soname,libeden.so",
307307
],
@@ -367,7 +367,7 @@
367367
},
368368
"windows": {
369369
"<others>": {
370-
"cflags": ["-Wall"],
370+
"cflags": ["-g", "-O3", "-Wall"],
371371
},
372372
}
373373
},

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,6 +3218,7 @@ def cflags(self):
32183218
_exe_dirs = set([dirname(p) for p in _exe_paths])
32193219
_dynamic_cflags = [
32203220
('/std:c++17' if mx.is_windows() else '-std=c++17'),
3221+
'-O3', # Note: no -g to save 0.2MB on Linux
32213222
'-DCP_SEP=' + os.pathsep,
32223223
'-DDIR_SEP=' + ('\\\\' if mx.is_windows() else '/'),
32233224
'-DGRAALVM_VERSION=' + _suite.release_version(),

sdk/mx.sdk/mx_sdk_vm_ng.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ def isJDKDependent(self):
592592
def cflags(self):
593593
_dynamic_cflags = [
594594
('/std:c++17' if mx.is_windows() else '-std=c++17'),
595+
'-O3', # Note: no -g to save 0.2MB on Linux
595596
'-DCP_SEP=' + os.pathsep,
596597
'-DDIR_SEP=' + ('\\\\' if mx.is_windows() else '/'),
597598
'-DGRAALVM_VERSION=' + _suite.release_version(),

substratevm/mx.substratevm/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,12 +908,12 @@
908908
"os_arch": {
909909
"windows": {
910910
"<others>": {
911-
"cflags": ["-Wall"]
911+
"cflags": ["-g", "-O2", "-Wall"]
912912
}
913913
},
914914
"<others>": {
915915
"<others>": {
916-
"cflags": ["-Wall", "-Werror"],
916+
"cflags": ["-g", "-O2", "-Wall", "-Werror"],
917917
},
918918
},
919919
},

sulong/mx.sulong/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,11 @@
757757
"os" : {
758758
"windows" : {},
759759
"solaris" : {
760-
"cflags" : ["-g", "-Wall", "-Werror", "-m64"],
760+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-m64"],
761761
"ldflags" : ["-m64"],
762762
},
763763
"<others>" : {
764-
"cflags" : ["-g", "-Wall", "-Werror"],
764+
"cflags" : ["-g", "-O3", "-Wall", "-Werror"],
765765
},
766766
},
767767
},

truffle/mx.truffle/suite.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,31 +1021,31 @@
10211021
"os_arch" : {
10221022
"windows" : {
10231023
"<others>" : {
1024-
"cflags" : []
1024+
"cflags" : ["-O3"],
10251025
}
10261026
},
10271027
"solaris" : {
10281028
"<others>" : {
1029-
"cflags" : ["-g", "-Wall", "-Werror", "-m64", "-pthread"],
1029+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-m64", "-pthread"],
10301030
"ldflags" : ["-m64", "-pthread"],
10311031
"ldlibs" : ["-ldl"],
10321032
},
10331033
},
10341034
"linux" : {
10351035
"<others>" : {
1036-
"cflags" : ["-g", "-Wall", "-Werror", "-D_GNU_SOURCE", "-fvisibility=hidden"],
1036+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-D_GNU_SOURCE", "-fvisibility=hidden"],
10371037
"ldlibs" : ["-ldl"],
10381038
},
10391039
},
10401040
"linux-musl" : {
10411041
"<others>" : {
1042-
"cflags" : ["-g", "-Wall", "-Werror", "-fvisibility=hidden"],
1042+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-fvisibility=hidden"],
10431043
"ldlibs" : ["-ldl"],
10441044
},
10451045
},
10461046
"<others>" : {
10471047
"<others>" : {
1048-
"cflags" : ["-g", "-Wall", "-Werror", "-fvisibility=hidden"],
1048+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-fvisibility=hidden"],
10491049
"ldlibs" : ["-ldl"],
10501050
},
10511051
},
@@ -1090,19 +1090,19 @@
10901090
"os_arch" : {
10911091
"windows" : {
10921092
"<others>" : {
1093-
"cflags" : []
1093+
"cflags" : ["-O3"]
10941094
}
10951095
},
10961096
"solaris" : {
10971097
"<others>" : {
1098-
"cflags" : ["-g", "-Wall", "-Werror", "-m64", "-pthread"],
1098+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-m64", "-pthread"],
10991099
"ldflags" : ["-m64", "-pthread"],
11001100
"ldlibs" : ["-lm"],
11011101
},
11021102
},
11031103
"<others>" : {
11041104
"<others>" : {
1105-
"cflags" : ["-g", "-Wall", "-Werror", "-pthread"],
1105+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-pthread"],
11061106
"ldflags" : ["-pthread"],
11071107
"ldlibs" : ["-lm"],
11081108
},
@@ -1120,17 +1120,17 @@
11201120
"os_arch" : {
11211121
"windows" : {
11221122
"<others>" : {
1123-
"cflags" : []
1123+
"cflags" : ["-O3"]
11241124
}
11251125
},
11261126
"solaris" : {
11271127
"<others>" : {
1128-
"cflags" : ["-g", "-Wall", "-Werror", "-m64"],
1128+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-m64"],
11291129
},
11301130
},
11311131
"<others>" : {
11321132
"<others>" : {
1133-
"cflags" : ["-g", "-Wall", "-Werror"],
1133+
"cflags" : ["-g", "-O3", "-Wall", "-Werror"],
11341134
},
11351135
},
11361136
},
@@ -1348,18 +1348,18 @@
13481348
"os_arch" : {
13491349
"windows" : {
13501350
"<others>" : {
1351-
"cflags" : []
1351+
"cflags" : ["-O3"]
13521352
}
13531353
},
13541354
"linux" : {
13551355
"<others>" : {
1356-
"cflags" : ["-g", "-Wall", "-Werror", "-D_GNU_SOURCE"],
1356+
"cflags" : ["-g", "-O3", "-Wall", "-Werror", "-D_GNU_SOURCE"],
13571357
"ldlibs" : ["-ldl"],
13581358
},
13591359
},
13601360
"<others>" : {
13611361
"<others>" : {
1362-
"cflags" : ["-g", "-Wall", "-Werror"],
1362+
"cflags" : ["-g", "-O3", "-Wall", "-Werror"],
13631363
"ldlibs" : ["-ldl"],
13641364
},
13651365
},

vm/mx.vm/suite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
"truffle:TRUFFLE_NFI_GRAALVM_SUPPORT",
138138
],
139139
"cflags" : [
140+
"-g",
141+
"-O3",
140142
"-I<path:truffle:TRUFFLE_NFI_GRAALVM_SUPPORT>/include",
141143
],
142144
"testProject" : True,

0 commit comments

Comments
 (0)