') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [wasm][coreCLR] unify -fwasm-exceptions and -msimd128, gcinfo by pavelsavara · Pull Request #120365 · dotnet/runtime · GitHub
Skip to content

[wasm][coreCLR] unify -fwasm-exceptions and -msimd128, gcinfo - #120365

Merged
pavelsavara merged 2 commits into
dotnet:mainfrom
pavelsavara:browser_simd_exceptions
Oct 4, 2025
Merged

[wasm][coreCLR] unify -fwasm-exceptions and -msimd128, gcinfo#120365
pavelsavara merged 2 commits into
dotnet:mainfrom
pavelsavara:browser_simd_exceptions

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Oct 3, 2025

Copy link
Copy Markdown
Member
  • unify -fwasm-exceptions and -msimd128
  • fix gcinfo and create wasm static lib

@pavelsavarapavelsavara added this to the 11.0.0 milestone Oct 3, 2025
@pavelsavarapavelsavara self-assigned this Oct 3, 2025
@pavelsavarapavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels Oct 3, 2025
@github-actionsgithub-actionsBot added the area-Infrastructure-coreclr Only use for closed issues label Oct 3, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

@pavelsavara
pavelsavara marked this pull request as ready for review October 3, 2025 15:34
CopilotAI review requested due to automatic review settings October 3, 2025 15:34

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR unifies the compiler and linker flags for WebAssembly builds by consistently adding both -fwasm-exceptions and -msimd128 flags across all CoreCLR WebAssembly build configurations.

  • Adds -msimd128 flag alongside existing -fwasm-exceptions flag for WASM builds
  • Updates multiple CMakeLists.txt files to ensure consistent SIMD support across CoreCLR components
  • Removes an obsolete TODO comment about JavaScript source maps

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
src/native/corehost/browserhost/sample/CMakeLists.txtRemoves obsolete TODO comment about JS source maps
src/coreclr/pal/CMakeLists.txtAdds -msimd128 to both compile and link options for browser targets
src/coreclr/hosts/corewasmrun/CMakeLists.txtAdds -msimd128 to compile and link options for corewasmrun
src/coreclr/hosts/corerun/CMakeLists.txtAdds -msimd128 to compile and link options for browser builds
src/coreclr/CMakeLists.txtAdds -msimd128 to global compile and link options for WASM architecture

@pavelsavarapavelsavara changed the title [wasm][coreCLR] unify -fwasm-exceptions and -msimd128[wasm][coreCLR] unify -fwasm-exceptions and -msimd128, gcinfoOct 3, 2025
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/ba-g known issues

#103347 and #119023

@pavelsavara
pavelsavara merged commit a869b45 into dotnet:mainOct 4, 2025
124 of 127 checks passed
@pavelsavara
pavelsavara deleted the browser_simd_exceptions branch October 4, 2025 07:43
@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

Why are the compile and link options needed?

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Why are the compile and link options needed?

it enables post-MVP features of the wasm spec, that were not a default for LLVM/emcc 2 years ago, when we last time updated the toolchain.
We plan to update the toolchain again soon, and I think we would get those flags by default.
#119409
#120222

There are more flags that i'm exploring here for Mono, but I didn't win yet #120423

does that answer the question ?

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Nov 7, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-Infrastructure-coreclrOnly use for closed issuesos-browserBrowser variant of arch-wasm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

@pavelsavara@AaronRobinsonMSFT@radekdoulik