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

fix windows build on non-cl compilers #2

Closed
wants to merge 3 commits into from

Conversation

zeozeozeo
Copy link

Unsure how correct the changes in rpmalloc.c are, without the change the clang fails with the error cannot combine with previous 'static' declaration specifier, haven't tested it with MSVC.
The changes in CMakeLists.txt seem to work both on clang and gcc.

@zeozeozeo
Copy link
Author

err, doesn't work with msvc

@zeozeozeo zeozeozeo marked this pull request as draft November 2, 2024 16:53
@TheTechsTech
Copy link
Collaborator

Unsure how correct the changes in rpmalloc.c are, without the change the clang fails with the error cannot combine with previous 'static' declaration specifier, haven't tested it with MSVC. The changes in CMakeLists.txt seem to work both on clang and gcc.

Not sure what system you on, but clang and gcc already compiles the way CMakeLists.txt is setup. Otherwise, I could not have GitHub Actions produce release binaries for macOS nor Linux.

@zeozeozeo
Copy link
Author

macOS nor Linux.

I'm trying to fix it on Windows, since the current CMakeLists assumes that you're running a cl-compatible compiler (MSVC or clang-cl) if you're on Windows.
I'm using clang from https://winlibs.com/, but that issue will probably also happen with LLVM-supplied clang too.

@TheTechsTech
Copy link
Collaborator

macOS nor Linux.

I'm trying to fix it on Windows, since the current CMakeLists assumes that you're running a cl-compatible compiler (MSVC or clang-cl) if you're on Windows. I'm using clang from https://winlibs.com/, but that issue will probably also happen with LLVM-supplied clang too.

Cmake really setup to default to native OS host compiler, and my whole setup is an workaround to use tcc for that setup.
But I start off explicitly using whatever is native to the OS/platform to compile tcc.

Your changes is not for native setup, you will have many more issues to train cmake, I find not worth the effort.

Also, rpmalloc.c already compiles with clang on macOS without issue see direct tests, https://github.com/zelang-dev/rpmalloc/actions/runs/11645047833 and https://github.com/zelang-dev/rpmalloc/actions/runs/11060756902

@zeozeozeo
Copy link
Author

Cmake really setup to default to native OS host compiler

I'm on Windows and I have $CC set to clang, meaning I have to go out of my way to install/compile with MSVC just to compile tcc, not very convenient :/
but i understand if this is out of the scope of this project, if so this may be closed.

@TheTechsTech
Copy link
Collaborator

TheTechsTech commented Nov 2, 2024

Yes, that is what I mean, cmake really want you to use native OS compiler, doesn't matter what $CC is, unless using cross compiler. I tried that too.

I build locally on Windows too, then test under WSL2.
I will also test on MacBook Pro, Big Sur, if GitHub Actions show macOS error.

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