-
Notifications
You must be signed in to change notification settings - Fork 232
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
Fix: Missing cross compile symbols #5864
base: master
Are you sure you want to change the base?
Conversation
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) | ||
|
||
# Slang specific | ||
set(SLANG_LIB_TYPE STATIC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we setting static library as default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toolchain file is only intended for an easy way to reproduce same build, not intended for merging. You can ignore that file. This is Work in Progress anyways. I'm not expecting to merge as is. Open to ideas
Fixed formatting issue. |
It seems like mingw-w64 doesn't define some symbols like `fread_s` and `_wstat32` when doing cross compile shader-slang#5843 (comment) To clarify, I still encounter other errors because some tools required during the build process are being built for the target system, making them unable to run on the host system " [ 41%] Built target slang-embed [ 42%] Generating slang-torch-prelude.h.cpp /bin/sh: 1: slang-embed: not found " Full commands I used to build (from a fresh install of ubuntu 24.04) " sudo apt install mingw-w64 sudo snap install cmake --classic git clone --recurse-submodules https://github.com/Parad0x84/slang.git cd slang cmake -B build/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./cmake/cross-windows-x86_64.cmake cmake --build build/ --config Release "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to either remove the toolchain file, or mention it in a comment and in building.md that it's intended as an example config and isn't officially supported.
FWIW I didn't need to make the other changes when I built with mingw, but I can look at that when I next go down that path, so if this helps you then happy to merge
Please read this commit message, if you didn't yet: Parad0x84@f25f9ea This PR is not useful as-is. Currently slang-embed can't run at build time, since when cross compiling, it gets built for windows (target) and not for linux (host). If we decide on how to move forward solving this issue, I'm happy to implement it (if I can). Note: I also could do the requested changes, if you wanna just merge this as is. But as I said, currently this PR doesn't achieve anything meaningful |
It seems like mingw-w64 doesn't define some symbols like
fread_s
and_wstat32
when doing cross compile #5843 (comment)To clarify, I still encounter other errors because some tools required during the build process are being built for the target
Full commands I used to build (from a fresh install of ubuntu 24.04)