1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/19
From 5f872ae4a059ac6a09669e301b8a60b11a25eb42 Mon Sep 17 00:00:00 2001
From: Craig Andrews <candrews@integralblue.com>
Date: Wed, 31 Jul 2019 11:51:17 -0400
Subject: [PATCH 1/2] Link additional required LLVM libraries
Without these additional required dependencies, linking fails with errors such as:
`undefined reference to `llvm::errs()'`
---
CMakeLists.txt | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 454b830..95e5799 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,7 +185,11 @@ add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
include_directories(./yaml-cpp/include)
set(CLANG_LIBS
- clangFrontendTool)
+ clangFrontendTool
+ clangFrontend
+ clangBasic
+ clangDriver
+ clangSerialization)
set(LLD_LIBS
lldELF
@@ -193,8 +197,19 @@ set(LLD_LIBS
llvm_map_components_to_libnames(LLVM_LIBS
${LLVM_TARGETS_TO_BUILD}
+ Option
DebugInfoDWARF
- Symbolize)
+ Symbolize
+ Support
+ Object
+ BitWriter
+ MC
+ MCParser
+ MCDisassembler
+ Core
+ IRReader
+ CodeGen
+ Linker)
target_link_libraries(amd_comgr
PUBLIC
From ffc4d18a7ae1fbd5c8807eec4ca8aed043524811 Mon Sep 17 00:00:00 2001
From: Craig Andrews <candrews@integralblue.com>
Date: Mon, 30 Sep 2019 10:52:12 -0400
Subject: [PATCH 2/2] Link more required LLVM libraries
Without these additional required dependencies, linking fails with errors such as:
```
in function `amd_comgr_index_list_metadata':
<artificial>:(.text+0x4d4c): undefined reference to `llvm::msgpack::ArrayDocNode::operator[](unsigned long)'
```
and
```
undefined reference to `llvm::msgpack::Document::fromYAML(llvm::StringRef)'
```
---
CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95e5799..b6123a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -209,7 +209,8 @@ llvm_map_components_to_libnames(LLVM_LIBS
Core
IRReader
CodeGen
- Linker)
+ Linker
+ BinaryFormat)
target_link_libraries(amd_comgr
PUBLIC
|