From 5160f6fefb0021a0b23e99c7cf621a330241c211 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 13 Jun 2023 12:50:51 +0200 Subject: [PATCH] Revert "[Driver] Mark m_x86_Features_Group options as TargetSpecific" This broke cross-builds of llvm from x86_64 to arm64 mac, see comment on https://github.com/llvm/llvm-project/commit/1d6c3e29f6aa45914faa7be00a939b8f550f38e9 > so that they get an error on non-x86 targets. > Follow-up to D151590. > > As a workaround for https://github.com/llvm/llvm-project/issues/63270, we don't > report an error for -msse4.2. This reverts commit 1d6c3e29f6aa45914faa7be00a939b8f550f38e9. --- clang/include/clang/Driver/Options.td | 6 ------ clang/test/Driver/x86-target-features.c | 7 ------- 2 files changed, 13 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 8493081..e2cc71b 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -4772,7 +4772,6 @@ foreach i = {0-7} in } // let Flags = [TargetSpecific] // X86 feature flags -let Flags = [TargetSpecific] in { def mx87 : Flag<["-"], "mx87">, Group; def mno_x87 : Flag<["-"], "mno-x87">, Group; def m80387 : Flag<["-"], "m80387">, Alias; @@ -4806,11 +4805,7 @@ def mssse3 : Flag<["-"], "mssse3">, Group; def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group; def msse4_1 : Flag<["-"], "msse4.1">, Group; def mno_sse4_1 : Flag<["-"], "mno-sse4.1">, Group; -} // let Flags = [TargetSpecific] -// TODO: Make -msse4.2 TargetSpecific after -// https://github.com/llvm/llvm-project/issues/63270 is fixed. def msse4_2 : Flag<["-"], "msse4.2">, Group; -let Flags = [TargetSpecific] in { def mno_sse4_2 : Flag<["-"], "mno-sse4.2">, Group; def msse4 : Flag<["-"], "msse4">, Alias; // -mno-sse4 turns off sse4.1 which has the effect of turning off everything @@ -4983,7 +4978,6 @@ def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group< def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group; def mvzeroupper : Flag<["-"], "mvzeroupper">, Group; def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group; -} // let Flags = [TargetSpecific] // These are legacy user-facing driver-level option spellings. They are always // aliases for options that are spelled using the more common Unix / GNU flag diff --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c index f34b0f8..71bdd2a 100644 --- a/clang/test/Driver/x86-target-features.c +++ b/clang/test/Driver/x86-target-features.c @@ -354,13 +354,6 @@ // CRC32: "-target-feature" "+crc32" // NO-CRC32: "-target-feature" "-crc32" -// RUN: %clang -### --target=aarch64 -mcrc32 -msse4.1 -msse4.2 -mno-sgx %s 2>&1 | FileCheck --check-prefix=NONX86 %s -// NONX86: error: unsupported option '-mcrc32' for target 'aarch64' -// NONX86-NEXT: error: unsupported option '-msse4.1' for target 'aarch64' -/// TODO: This warning is a workaround for https://github.com/llvm/llvm-project/issues/63270 -// NONX86-NEXT: warning: argument unused during compilation: '-msse4.2' [-Wunused-command-line-argument] -// NONX86-NEXT: error: unsupported option '-mno-sgx' for target 'aarch64' - // RUN: %clang --target=i386 -march=i386 -mharden-sls=return %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=SLS-RET,NO-SLS %s // RUN: %clang --target=i386 -march=i386 -mharden-sls=indirect-jmp %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=SLS-IJMP,NO-SLS %s // RUN: %clang --target=i386 -march=i386 -mharden-sls=none -mharden-sls=all %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=SLS-IJMP,SLS-RET %s -- 2.7.4