[pytorch] add missing -fexceptions flags (#81394)
Summary:
Add missing `-fexceptions` flags that are currently being passed through `exported_preprocessor_flags`. The exported preprocessor flags will be removed in a subsequent diff.
This is a rediff of D37386802 (https://github.com/pytorch/pytorch/commit/3e1ac21c3bcbc0e27dcf058900e9572d3c135a20) with the changes split out to avoid reverts.
Test Plan:
Check flag is present:
```
$ buck uquery xplat/caffe2:common_core -a 'compiler_flags'
{
"//xplat/caffe2:common_core" : {
"compiler_flags" : [
"-fexceptions",
"-frtti",
"-Os",
"-Wno-unknown-pragmas",
"-Wno-write-strings",
"-Wno-unused-variable",
"-Wno-unused-function",
"-Wno-deprecated-declarations",
"-Wno-shadow",
"-Wno-global-constructors",
"-Wno-missing-prototypes",
"-std=gnu++17",
"/EHsc",
"/GR",
"/O1",
"/wd4101"
]
}
}
```
Differential Revision: D37813869
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81394
Approved by: https://github.com/linbinyu