Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link warning: seeing "19.0", expected "20" [-Wversion-check] #22813

Open
CodingMarkus opened this issue Oct 30, 2024 · 2 comments
Open

Link warning: seeing "19.0", expected "20" [-Wversion-check] #22813

CodingMarkus opened this issue Oct 30, 2024 · 2 comments

Comments

@CodingMarkus
Copy link

CodingMarkus commented Oct 30, 2024

Version of emscripten/emsdk:

# emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.66-git
clang version 19.0.0git
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-devel/bin

As you can see, my version of emcc uses clang version 19. But when I build binaries out of object files, I often get this warning:

emcc: warning: LLVM version for clang executable "/opt/local/libexec/llvm-devel/bin/clang" appears incorrect (seeing "19.0", expected "20") [-Wversion-check]

Where does "20" come from? I have no clang 20 installed on my system for sure. clang 20 doesn't even exist yet.

I have clang/llvm 19 and 16 installed, standalone, and the emcc version above (which comes with its own llvm 19 copy) and all code linked by emcc has been built with this emcc version (all *.o files were created by the same emcc that also performs the linking) and thus with clang 19.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 30, 2024

emscripten expects clang built from tip-to-tree, and llvm tip-of-tree currently reports version 20.

See #11362 for more on this issue.

The simplest way to get the correct version of llvm is to install via emsdk install latest.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 30, 2024

I'm guessing you were using an older version of emcc which expected version 19 and then at some point you updated to a newer version that included #22273 (from back in July where we updated the requirement from 19 to 20)

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

No branches or pull requests

2 participants