Skip to content

Commit 4c7b5df

Browse files
[flang][docs] Do not recommend FLANG_ENABLE_WERROR=ON... (#171152)
...unless the reader is going to contribute to Flang. Fixes #168911. In which someone followed the getting started instructions but because they were using GCC and it produced some warnings, those got upgraded to errors and failed the build. The GCC builds of anything in LLVM are always going to have some warning of some kind, so while it would be nice to fix or silence them, let's not inflict that on new developers. This option defaults to `OFF` and is turned `ON` by a handful of bots, so if the intent was to make developers more attentive to warnings, that will still happen. Just a bit later, which that's better than putting them off up front. If they go on to contribute, they can switch to a Clang build and enable the option to save themselves some post-commit hassle.
1 parent 4ff1bd5 commit 4c7b5df

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

flang/docs/GettingStarted.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ cmake \
7676
-DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
7777
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
7878
-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
79-
-DFLANG_ENABLE_WERROR=ON \
8079
-DLLVM_ENABLE_ASSERTIONS=ON \
8180
-DLLVM_TARGETS_TO_BUILD=host \
8281
-DLLVM_LIT_ARGS=-v \
@@ -87,6 +86,15 @@ cmake \
8786
ninja
8887
```
8988

89+
```{note}
90+
Contributions to Flang are expected not to produce any new compiler warnings.
91+
This is enforced by post-commit buildbots. To do the same locally, add
92+
`-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
93+
94+
Only Clang builds are checked for this, so we do not recommend using this
95+
option with GCC as there will be preexisting warnings.
96+
```
97+
9098
On Darwin, to make flang able to link binaries with the default sysroot without
9199
having to specify additional flags, use the `DEFAULT_SYSROOT` CMake flag, e.g.
92100
`-DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)"`.
@@ -142,7 +150,6 @@ cmake \
142150
-DCMAKE_BUILD_TYPE=Release \
143151
-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
144152
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
145-
-DFLANG_ENABLE_WERROR=ON \
146153
-DLLVM_TARGETS_TO_BUILD=host \
147154
-DLLVM_ENABLE_ASSERTIONS=ON \
148155
-DLLVM_BUILD_MAIN_SRC_DIR=$ROOTDIR/build/lib/cmake/llvm \
@@ -156,6 +163,15 @@ cmake \
156163
ninja
157164
```
158165

166+
```{note}
167+
Contributions to Flang are expected not to produce any new compiler warnings.
168+
This is enforced by post-commit buildbots. To do the same locally, add
169+
`-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
170+
171+
Only Clang builds are checked for this, so we do not recommend using this
172+
option with GCC as there will be preexisting warnings.
173+
```
174+
159175
To run the flang tests on this build, execute the command in the `flang/build`
160176
directory:
161177
```bash

0 commit comments

Comments
 (0)