From 82039eea869a48d37f5a610be1a71249334a8316 Mon Sep 17 00:00:00 2001 From: Dwight Guth Date: Thu, 17 Oct 2024 11:59:33 -0500 Subject: [PATCH] add hidden visibility flag (#4666) This PR adds a flag to kompile which passes through to the llvm backend. Fairly straightforward. --- .../main/java/org/kframework/backend/llvm/LLVMBackend.java | 3 +++ .../org/kframework/backend/llvm/LLVMKompileOptions.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java index 420f6c16761..e154e7b6530 100644 --- a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java +++ b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java @@ -146,6 +146,9 @@ private void llvmKompile(String type, String executable) { if (options.llvmMutableBytes) { args.add("--mutable-bytes"); } + if (options.llvmHiddenVisibility) { + args.add("--hidden-visibility"); + } if (options.debug) { args.add("-g"); diff --git a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMKompileOptions.java b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMKompileOptions.java index 282b58c2f08..b330a5268a9 100644 --- a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMKompileOptions.java +++ b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMKompileOptions.java @@ -119,4 +119,10 @@ public List convert(String str) { description = "Use a faster, unsound representation for byte arrays on the LLVM backend", hidden = true) public boolean llvmMutableBytes; + + @Parameter( + names = "--llvm-hidden-visibility", + description = "Build the llvm backend with -fvisibility=hidden", + hidden = true) + public boolean llvmHiddenVisibility; }