-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Can't build for SMING_ARCH=Host in Apple M1 Pro #2773
Comments
You have |
Actually, might not be this... Try posting a dump of |
@mikee47 thanks for your response... This is the log from command
|
So on your system running Sming requires GCC. Have a look at https://sming.readthedocs.io/en/latest/getting-started/macos/index.html for installation instructions. You can also try searching for 'installing gcc on macos`. It would be handy to have a MacOS system for testing, but they don't make it easy! |
You are right, I tried to install the GNU version but still doesn't work... As you can see I have installed the GNU versions for
And I set the env variables to define the right
I don't know what else I can do :-( |
I'm trying to get a VM installation of MacOS so I can help further. It's painful... In the meantime, you can edit |
This PR adds the `CLANG_BUILD` for host builds. The toolchain detection logic is in the main build.mk file as there might be future support for clang toolchains for actual devices. It's also a revision to the existing logic which checks GCC compiler version. Try it out using `make SMING_SOC=host CLANG_BUILD=1`. To build with a specific (installed) version of clang, for example clang-15, use `CLANG_BUILD=15` . Further customisation can be made by editing `Sming/Arch/Host/build.mk`. Clang-tidy support (#2648) is also improved as there are some compiler flag differences between GCC and clang which are now shared between CLANG_TIDY and CLANG_BUILD operation. An extra CI build has been added using clang. Further to #2773, the default toolchain for macos is a version of clang (Apple Clang). This PR doesn't quite support that because there are other issues to address, but it's a step in the right direction.
Update, I've been trying to get host builds for MacOS but even with GCC installed we still have to use the xcode linker. Bear with me, I'm sure we can get this working! |
Spoke too soon. The host emulator builds in 32-bit mode to reflect the devices being targeted. GCC and clang both allow building 32-bit binaries for 64-bit platforms. However, it looks like Apple won't support 32-bit applications at all. See https://support.apple.com/en-us/103076. Build fails at the link step because the linker refuses to recognise code compiled with the -m32 option. Revising the framework to support 64-bit builds is problematic because all pointers would become 64-bit. That could be worth investigating if only to allow more general use of the libraries. |
I'm trying to build the basic blink example to debug it in my host machine (Apple M1 Pro) but it fails with the following error:
The text was updated successfully, but these errors were encountered: