From d7e5c879964eee1a3c9d04d592a75ccbc06d2875 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 2 May 2022 09:31:15 -0700 Subject: Sync unwindlib option with current llvm Use unwindlib=libunwind to match current production wrapper. BUG=None TEST=go test Change-Id: I6cdace48ed871ac87a093addf2b96b86ee5153c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3621381 Reviewed-by: George Burgess Tested-by: Manoj Gupta Commit-Queue: George Burgess Auto-Submit: Manoj Gupta --- .../testdata/cros_hardened_golden/clang_specific_args.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index d10e6cd0..7a437ae5 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -34,7 +34,7 @@ "-Wno-unknown-warning-option", "-Wno-section", "-fuse-ld=lld", - "--unwindlib=libgcc", + "--unwindlib=libunwind", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", @@ -104,7 +104,7 @@ "-Wno-unknown-warning-option", "-Wno-section", "-fuse-ld=lld", - "--unwindlib=libgcc", + "--unwindlib=libunwind", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", @@ -167,7 +167,7 @@ "-Wno-unknown-warning-option", "-Wno-section", "-fuse-ld=lld", - "--unwindlib=libgcc", + "--unwindlib=libunwind", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", @@ -230,7 +230,7 @@ "-Wno-unknown-warning-option", "-Wno-section", "-fuse-ld=lld", - "--unwindlib=libgcc", + "--unwindlib=libunwind", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", -- cgit v1.2.3 From 58bd94f0cf7bba9b91e24d75e991f098723d81ee Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 9 May 2022 20:21:03 -0700 Subject: compiler_wrapper: Disable warning implicit-function-declaration Wimplicit-function-declaration has been promoted to be an default error even with Wno-error. Disable the error by default since it is breaking a lot of packages. BUG=b:230345382 TEST=cq Change-Id: Ib46b0b47a3e1dea3797739370a4d9cf92a4d25f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3637117 Tested-by: Manoj Gupta Auto-Submit: Manoj Gupta Reviewed-by: George Burgess Commit-Queue: Manoj Gupta --- .../testdata/cros_hardened_golden/clang_specific_args.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 7a437ae5..998df08e 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -40,6 +40,7 @@ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -63,7 +64,6 @@ "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", "-Wno-deprecated-copy", - "-Wno-unused-but-set-variable", "-mno-movbe", "-B../../bin", "-target", @@ -110,6 +110,7 @@ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -126,7 +127,6 @@ "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", "-Wno-deprecated-copy", - "-Wno-unused-but-set-variable", "-mno-movbe", "-B../../bin", "-target", @@ -173,6 +173,7 @@ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -189,7 +190,6 @@ "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", "-Wno-deprecated-copy", - "-Wno-unused-but-set-variable", "-mno-movbe", "-B../../bin", "-target", @@ -236,6 +236,7 @@ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -252,7 +253,6 @@ "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", "-Wno-deprecated-copy", - "-Wno-unused-but-set-variable", "-mno-movbe", "-B../../bin", "-target", -- cgit v1.2.3 From ea4a522b15b2e1b22ad7b97c8b91f0791c426edc Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 11:44:23 -0700 Subject: compiler_wrapper: factor clangPostFlags into a function; sort Since order doesn't matter, make this sorted. Otherwise, these are all shared, so no point in repeating them. BUG=b:232114933 TEST=go test Change-Id: Ide3c620de9018fed3fe8d898b21b3d5d4f42700f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639281 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- .../cros_hardened_golden/clang_specific_args.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 998df08e..0b61ab7d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -60,10 +60,10 @@ "-Wunsafe-loop-optimizations", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", - "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", - "-Wno-string-concatenation", "-Wno-deprecated-copy", + "-Wno-implicit-int-float-conversion", + "-Wno-string-concatenation", "-mno-movbe", "-B../../bin", "-target", @@ -123,10 +123,10 @@ "-Wno-#warnings", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", - "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", - "-Wno-string-concatenation", "-Wno-deprecated-copy", + "-Wno-implicit-int-float-conversion", + "-Wno-string-concatenation", "-mno-movbe", "-B../../bin", "-target", @@ -186,10 +186,10 @@ "-Wno-error=uninitialized", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", - "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", - "-Wno-string-concatenation", "-Wno-deprecated-copy", + "-Wno-implicit-int-float-conversion", + "-Wno-string-concatenation", "-mno-movbe", "-B../../bin", "-target", @@ -249,10 +249,10 @@ "-someflag", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", - "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", - "-Wno-string-concatenation", "-Wno-deprecated-copy", + "-Wno-implicit-int-float-conversion", + "-Wno-string-concatenation", "-mno-movbe", "-B../../bin", "-target", -- cgit v1.2.3 From 5cab4b87ccc87292502d74a222f4c005bc300ad8 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 11:53:14 -0700 Subject: compiler_wrapper: sort clangFlags; partition for dedup This CL sorts clang flags, and puts ones shared across all CrOS configurations into their own textual blocks. This should make factoring these out into their own function not require golden updates, which makes verifying the CL that actually _does_ that simpler. BUG=b:232114933 TEST=go test Change-Id: I7dc6110d680505d4ad2af98709730e85c386ae5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639682 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess Commit-Queue: George Burgess --- .../cros_hardened_golden/clang_specific_args.json | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 0b61ab7d..03e1aecd 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -27,20 +27,20 @@ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", - "-fno-addrsig", - "-fdebug-default-version=5", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + "--unwindlib=libunwind", "-Wno-section", + "-fno-addrsig", "-fuse-ld=lld", - "--unwindlib=libunwind", - "-Wno-final-dtor-non-final-class", - "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -97,20 +97,20 @@ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", - "-fno-addrsig", - "-fdebug-default-version=5", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + "--unwindlib=libunwind", "-Wno-section", + "-fno-addrsig", "-fuse-ld=lld", - "--unwindlib=libunwind", - "-Wno-final-dtor-non-final-class", - "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -160,20 +160,20 @@ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", - "-fno-addrsig", - "-fdebug-default-version=5", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + "--unwindlib=libunwind", "-Wno-section", + "-fno-addrsig", "-fuse-ld=lld", - "--unwindlib=libunwind", - "-Wno-final-dtor-non-final-class", - "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -223,20 +223,20 @@ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", "-Qunused-arguments", - "-fno-addrsig", - "-fdebug-default-version=5", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + "--unwindlib=libunwind", "-Wno-section", + "-fno-addrsig", "-fuse-ld=lld", - "--unwindlib=libunwind", - "-Wno-final-dtor-non-final-class", - "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From 76b677b89b385083ab2b243308e745abb6b4261c Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Wed, 11 May 2022 11:59:37 -0700 Subject: compiler_wrapper: Disable warning implicit-int Wimplicit-int has been promoted to be an default error even with Wno-error. Disable the error by default since it is breaking a lot of packages. BUG=b:231987783 TEST=cq Change-Id: If88877cb63cdd5c392fcf05c2940751547466213 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3642338 Tested-by: Manoj Gupta Reviewed-by: George Burgess Commit-Queue: George Burgess Auto-Submit: Manoj Gupta --- .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 03e1aecd..0d7e87d1 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -31,6 +31,7 @@ "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", @@ -101,6 +102,7 @@ "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", @@ -164,6 +166,7 @@ "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", @@ -227,6 +230,7 @@ "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", -- cgit v1.2.3 From 341ee8c2cf75bd3b8f3297f5025416bdfcc97b0c Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Thu, 23 Jun 2022 18:16:25 +0000 Subject: compiler_wrapper: Stop managing pie flags With CL:3710850, pie will be defaults for clang and GCC (cross-compiles). No need to manage them separately. BUG=b:190047257 TEST=go test Change-Id: Icf8e74d6a31c5de678ec9a6a5c321a17a0154d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3722436 Reviewed-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Auto-Submit: Manoj Gupta Tested-by: Manoj Gupta Commit-Queue: George Burgess --- .../testdata/cros_hardened_golden/clang_specific_args.json | 8 -------- 1 file changed, 8 deletions(-) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 0d7e87d1..e4cc49ee 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -45,8 +45,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-fPIE", - "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", @@ -116,8 +114,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-fPIE", - "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", @@ -180,8 +176,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-fPIE", - "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", @@ -244,8 +238,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-fPIE", - "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", -- cgit v1.2.3 From 0665748ca334615e7f41978c36b8fba7817ed2c7 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 1 Sep 2022 17:51:48 +0000 Subject: compiler_wrapper: redisable unused-but-set-var This CL add the Wno-unused-but-set-variable flag back into the compiler wrapper. It was previously removed, but there are still occurances of the warning and so we were never able to bundle that change into chromoumos-overlay/llvm. An attempt to revert the original CL failed due to a merge conflict. BUG=b:227655984 TEST=None Change-Id: Ic148a6ae577d5e4394249693ce9b09b95cb9df16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3868978 Commit-Queue: Ryan Beltran Reviewed-by: George Burgess Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta --- .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json') diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index e4cc49ee..ec91216d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -61,6 +61,7 @@ "-L/usr/x86_64-cros-linux-gnu/usr/lib64", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", "-mno-movbe", @@ -123,6 +124,7 @@ "-L/usr/x86_64-cros-linux-gnu/usr/lib64", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", "-mno-movbe", @@ -185,6 +187,7 @@ "-L/usr/x86_64-cros-linux-gnu/usr/lib64", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", "-mno-movbe", @@ -247,6 +250,7 @@ "-L/usr/x86_64-cros-linux-gnu/usr/lib64", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", "-mno-movbe", -- cgit v1.2.3