You need to log in to create posts and topics.

Apple Silicon M1 build - it's working!

PreviousPage 2 of 2

Ok thanks.. I'll try and grab gcc from brew, grab a clean reop and go from there..

  • installed GCC via brew (gcc 14)
  • pulled clean repo
  • modified SimulIDE.pri to point to gcc
  • qmake (with warning)
  • make

Builds all the way through till linking. Then complains with this:

Undefined symbols for architecture arm64:
"_CallARM64", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_CallARM64Double", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_CallARM64Float", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_CallARM64Ret128", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_CallARM64RetInMemory", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_GetHFAReturnDouble", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
"_GetHFAReturnFloat", referenced from:
CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned int*, void*, unsigned long long&, void*) in as_callfunc_arm64.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status

Angelscript version update from 2.35.1 to 2.37.0 maybe be needed for M1 based on changes notes?

Hi. Thanks for testing.

I'm a bit lost, not sure what is really happening, so I guess this is not going to be easy...

Angelscript version update from 2.35.1 to 2.37.0 maybe be needed for M1 based on changes notes?

Relevant files are updated to 2.37.0
And seems that you are getting the same results than replacing src/angel/ by AngelScript SDK 2.37.0

The problem is about some asm routines implemented in .s files.
I'm not sure if these files are actually compiled maybe be need an extra step to compile that asm.
You can have a look at build_XX/build/objects/ and check that there is a file: as_callfunc_arm_gcc.o and/or as_callfunc_arm64_xcode.o

Anyway I don't understand why the linker is searching for _CallARM64 when as_callfunc_arm64.cpp is referencing CallARM64, not _CallARM64 (which is implemented in as_callfunc_arm64_xcode.S)

But first thing is to be sure that .S files are compiled.

 

These are the only as_callfunc files in the build_XX/build/objects/ folder:

So might be on to something..

Quote from ndavey on January 26, 2025, 1:38 pm

These are the only as_callfunc files in the build_XX/build/objects/ folder:

So might be on to something..

Ok.. seems that .S files are not compiled.

Not sure which commit are you using. Just to be sure, can you check that SimulIDE.pri contains this line:

SOURCES += $$files( $$PWD/src/angel/src/*.S, true )

In case that you have this, You could try removing the "contains" and brackets :

contains( QMAKE_TARGET.arch, arm64 ) {
    SOURCES += $$files( $$PWD/src/angel/src/*.S, true )
}

 

Hi, just got back to this.. I commented out brackets line you mentioned, this added to .S files to the makefile:

 

Run through build till it hits the .S file:

Have not found a solution for this yet.. but not spent a lot of time on it yet either..

As an aside, I found some code to test in the .pri file:

Result is below, that shows QMAKE_TARGET.arch should be changed to QMAKE_HOST.arch for the contain to work:

Ok, thanks.

I think for MacOs we should avoid to compile as_callfunc_arm_gcc.S
So to test it you could try changing this:

SOURCES += $$files( $$PWD/src/angel/src/*.S, true )

 

By this:

SOURCES += $$PWD/src/angel/src/as_callfunc_arm64_xcode.S

 

If this works then we will see how to integrate  properly in pro file.

Progress... Build completed.. did get this warning:

ld: warning: object file (SimulIDE/SimulIDE-dev/build_XX/build/objects/as_callfunc_arm64_xcode.o) was built for newer 'macOS' version (11.0) than being linked (10.13)

but it loads up:

now to run some of the examples (copied them mac x86 version)..

Is there any specific tests you run on builds?

Almost missed this...

Glad to know you managed to build it!
Now I have to change the project file to (hopefully) make it work for Mac Mx and Linux arm.

About testing:
In this case you can try testing this Encoder, it can be in other category for you.
It comes embedded but it contains an script, so we can see if AngelScript is working:

PreviousPage 2 of 2