Skip to content

Commit

Permalink
[c10] move fexceptions to compiler_flags (pytorch#80387)
Browse files Browse the repository at this point in the history
Summary: Move `-fexceptions` out of the exported preprocessor flags and in to the libraries compiler flags. Apply the same changes to all rdeps of this library in the caffe2 subtree.

Test Plan:
Verify no rdeps are missing `-fexceptions` that have cpp sources:
```
% buck uquery 'kind(cxx*, rdeps(//xplat/caffe2/..., //xplat/caffe2/c10:c10, 1))' > /tmp/rdeps
% buck uquery '%Ss - attrfilter(preprocessor_flags, "-fexceptions", %Ss) - attrfilter(compiler_flags, "-fexceptions", %Ss)' @/tmp/rdeps
//xplat/pytorch_models/build/pytorch_dev_mobilenetv3/v1/nnc:asm
//xplat/pytorch_models/build/aot_test_model/v1/nnc:asm
//xplat/pytorch_models/build/pytorch_dev_linear/v1/nnc:asm
//xplat/pytorch_models/build/bi_bytedoc_nnc/v1/nnc:asm
//xplat/pytorch_models/build/bi_bytedoc_nnc/v2/nnc:asm
```

Differential Revision: D37386802

Pull Request resolved: pytorch#80387
Approved by: https://github.com/linbinyu
  • Loading branch information
rmaz authored and pytorchmergebot committed Jul 12, 2022
1 parent 782f18e commit 3e1ac21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions buckbuild.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def get_pt_compiler_flags():
})

_PT_COMPILER_FLAGS = [
"-fexceptions",
"-frtti",
"-Os",
"-Wno-unknown-pragmas",
Expand Down Expand Up @@ -1116,6 +1117,7 @@ def define_buck_targets(
deps = [
C10,
],
compiler_flags = ["-fexceptions"],
)

# Base library shared by lite-interpreter and full-jit.
Expand Down Expand Up @@ -1844,6 +1846,7 @@ def define_buck_targets(
":torch_core",
C10,
],
compiler_flags = ["-fexceptions"],
)

# aten_cpu and aten_native_cpu
Expand Down
1 change: 1 addition & 0 deletions build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def define_targets(rules):
"//c10",
"//third_party/miniz-2.1.0:miniz",
],
copts = ["-fexceptions"],
)

#
Expand Down

0 comments on commit 3e1ac21

Please sign in to comment.