|
|
Created:
4 years, 2 months ago by Oliver Chang Modified:
4 years, 2 months ago Reviewers:
Dirk Pranke CC:
chromium-reviews, aizatsky, kcc2, inferno, mmoroz Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdd an optimize_for_fuzzing GN flag to build most things with -O1
This is better for coverage guided fuzzing builds as less optimization
means more branches in the generated code.
BUG=643249
Committed: https://crrev.com/aaa26c162de624ebcf7a120e85fef3e19ec02151
Cr-Commit-Position: refs/heads/master@{#423217}
Patch Set 1 #Patch Set 2 : Add an optimize_for_fuzzing GN flag to build with -O1 #
Total comments: 6
Patch Set 3 : address comments #Patch Set 4 : rebase #Patch Set 5 : move assert #
Total comments: 1
Patch Set 6 : add visibility #Messages
Total messages: 31 (19 generated)
Description was changed from ========== Add an optimize_for_fuzzing GN flag to build with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ========== to ========== Add an optimize_for_fuzzing GN flag to build with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ==========
ochang@chromium.org changed reviewers: + dpranke@chromium.org
Dirk, ptal. Not sure if this is the right way to do it.
https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... File build/config/compiler/BUILD.gn (right): https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... build/config/compiler/BUILD.gn:1479: assert(!is_win) I would: - get rid of lines 1467-1477 since they shouldn't ever execute (due to the ordering on lines 1488-1495) - make lines 1478-1481 unconditional, - add an assert(!is_nacl_irt) - add a second argument to the (!is_win) assert explaining that this isn't supported on windows (and delete the comment, which would become redundant). - and get rid of the (!is_win) test on line 1494, below. https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... build/config/compiler/BUILD.gn:1495: configs = [ ":optimize_fuzzing" ] I would get rid of the (!is_win) check here, as per the comments above. https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/c... File build/config/compiler/compiler.gni (right): https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/c... build/config/compiler/compiler.gni:53: optimize_for_fuzzing = false If this doesn't need to be referenced outside of //build/config/compiler/BUILD.gn, you should put this in the declare_args() block in that file.
Thanks for the comments! https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... File build/config/compiler/BUILD.gn (right): https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... build/config/compiler/BUILD.gn:1479: assert(!is_win) On 2016/10/03 20:37:13, Dirk Pranke (slow) wrote: > I would: > > - get rid of lines 1467-1477 since they shouldn't ever execute (due to the > ordering on lines 1488-1495) > > - make lines 1478-1481 unconditional, > > - add an assert(!is_nacl_irt) > > - add a second argument to the (!is_win) assert explaining that this isn't > supported on windows (and delete the comment, which would become redundant). > > - and get rid of the (!is_win) test on line 1494, below. Done. https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/B... build/config/compiler/BUILD.gn:1495: configs = [ ":optimize_fuzzing" ] On 2016/10/03 20:37:13, Dirk Pranke (slow) wrote: > I would get rid of the (!is_win) check here, as per the comments above. Done. https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/c... File build/config/compiler/compiler.gni (right): https://codereview.chromium.org/2389923003/diff/20001/build/config/compiler/c... build/config/compiler/compiler.gni:53: optimize_for_fuzzing = false On 2016/10/03 20:37:13, Dirk Pranke (slow) wrote: > If this doesn't need to be referenced outside of > //build/config/compiler/BUILD.gn, you should put this in the declare_args() > block in that file. Done.
Description was changed from ========== Add an optimize_for_fuzzing GN flag to build with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ========== to ========== Add an optimize_for_fuzzing GN flag to build most things with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ==========
lgtm, that's about as clean as it can get :).
The CQ bit was checked by ochang@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by ochang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dpranke@chromium.org Link to the patchset: https://codereview.chromium.org/2389923003/#ps60001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by ochang@chromium.org
The CQ bit was checked by ochang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
It looks like the asserts are evaluated when the file is loaded, not when it's used. Checking for |optimize_for_fuzzing| inside the "optimize_fuzzing" config seemed weird to me, so I moved the assert to the "default_optimization" config. Dirk, does this still look good?
still lgtm but I suggest another thing you could do if you feel like it. https://codereview.chromium.org/2389923003/diff/80001/build/config/compiler/B... File build/config/compiler/BUILD.gn (right): https://codereview.chromium.org/2389923003/diff/80001/build/config/compiler/B... build/config/compiler/BUILD.gn:1483: assert(!is_win, "Fuzzing optimize level not supported on Windows") One advantage to the prior version is that the asserts would fire if somehow someone depended on :optimize_fuzzing directly. You could prevent that by setting `visibility = [ ":default_optimization" ]` in the :optimize_fuzzing config, which is probably a better way to do things. However, it's not worth it to spend too much time on this, either.
The CQ bit was checked by ochang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by ochang@chromium.org
The CQ bit was checked by ochang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dpranke@chromium.org Link to the patchset: https://codereview.chromium.org/2389923003/#ps100001 (title: "add visibility")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Add an optimize_for_fuzzing GN flag to build most things with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ========== to ========== Add an optimize_for_fuzzing GN flag to build most things with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== Add an optimize_for_fuzzing GN flag to build most things with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 ========== to ========== Add an optimize_for_fuzzing GN flag to build most things with -O1 This is better for coverage guided fuzzing builds as less optimization means more branches in the generated code. BUG=643249 Committed: https://crrev.com/aaa26c162de624ebcf7a120e85fef3e19ec02151 Cr-Commit-Position: refs/heads/master@{#423217} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/aaa26c162de624ebcf7a120e85fef3e19ec02151 Cr-Commit-Position: refs/heads/master@{#423217} |