Skip to content

Fix compiler-rt/openpm with latest LLVM + -Wunused-template - #27289

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:fix_compiler_rt
Jul 9, 2026
Merged

Fix compiler-rt/openpm with latest LLVM + -Wunused-template#27289
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:fix_compiler_rt

Conversation

@sbc100

@sbc100 sbc100 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Basically cherry-pick llvm/llvm-project#206308:

[compiler-rt][sanitizer_common] Remove internal linkage from RegisterFlag (NFC) (#206308)

RegisterFlag is a static function template in a header, so every TU that
includes it without calling it trips `-Wunused-template`. Dropping
static gives it normal external linkage and clears the warning.

NFC. Part of #202945.

And https://github.com/llvm/llvm-project/pull/#207983

[OpenMP] Remove internal linkage from __kmp_wait template (NFC) (#207983)

__kmp_wait in kmp_dispatch.h is a static function template in a header,
so any TU that includes it without instantiating it trips
-Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp,
kmp_settings.cpp). It is used by kmp_dispatch.cpp and
kmp_dispatch_hier.h. Drop static, which the comment above it already
suggests.

Part of #202945

Basically cherry-pick llvm/llvm-project#206308:

    [compiler-rt][sanitizer_common] Remove internal linkage from RegisterFlag (NFC) (#206308)

    RegisterFlag is a static function template in a header, so every TU that
    includes it without calling it trips `-Wunused-template`. Dropping
    static gives it normal external linkage and clears the warning.

    NFC. Part of #202945.

And https://github.com/llvm/llvm-project/pull/#207983

    [OpenMP] Remove internal linkage from __kmp_wait template (NFC) (#207983)

    __kmp_wait in kmp_dispatch.h is a static function template in a header,
    so any TU that includes it without instantiating it trips
    -Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp,
    kmp_settings.cpp). It is used by kmp_dispatch.cpp and
    kmp_dispatch_hier.h. Drop static, which the comment above it already
    suggests.

    Part of #202945
@sbc100
sbc100 requested review from brendandahl and dschuff July 9, 2026 00:07
@sbc100
sbc100 enabled auto-merge (squash) July 9, 2026 00:12
@sbc100
sbc100 merged commit 4627e65 into emscripten-core:main Jul 9, 2026
39 checks passed
@sbc100
sbc100 deleted the fix_compiler_rt branch July 9, 2026 15:58
sbc100 added a commit that referenced this pull request Jul 20, 2026
The version of openmp that we imported was based on LLVM commit
1823581ecb rather than an emscripten-libs branch.

This change updates the update_openmp.py script, and I verified that
running it against 1823581ecb was a no-op aside from the one-line
downstream patch I made in #27289.
aheejin added a commit that referenced this pull request Jul 29, 2026
This updates (?) OpenMP from 1823581ecb to LLVM 22.1.8:
https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8

Because #27073 added OpenMP from then-LLVM-tot 1823581ecb, this is
effectively not updating but downgrading to make this in sync with our
other LLVM libraries.

All `./test/runner *.test_openmp_max_threads` pass, except for
`strict.test_openmp_max_threads`, which also fails in the main branch.

Additional changes:

- Apply the fix from #27289:
8f254a0

- Remove `kmp_invoke_microtask.cpp` from build:
b104d06
This file was added in llvm/llvm-project#176151
and didn't exist in LLVM 22.1.8 release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants