This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG98fd3b359866: Driver: Don't warn on -mbranch-protection when linking (authored by tstellar).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121983/new/ https://reviews.llvm.org/D121983 Files: clang/include/clang/Driver/Options.td clang/test/Driver/Inputs/main.c clang/test/Driver/aarch64-security-options.c Index: clang/test/Driver/aarch64-security-options.c =================================================================== --- clang/test/Driver/aarch64-security-options.c +++ clang/test/Driver/aarch64-security-options.c @@ -27,6 +27,10 @@ // RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=bar 2>&1 | \ // RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION --check-prefix=WARN +// RUN: %clang -target aarch64--none-eabi -o %t-main.o -mbranch-protection=standard -c %S/Inputs/main.c +// RUN: %clang -target aarch64--none-eabi -o %t-main -mbranch-protection=standard %t-main.o 2>&1 | \ +// RUN: FileCheck --allow-empty %s --check-prefix=LINKER-DRIVER + // WARN-NOT: warning: ignoring '-mbranch-protection=' option because the 'aarch64' architecture does not support it [-Wbranch-protection] // RA-OFF: "-msign-return-address=none" @@ -46,3 +50,7 @@ // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' + +// Check that the linker driver doesn't warn about -mbranch-protection=standard +// as an unused option. +// LINKER-DRIVER-NOT: warning: Index: clang/test/Driver/Inputs/main.c =================================================================== --- /dev/null +++ clang/test/Driver/Inputs/main.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -3442,6 +3442,7 @@ Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">, HelpText<"Select return address signing scope">; def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">, + Group<m_Group>, HelpText<"Enforce targets of indirect branches and function returns">; def mharden_sls_EQ : Joined<["-"], "mharden-sls=">,
Index: clang/test/Driver/aarch64-security-options.c =================================================================== --- clang/test/Driver/aarch64-security-options.c +++ clang/test/Driver/aarch64-security-options.c @@ -27,6 +27,10 @@ // RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=bar 2>&1 | \ // RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION --check-prefix=WARN +// RUN: %clang -target aarch64--none-eabi -o %t-main.o -mbranch-protection=standard -c %S/Inputs/main.c +// RUN: %clang -target aarch64--none-eabi -o %t-main -mbranch-protection=standard %t-main.o 2>&1 | \ +// RUN: FileCheck --allow-empty %s --check-prefix=LINKER-DRIVER + // WARN-NOT: warning: ignoring '-mbranch-protection=' option because the 'aarch64' architecture does not support it [-Wbranch-protection] // RA-OFF: "-msign-return-address=none" @@ -46,3 +50,7 @@ // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' + +// Check that the linker driver doesn't warn about -mbranch-protection=standard +// as an unused option. +// LINKER-DRIVER-NOT: warning: Index: clang/test/Driver/Inputs/main.c =================================================================== --- /dev/null +++ clang/test/Driver/Inputs/main.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -3442,6 +3442,7 @@ Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">, HelpText<"Select return address signing scope">; def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">, + Group<m_Group>, HelpText<"Enforce targets of indirect branches and function returns">; def mharden_sls_EQ : Joined<["-"], "mharden-sls=">,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits