!168 Add option -fGNU-compatibility
From: @eastb233 Reviewed-by: @liyunfei33 Signed-off-by: @liyunfei33
This commit is contained in:
commit
c25daedd7c
@ -0,0 +1,27 @@
|
||||
From cd2d6fe2cdcb0fa047c77993c23da1fb612970be Mon Sep 17 00:00:00 2001
|
||||
From: jianghaibo <jianghaibo9@huawei.com>
|
||||
Date: Wed, 6 Nov 2024 16:04:39 +0800
|
||||
Subject: [PATCH] [Driver] add option -fGNU-compatibility aliased with
|
||||
-fgcc-compatible
|
||||
|
||||
---
|
||||
clang/include/clang/Driver/Options.td | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
|
||||
index 530bb53ea9b5..2faa65763234 100644
|
||||
--- a/clang/include/clang/Driver/Options.td
|
||||
+++ b/clang/include/clang/Driver/Options.td
|
||||
@@ -1814,6 +1814,9 @@ def fgcc_compatible : Flag<["-"], "fgcc-compatible">,
|
||||
Flags<[CC1Option]>,
|
||||
MarshallingInfoFlag<DiagnosticOpts<"GccCompatible">>,
|
||||
HelpText<"Enable gcc compatibility for openEuler.">;
|
||||
+def : Flag["-"], "fGNU-compatibility">,
|
||||
+ Flags<[CC1Option]>, Alias<fgcc_compatible>,
|
||||
+ HelpText<"Alias for -fgcc_compatible">;
|
||||
def fno_gcc_compatible : Flag<["-"], "fno-gcc-compatible">, Flags<[CC1Option]>;
|
||||
#endif
|
||||
|
||||
--
|
||||
2.38.1.windows.1
|
||||
|
||||
38
0027-Driver-fix-compile-error-for-fGNU-compatibility.patch
Normal file
38
0027-Driver-fix-compile-error-for-fGNU-compatibility.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 82d51aca563c40c84b70c0e295a9561d3dd4092b Mon Sep 17 00:00:00 2001
|
||||
From: jianghaibo <jianghaibo9@huawei.com>
|
||||
Date: Wed, 20 Nov 2024 16:13:04 +0800
|
||||
Subject: [PATCH] [Driver] fix compile error for -fGNU-compatibility
|
||||
|
||||
---
|
||||
clang/include/clang/Driver/Options.td | 2 +-
|
||||
clang/test/Driver/test-generate-missing-build-notes.cpp | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
|
||||
index ccf395dad35a..c109d7a8fcab 100644
|
||||
--- a/clang/include/clang/Driver/Options.td
|
||||
+++ b/clang/include/clang/Driver/Options.td
|
||||
@@ -1819,7 +1819,7 @@ def fgcc_compatible : Flag<["-"], "fgcc-compatible">,
|
||||
Flags<[CC1Option]>,
|
||||
MarshallingInfoFlag<DiagnosticOpts<"GccCompatible">>,
|
||||
HelpText<"Enable gcc compatibility for openEuler.">;
|
||||
-def : Flag["-"], "fGNU-compatibility">,
|
||||
+def fGNU_compatibility : Flag<["-"], "fGNU-compatibility">,
|
||||
Flags<[CC1Option]>, Alias<fgcc_compatible>,
|
||||
HelpText<"Alias for -fgcc_compatible">;
|
||||
def fno_gcc_compatible : Flag<["-"], "fno-gcc-compatible">, Flags<[CC1Option]>;
|
||||
diff --git a/clang/test/Driver/test-generate-missing-build-notes.cpp b/clang/test/Driver/test-generate-missing-build-notes.cpp
|
||||
index efd5251e6a1c..54ac4c66a5b0 100644
|
||||
--- a/clang/test/Driver/test-generate-missing-build-notes.cpp
|
||||
+++ b/clang/test/Driver/test-generate-missing-build-notes.cpp
|
||||
@@ -1,6 +1,7 @@
|
||||
// REQUIRES: build_for_openeuler
|
||||
// RUN: %clang -### -fgcc-compatible -Wa,--generate-missing-build-notes=yes %s 2>&1 | FileCheck -check-prefix=CHECK-NO-ERROR %s
|
||||
// RUN: %clang -### -fgcc-compatible -Wa,--generate-missing-build-notes=no %s 2>&1 | FileCheck -check-prefix=CHECK-NO-ERROR %s
|
||||
+// RUN: %clang -### -fGNU-compatibility -Wa,--generate-missing-build-notes=no %s 2>&1 | FileCheck -check-prefix=CHECK-NO-ERROR %s
|
||||
// CHECK-NO-ERROR-NOT: --generate-missing-build-notes=
|
||||
// RUN: %clang -### -Wa,--generate-missing-build-notes=yes %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
|
||||
// RUN: %clang -### -Wa,--generate-missing-build-notes=no %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
|
||||
--
|
||||
2.38.1.windows.1
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
Name: %{pkg_name}
|
||||
Version: %{clang_version}
|
||||
Release: 30
|
||||
Release: 31
|
||||
Summary: A C language family front-end for LLVM
|
||||
License: NCSA
|
||||
URL: http://llvm.org
|
||||
@ -77,6 +77,8 @@ Patch22: 0022-Driver-Pass-z-arg-and-Wl-z-arg-option-to-the-linker.patch
|
||||
Patch23: 0023-Handling-of-option-Wall-and-Werror-format-2-override.patch
|
||||
Patch24: 0024-Backport-PATCH-Clang-CodeGen-Add__builtin_bcopy.patch
|
||||
Patch25: 0025-clang-Increase-the-number-of-driver-diagnostics.patch
|
||||
Patch26: 0026-Driver-add-option-fGNU-compatibility-aliased-with-fg.patch
|
||||
Patch27: 0027-Driver-fix-compile-error-for-fGNU-compatibility.patch
|
||||
|
||||
# Patches for clang-tools-extra
|
||||
# See https://reviews.llvm.org/D120301
|
||||
@ -415,6 +417,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{__cmak
|
||||
%{install_bindir}/git-clang-format
|
||||
|
||||
%changelog
|
||||
* Thu Nov 21 2024 eastb233 <xiezhiheng@huawei.com> - 17.0.6-31
|
||||
- Add option -fGNU-compatibility
|
||||
|
||||
* Wed Nov 20 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-30
|
||||
- adopt to new cmake macro
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user