1 year ago

#64429

test-img

BinaryBang

What is the correct host value for iOS arch arm64 when cross compiling?

Question Description

I was cross compiling SDL2_2.0.20 on my mac for ios with arch arm64. I run into an error,below is the info: error

Question Research

The reason of the error is obvious.

Since I was compling for ios with arch arm64,so the source should not include src/misc/macosx/SDL_sysurl.m. Some thing about recognizing the arch was wrong.

What I do to declare the arch is by setting the flag host as below:

flag="${flag} --host=aarch64-apple-darwin"

The flag variable is used by configure,and the value aarch64-apple-darwin is learned from other shell scripts,and I don't kown how the value comes.

I looked into the configure file,and found below code:

case "$host" in
    *-ios-*)
        ARCH=ios
        ...
        SOURCES="$SOURCES $srcdir/src/misc/ios/*.m"
        ...
        
  *-*-darwin* )
        ARCH=macosx
        ...
        SOURCES="$SOURCES $srcdir/src/misc/macosx/*.m"
        ...

So configure recognized the host as macosx and include all file under src/misc/macosx!

I modified the host value with aarch64-ios-,I did this just to match pattern *-ios-*,and this worked, I got wanted library: enter image description here

Question Conclusion

The host value 'aarch64-apple-darwin' does not work,and aarch64-ios- works.

It works,but I don't kown why it works!

I am wondering how to find out the host value for iOS arch arm64.Is it a constant value defined on apple documentation? Is it a variable defined by different libraries ,and it has a different value in different libraries?

ios

makefile

cpu

cross-compiling

configure

0 Answers

Your Answer

Accepted video resources