Skip to content

Conversation

@alexcrichton
Copy link
Collaborator

  • Don't use LTO for startup objects
  • Put startup objects in the normal sysroot without LTO
  • Pass -flto in linker flags
  • Disable a test that fails with LTO enabled (unsure why)

* Don't use LTO for startup objects
* Put startup objects in the normal sysroot without LTO
* Pass `-flto` in linker flags
* Disable a test that fails with LTO enabled (unsure why)
@alexcrichton
Copy link
Collaborator Author

This was discovered as part of WebAssembly/wasi-sdk#584 where the wasm-tools command run on startup objects failed because the startup objects weren't actually wasm, they're bitcode. I don't believe enabling LTO in this repository has ever worked for running tests, only for building. This attempts to get everything working. I did a bit of digging to figure out what's going wrong in the failing test, but in the end I have no idea why. It's probably some strict aliasing thing or something like that, so I've just disabled it for now.

@yamt
Copy link
Contributor

yamt commented Jan 13, 2026

This was discovered as part of WebAssembly/wasi-sdk#584 where the wasm-tools command run on startup objects failed because the startup objects weren't actually wasm, they're bitcode. I don't believe enabling LTO in this repository has ever worked for running tests, only for building. This attempts to get everything working. I did a bit of digging to figure out what's going wrong in the failing test, but in the end I have no idea why. It's probably some strict aliasing thing or something like that, so I've just disabled it for now.

is this something specific to p2/p3?

endif()
add_libc_test(functional/search_insque.c)
if (LTO STREQUAL "full")
set_tests_properties(libc_test_functional_search_insque.wasm PROPERTIES WILL_FAIL TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a link to a bug report?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have a bug report to link to. This repository does not control the source of this test, nor does this repository have WASI-specific source for insque and other functions. (I barely know what those functions are). If you'd like to open an issue I'd be happy to link it here.

@yamt
Copy link
Contributor

yamt commented Jan 13, 2026

Don't use LTO for startup objects

why?

Put startup objects in the normal sysroot without LTO

why?

Pass -flto in linker flags

this makes sense.

@alexcrichton
Copy link
Collaborator Author

Yes, startup objects are per-target. LTO is diasbles so the wasm-tools processing works. They're put in the normal sysroot because otherwise clang-19 locally didn't seem to find them.

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