[clang] [clang-repl] Use default visibility for symbols while building CompilerInstance against emscripten (PR #116779)

Anutosh Bhat via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 19 07:10:56 PST 2024


https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/116779

>From 616ebd6b6487eeaa302e6d33de3a371e6c9843f5 Mon Sep 17 00:00:00 2001
From: anutosh491 <andersonbhat491 at gmail.com>
Date: Tue, 19 Nov 2024 15:38:37 +0530
Subject: [PATCH 1/2] Use default visibility for symbols while building
 CompilerInstance against emscripten

---
 clang/lib/Interpreter/Interpreter.cpp | 1 +
 clang/lib/Interpreter/Wasm.cpp        | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 73ad766e655180..999271aae7491d 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -197,6 +197,7 @@ IncrementalCompilerBuilder::CreateCpp() {
   Argv.push_back("-target");
   Argv.push_back("wasm32-unknown-emscripten");
   Argv.push_back("-shared");
+  Argv.push_back("-fvisibility=default")
 #endif
   Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());
 
diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp
index 79efbaa03982d0..6d4cc478dd6a85 100644
--- a/clang/lib/Interpreter/Wasm.cpp
+++ b/clang/lib/Interpreter/Wasm.cpp
@@ -75,7 +75,6 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
                                           "-shared",
                                           "--import-memory",
                                           "--no-entry",
-                                          "--export-all",
                                           "--experimental-pic",
                                           "--stack-first",
                                           "--allow-undefined",

>From fedc699c66ba973798bd452b5a6607d412e4cb75 Mon Sep 17 00:00:00 2001
From: Anutosh Bhat <andersonbhat491 at gmail.com>
Date: Tue, 19 Nov 2024 17:27:59 +0530
Subject: [PATCH 2/2] Update Interpreter.cpp

---
 clang/lib/Interpreter/Interpreter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 999271aae7491d..00111daab01e37 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -197,7 +197,7 @@ IncrementalCompilerBuilder::CreateCpp() {
   Argv.push_back("-target");
   Argv.push_back("wasm32-unknown-emscripten");
   Argv.push_back("-shared");
-  Argv.push_back("-fvisibility=default")
+  Argv.push_back("-fvisibility=default");
 #endif
   Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());
 



More information about the cfe-commits mailing list