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

Compilation failure on Apple Silicon M1 Max (clang 17) #659

Closed
sblank opened this issue Apr 29, 2024 · 12 comments · Fixed by #660
Closed

Compilation failure on Apple Silicon M1 Max (clang 17) #659

sblank opened this issue Apr 29, 2024 · 12 comments · Fixed by #660
Assignees

Comments

@sblank
Copy link

sblank commented Apr 29, 2024

Sometime in the last month (or a bit earlier), I began receiving the following error:

/Users/sblank/Desktop/BlitzMax/dist/bootstrap/mod/brl.mod/hook.mod/.bmx/hook.bmx.release.macos.arm64.c:18:26: error: incompatible function pointer types assigning to 'BBOBJECT (*)(BBINT, BBOBJECT, BBOBJECT)' (aka 'struct BBObject ()(int, struct BBObject *, struct BBObject )') from 'void ()()' [-Wincompatible-function-pointer-types]

at several points in the compilation process, resulting in a build failure. My assumption is that some update or other to clang has introduced a more strict compilation, but I've been unable to find a workaround or fix.

Has anyone else experienced this behavior?

@woollybah
Copy link
Member

What version of llvm are you using?
eg

% clang --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@woollybah
Copy link
Member

I've installed 17 via hombrew and configured BlitzMax to build using that, and am able to reproduce. Thanks.

@sblank
Copy link
Author

sblank commented Apr 30, 2024

Homebrew clang version 17.0.6
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/17.0.6_1/bin

Thanks!

Stan

@woollybah
Copy link
Member

You can get around it for the time being (until a fix is implemented) by adding something like this to custom.bmk

setccopt functionptrs -Wno-incompatible-function-pointer-types

@woollybah woollybah changed the title Compilation failure on Apple Silicon M1 Max Compilation failure on Apple Silicon M1 Max (clang 17) Apr 30, 2024
@woollybah woollybah self-assigned this Apr 30, 2024
@sblank
Copy link
Author

sblank commented Apr 30, 2024

Unfortunately, the workaround didn't do the trick and the same errors appeared. I added the line in three 'custom.bmk' locations:

~/BlitzMax/bin/custom.bmk
~/BlitzMax/dist/bootstrap/src/bmk/custom.bmk
~/BlitzMax/src/bmk/custom.bmk

I can wait for the fix, no worries.

Thank you for working on this issue!

Stan

@woollybah
Copy link
Member

You'd probably need to regenerate the bootstrap code and scripts with the new option included in the version of BlitzMax you are building with.

@sblank
Copy link
Author

sblank commented May 1, 2024

Regenerating the bootstrap code is something that is beyond my expertise at the moment. I've poked around a bit, but I'm not certain where to start. I'm using the latest bmx-ng version from a few days ago.

Regards,

Stan

@sblank
Copy link
Author

sblank commented May 3, 2024

Thanks Brucey! I'll check it out later today... looking forward to it!

Cheers,

Stan

@GWRon
Copy link
Contributor

GWRon commented May 26, 2024

Thanks Brucey! I'll check it out later today... looking forward to it!

Cheers,

Stan

Hey Stan,
did you check it out ? And does it run flawless for you?

Asking as the commit fixing your issue leads to issues on other user's computers (at least Windows of others, and on my Linux box too -> #662).

@sblank
Copy link
Author

sblank commented May 26, 2024 via email

@sblank
Copy link
Author

sblank commented May 26, 2024 via email

@sblank
Copy link
Author

sblank commented May 29, 2024 via email

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 a pull request may close this issue.

3 participants