From 657702d041c673621a4712b2acfae9b12a7ee24f Mon Sep 17 00:00:00 2001 From: eastb233 Date: Thu, 21 Nov 2024 15:38:40 +0800 Subject: [PATCH] Add option -fGNU-compatibility Sync https://gitee.com/openeuler/llvm-project/pulls/108 and https://gitee.com/openeuler/llvm-project/pulls/123 --- ...n-fGNU-compatibility-aliased-with-fg.patch | 27 +++++++++++++ ...compile-error-for-fGNU-compatibility.patch | 38 +++++++++++++++++++ clang.spec | 7 +++- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0026-Driver-add-option-fGNU-compatibility-aliased-with-fg.patch create mode 100644 0027-Driver-fix-compile-error-for-fGNU-compatibility.patch diff --git a/0026-Driver-add-option-fGNU-compatibility-aliased-with-fg.patch b/0026-Driver-add-option-fGNU-compatibility-aliased-with-fg.patch new file mode 100644 index 0000000..281c096 --- /dev/null +++ b/0026-Driver-add-option-fGNU-compatibility-aliased-with-fg.patch @@ -0,0 +1,27 @@ +From cd2d6fe2cdcb0fa047c77993c23da1fb612970be Mon Sep 17 00:00:00 2001 +From: jianghaibo +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>, + HelpText<"Enable gcc compatibility for openEuler.">; ++def : Flag["-"], "fGNU-compatibility">, ++ Flags<[CC1Option]>, Alias, ++ HelpText<"Alias for -fgcc_compatible">; + def fno_gcc_compatible : Flag<["-"], "fno-gcc-compatible">, Flags<[CC1Option]>; + #endif + +-- +2.38.1.windows.1 + diff --git a/0027-Driver-fix-compile-error-for-fGNU-compatibility.patch b/0027-Driver-fix-compile-error-for-fGNU-compatibility.patch new file mode 100644 index 0000000..50a12fa --- /dev/null +++ b/0027-Driver-fix-compile-error-for-fGNU-compatibility.patch @@ -0,0 +1,38 @@ +From 82d51aca563c40c84b70c0e295a9561d3dd4092b Mon Sep 17 00:00:00 2001 +From: jianghaibo +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>, + HelpText<"Enable gcc compatibility for openEuler.">; +-def : Flag["-"], "fGNU-compatibility">, ++def fGNU_compatibility : Flag<["-"], "fGNU-compatibility">, + Flags<[CC1Option]>, Alias, + 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 + diff --git a/clang.spec b/clang.spec index 96adb94..9e72619 100644 --- a/clang.spec +++ b/clang.spec @@ -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 - 17.0.6-31 +- Add option -fGNU-compatibility + * Wed Nov 20 2024 Funda Wang - 17.0.6-30 - adopt to new cmake macro -- Gitee