From 5aebcc76ab5ba4a054723e66a951f248641542c4 Mon Sep 17 00:00:00 2001 From: kvpanch <223931578+kvpanch@users.noreply.github.com> Date: Wed, 4 Mar 2026 09:41:38 -0500 Subject: [PATCH] Disable LLVM warnings and enable LTO in emscripten build (#487) Fixed #148 and last task of #156 --- crates/llvm-builder/src/platforms/wasm32_emscripten.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/llvm-builder/src/platforms/wasm32_emscripten.rs b/crates/llvm-builder/src/platforms/wasm32_emscripten.rs index fd6d204..93cdc39 100644 --- a/crates/llvm-builder/src/platforms/wasm32_emscripten.rs +++ b/crates/llvm-builder/src/platforms/wasm32_emscripten.rs @@ -91,6 +91,7 @@ fn build_host( target_directory.to_string_lossy() ), "-DLLVM_BUILD_SHARED_LIBS='Off'", + "-DLLVM_ENABLE_WARNINGS='Off'", "-DCMAKE_BUILD_TYPE='Release'", &format!( "-DLLVM_TARGETS_TO_BUILD='WebAssembly;{}'", @@ -152,10 +153,8 @@ fn build_target( "Ninja", "-DLINKER_SUPPORTS_COLOR_DIAGNOSTICS=0", "-DCMAKE_BUILD_WITH_INSTALL_RPATH=1", - // Enable thin LTO but emscripten has various issues with it. - // FIXME: https://github.com/paritytech/revive/issues/148 - //"-DLLVM_ENABLE_LTO='Thin'", - //"-DCMAKE_EXE_LINKER_FLAGS='-Wl,-u,htons -Wl,-u,htonl -Wl,-u,fileno -Wl,-u,ntohs'", + "-DLLVM_ENABLE_LTO='Thin'", + "-DCMAKE_EXE_LINKER_FLAGS='-Wl,-u,htons -Wl,-u,htonl -Wl,-u,fileno -Wl,-u,ntohs'", &format!( "-DCMAKE_INSTALL_PREFIX='{}'", target_directory.to_string_lossy()