1 Star 0 Fork 56

cf-zhao/clang

forked from src-openEuler/clang 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0013-Ignored-option-Wa-generate-missing-build-notes.patch 2.41 KB
一键复制 编辑 原始数据 按行查看 历史
wangqiang 提交于 2024-04-29 14:30 . Ignored the option
From 2ce94f822eb951dcff23036f204a98900a4fb805 Mon Sep 17 00:00:00 2001
From: wangqiang <wangqiang1@kylinos.cn>
Date: Wed, 24 Apr 2024 11:21:02 +0800
Subject: [PATCH] Ignored option `-Wa,--generate-missing-build-notes=`
---
clang/lib/Driver/ToolChains/Clang.cpp | 6 ++++++
.../Driver/test-generate-missing-build-notes.cpp | 13 +++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 clang/test/Driver/test-generate-missing-build-notes.cpp
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 6b5930990..704a32912 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2731,6 +2731,12 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
CmdArgs.push_back(Value.data());
} else if (Value == "--version") {
D.PrintVersion(C, llvm::outs());
+ #ifdef BUILD_FOR_OPENEULER
+ } else if (Value.startswith("--generate-missing-build-notes=") &&
+ Args.hasFlag(options::OPT_fgcc_compatible,
+ options::OPT_fno_gcc_compatible, false)) {
+ // Do nothing.
+ #endif
} else {
D.Diag(diag::err_drv_unsupported_option_argument)
<< A->getSpelling() << Value;
diff --git a/clang/test/Driver/test-generate-missing-build-notes.cpp b/clang/test/Driver/test-generate-missing-build-notes.cpp
new file mode 100644
index 000000000..efd5251e6
--- /dev/null
+++ b/clang/test/Driver/test-generate-missing-build-notes.cpp
@@ -0,0 +1,13 @@
+// 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
+// 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
+// RUN: %clang -### -fno-gcc-compatible -Wa,--generate-missing-build-notes=yes %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
+// RUN: %clang -### -fno-gcc-compatible -Wa,--generate-missing-build-notes=no %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
+// CHECK-ERROR: error: unsupported argument '--generate-missing-build-notes=
+
+int main() {
+ return 1;
+}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cf-zhao/clang.git
git@gitee.com:cf-zhao/clang.git
cf-zhao
clang
clang
master

搜索帮助