This is an archive of the discontinued LLVM Phabricator instance.

gn build: Build clang with -fno-strict-aliasing, make building with gcc much quieter
ClosedPublic

Authored by thakis on Jan 24 2019, 2:02 PM.

Details

Summary
  • gcc doesn't understand -Wstring-conversion, so pass that only to clang
  • disable a few gcc warnings that are noisy and also disabled in the cmake build
  • -Wstrict-aliasing pointed out that the cmake build builds clang with -fno-strict-aliasing, so do that too

Diff Detail

Repository
rL LLVM

Event Timeline

thakis created this revision.Jan 24 2019, 2:02 PM

I'm getting a bunch of

[1593/1698] CXX stage2_unix/obj/compiler-rt/lib/sanitizer_common/sources.sanitizer_platform_limits_solaris.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
1 warning generated.

in my local build with this patch applied. Does the stage2_unix toolchain set is_clang to true? If not, it probably should?

I'm getting a bunch of

[1593/1698] CXX stage2_unix/obj/compiler-rt/lib/sanitizer_common/sources.sanitizer_platform_limits_solaris.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
1 warning generated.

in my local build with this patch applied. Does the stage2_unix toolchain set is_clang to true? If not, it probably should?

(Still, this is a big net noise reduction, even as-is.)

pcc accepted this revision.Jan 24 2019, 4:02 PM

LGTM

I'm getting a bunch of

[1593/1698] CXX stage2_unix/obj/compiler-rt/lib/sanitizer_common/sources.sanitizer_platform_limits_solaris.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
1 warning generated.

in my local build with this patch applied. Does the stage2_unix toolchain set is_clang to true? If not, it probably should?

Agreed, sent D57202.

llvm/utils/gn/build/BUILD.gn
153 ↗(On Diff #183393)

current_os?

This revision is now accepted and ready to land.Jan 24 2019, 4:02 PM
thakis marked an inline comment as done.Jan 24 2019, 4:27 PM

Thanks!

llvm/utils/gn/build/BUILD.gn
153 ↗(On Diff #183393)

The file uses host_os for the other win checks too. I agree it's wrong, but I want to keep the file self-consistent until I get around to setting up a win/cross build.

This revision was automatically updated to reflect the committed changes.