Skip to content

Commit 31573bb

Browse files
committed
opencl-clang: fix build with LLVM 18
- Update preferred LLVM version to 18.1.0. - Backport a patch to fix build with LLVM 18. [^1] - Track patches at AOSC-Tracking/opencl-clang @ aosc/v17.0.0. [^1]: intel/opencl-clang#474
1 parent 378a7e1 commit 31573bb

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From 4476f253c57c261d0c068a8b799ffc309fe22164 Mon Sep 17 00:00:00 2001
2+
From: Wenwan Xing <[email protected]>
3+
Date: Wed, 16 Aug 2023 08:12:44 +0800
4+
Subject: [PATCH] add 'Visibility' field to Option (#474)
5+
6+
---
7+
options.h | 4 ++--
8+
options_compile.cpp | 12 ++++++------
9+
2 files changed, 8 insertions(+), 8 deletions(-)
10+
11+
diff --git a/options.h b/options.h
12+
index 3e3ed38..5be4e1c 100644
13+
--- a/options.h
14+
+++ b/options.h
15+
@@ -33,8 +33,8 @@ Copyright (c) Intel Corporation (2009-2017).
16+
enum COMPILE_OPT_ID {
17+
OPT_COMPILE_INVALID = 0, // This is not an option ID.
18+
#define PREFIX(NAME, VALUE)
19+
-#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
20+
- HELPTEXT, METAVAR, VALUES) \
21+
+#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, \
22+
+ VISIBILITY, PARAM, HELPTEXT, METAVAR, VALUES) \
23+
OPT_COMPILE_##ID,
24+
#include "opencl_clang_options.inc"
25+
OPT_COMPILE_LAST_OPTION
26+
diff --git a/options_compile.cpp b/options_compile.cpp
27+
index 7b7aeb5..26693fb 100644
28+
--- a/options_compile.cpp
29+
+++ b/options_compile.cpp
30+
@@ -35,8 +35,8 @@ Copyright (c) Intel Corporation (2009-2017).
31+
static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
32+
static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
33+
NAME##_init, std::size(NAME##_init) - 1);
34+
-#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
35+
- HELPTEXT, METAVAR, VALUES)
36+
+#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, VISIBILITY, \
37+
+ PARAM, HELPTEXT, METAVAR, VALUES)
38+
#include "opencl_clang_options.inc"
39+
#undef OPTION
40+
#undef PREFIX
41+
@@ -47,12 +47,12 @@ extern llvm::ManagedStatic<llvm::sys::SmartMutex<true>> compileMutex;
42+
43+
static constexpr OptTable::Info ClangOptionsInfoTable[] = {
44+
#define PREFIX(NAME, VALUE)
45+
-#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
46+
- HELPTEXT, METAVAR, VALUES) \
47+
+#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, VISIBILITY, \
48+
+ PARAM, HELPTEXT, METAVAR, VALUES) \
49+
{ \
50+
PREFIX, NAME, HELPTEXT, METAVAR, OPT_COMPILE_##ID, \
51+
- llvm::opt::Option::KIND##Class, PARAM, FLAGS, OPT_COMPILE_##GROUP, \
52+
- OPT_COMPILE_##ALIAS, ALIASARGS, VALUES \
53+
+ llvm::opt::Option::KIND##Class, VISIBILITY, PARAM, FLAGS, \
54+
+ OPT_COMPILE_##GROUP, OPT_COMPILE_##ALIAS, ALIASARGS, VALUES \
55+
} \
56+
,
57+
#include "opencl_clang_options.inc"
58+
--
59+
2.44.0
60+

runtime-common/opencl-clang/autobuild/patches/0001-fix-include-dirs.patch

Lines changed: 0 additions & 10 deletions
This file was deleted.

runtime-common/opencl-clang/spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VER=17.0.0
2-
__SYSTEM_LLVM_VER=17.0.6
2+
__SYSTEM_LLVM_VER=18.1.0
33
SRCS="tbl::https://github.com/intel/opencl-clang/archive/refs/tags/v$VER.tar.gz"
44
CHKSUMS="sha256::ddfadeed84aae0f5ef72ff205939e0a6f4f236dbde55fc1f0f8abdfd9d777eb4"
55
CHKUPDATE="anitya::id=230481"

0 commit comments

Comments
 (0)