fix: suppress warnings about unused llvm flags#16
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts initialize_wasi_toolchain() to reduce “unused argument” warnings from clang when passing WebAssembly-related -mllvm flags, and to make exception / setjmp linkage more explicit via linker flags.
Changes:
- Wraps
-mllvmWebAssembly backend flags with--start-no-unused-arguments/--end-no-unused-argumentsfor both C and C++ flags. - Moves exception enablement to
CMAKE_CXX_FLAGSand moves libunwind linkage toCMAKE_EXE_LINKER_FLAGS. - Moves setjmp linkage to
CMAKE_EXE_LINKER_FLAGSand applies the same unused-argument suppression wrapping for SJLJ-related-mllvmflags.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c6202d5 to
27bca0d
Compare
27bca0d to
2a9ee0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
initialize_wasi_toolchainfunction inwasi-sdk.toolchain.cmaketo improve compatibility with older versions of clang and clarify linker flag usage. Ensures that certain-mllvmflags do not trigger unused argument warnings, and library linking for exception and setjmp/longjmp support is made more explicit.-mllvmflags with--start-no-unused-argumentsand--end-no-unused-argumentsin bothCMAKE_C_FLAGSandCMAKE_CXX_FLAGSto avoid unused argument warnings in older clang versions. [1] [2]-fwasm-exceptionsto only be appended toCMAKE_CXX_FLAGSand clarified linking againstlibunwindfor exception handling by using-lunwindinCMAKE_EXE_LINKER_FLAGS.setjmplibrary for setjmp/longjmp support by using-lsetjmpinCMAKE_EXE_LINKER_FLAGS.