clang/0003-add-BUILD_FOR_OPENEULER-build-option-to-clang.patch
liyunfei 9687d8d70b add BUILD_FOR_OPENEULER to clang
add BUILD_FOR_OPENEULER make option to clang for gcc compatible.

Signed-off-by: liyunfei <liyunfei33@huawei.com>
2024-02-23 10:18:12 +08:00

41 lines
1.4 KiB
Diff

From 752af60afc7fd9cc986adf280d4d03714228fb04 Mon Sep 17 00:00:00 2001
From: liyunfei <liyunfei33@huawei.com>
Date: Tue, 16 Jan 2024 14:47:02 +0800
Subject: [PATCH] add BUILD_FOR_OPENEULER build option to clang
---
clang/CMakeLists.txt | 5 +++++
clang/include/clang/Driver/CMakeLists.txt | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f7936d72e088..d558b0522e82 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -317,6 +317,11 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
endif()
endif ()
+option(BUILD_FOR_OPENEULER "Add gcc compatible options for openEuler toolchain" OFF)
+if (BUILD_FOR_OPENEULER)
+ add_definitions( -DBUILD_FOR_OPENEULER )
+endif()
+
# Determine HOST_LINK_VERSION on Darwin.
set(HOST_LINK_VERSION)
if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*")
diff --git a/clang/include/clang/Driver/CMakeLists.txt b/clang/include/clang/Driver/CMakeLists.txt
index a9d988047920..ea55ba0f1f27 100644
--- a/clang/include/clang/Driver/CMakeLists.txt
+++ b/clang/include/clang/Driver/CMakeLists.txt
@@ -1,3 +1,7 @@
set(LLVM_TARGET_DEFINITIONS Options.td)
+if (BUILD_FOR_OPENEULER)
+tablegen(LLVM Options.inc -gen-opt-parser-defs -DBUILD_FOR_OPENEULER)
+else()
tablegen(LLVM Options.inc -gen-opt-parser-defs)
+endif()
add_public_tablegen_target(ClangDriverOptions)
--
Gitee