From 88fd82d91be7269f2c0355d775a1693a9d277d4a Mon Sep 17 00:00:00 2001
From: Andrea Shepard <andrea@persephoneslair.org>
Date: Tue, 6 Dec 2016 05:28:25 +0000
Subject: [PATCH] Set linkage and constness for charset bitmaps

---
 src/backends/llvm/llvm_charset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backends/llvm/llvm_charset.c b/src/backends/llvm/llvm_charset.c
index 56e3e80c..ae53f54f 100644
--- a/src/backends/llvm/llvm_charset.c
+++ b/src/backends/llvm/llvm_charset.c
@@ -857,6 +857,8 @@ static bool h_llvm_build_ir_for_bitmap(HLLVMParserCompileContext *ctxt,
   LLVMValueRef bitmap_initializer = LLVMConstArray(LLVMInt32Type(), bitmap_entries, 8);
   /* ...and we need a global variable to stick it in to GEP it */
   LLVMValueRef bitmap = LLVMAddGlobal(ctxt->mod, LLVMTypeOf(bitmap_initializer), "bitmap");
+  LLVMSetLinkage(bitmap, LLVMInternalLinkage);
+  LLVMSetGlobalConstant(bitmap, 1);
   LLVMSetInitializer(bitmap, bitmap_initializer);
 
   /* Compute the index into the bitmap */
-- 
GitLab