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

error: Unsupported architecture #1170

Open
karajanyp opened this issue Jun 8, 2018 · 10 comments
Open

error: Unsupported architecture #1170

karajanyp opened this issue Jun 8, 2018 · 10 comments

Comments

@karajanyp
Copy link

When I try to build capstone on Mac OS X 10.12.3 (16D30) with the command "./make.sh ios", I get the following errors:
admin:capstone$ ./make.sh ios
CC cs.o
In file included from cs.c:11:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdio.h:64:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/cdefs.h:761:2: error:
Unsupported architecture
#error Unsupported architecture
^
In file included from cs.c:11:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdio.h:67:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/_types.h:27:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:33:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/machine/_types.h:34:2: error:
architecture not supported
#error architecture not supported
^
In file included from cs.c:11:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdio.h:67:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/_types.h:27:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:55:9: error:
unknown type name '__int64_t'
typedef __int64_t __darwin_blkcnt_t; /* total blocks /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:56:9: error:
unknown type name '__int32_t'
typedef __int32_t __darwin_blksize_t; /
preferred block size /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:57:9: error:
unknown type name '__int32_t'
typedef __int32_t __darwin_dev_t; /
dev_t /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:60:9: error:
unknown type name '__uint32_t'
typedef __uint32_t __darwin_gid_t; /
[???] process and group IDs /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:61:9: error:
unknown type name '__uint32_t'
typedef __uint32_t __darwin_id_t; /
[XSI] pid_t, uid_t, or gid_t*/
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:62:9: error:
unknown type name '__uint64_t'
typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:68:9: error:
unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /
Used by mach /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:70:9: error:
unknown type name '__uint16_t'
typedef __uint16_t __darwin_mode_t; /
[???] Some file attributes /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:71:9: error:
unknown type name '__int64_t'
typedef __int64_t __darwin_off_t; /
[???] Used for file sizes /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:72:9: error:
unknown type name '__int32_t'
typedef __int32_t __darwin_pid_t; /
[???] process and group IDs /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:73:9: error:
unknown type name '__uint32_t'
typedef __uint32_t __darwin_sigset_t; /
[???] signal set /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:74:9: error:
unknown type name '__int32_t'
typedef __int32_t __darwin_suseconds_t; /
[???] microseconds /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:75:9: error:
unknown type name '__uint32_t'
typedef __uint32_t __darwin_uid_t; /
[???] user IDs /
^
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types.h:76:9: error:
unknown type name '__uint32_t'
typedef __uint32_t __darwin_useconds_t; /
[???] microseconds */
^
In file included from cs.c:11:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdio.h:71:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types/_va_list.h:31:9: error:
unknown type name '__darwin_va_list'; did you mean '__builtin_va_list'?
typedef __darwin_va_list va_list;
^
note: '__builtin_va_list' declared here
In file included from cs.c:11:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdio.h:442:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/_types/_ssize_t.h:30:9: error:
unknown type name '__darwin_ssize_t'
typedef __darwin_ssize_t ssize_t;
^
In file included from cs.c:12:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/stdlib.h:65:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/wait.h:109:
In file included from /Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/sys/signal.h:82:
/Users/admin/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/usr/include/machine/signal.h:34:2: error:
architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [cs.o] Error 1

Can anyone help me with this problem?

@PenguinGeorge
Copy link

@karajanyp Did you find a fix for this? I'm also struggling with this error and can't seem to figure it out.

@aquynh
Copy link
Collaborator

aquynh commented Jan 21, 2019

i have no iOS devices to test this. if anybody can fix this, please send pull req.

@radare
Copy link
Contributor

radare commented Jan 21, 2019

You don't need any iOS device to fix that. The makefile and the script are wrong. here's the fix, see the IS_APPLE comment, i dont think it makes any sense to do things different just because you are an apple, the whole logic can be simplified quite a bit:

diff --git a/Makefile b/Makefile
index 8b618817..c03776f2 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ V ?= 0

 OS := $(shell uname)
 ifeq ($(OS),Darwin)
-LIBARCHS = x86_64
+LIBARCHS ?= x86_64
 PREFIX ?= /usr/local
 endif

diff --git a/make.sh b/make.sh
index 21c55d73..17d4dcf0 100755
--- a/make.sh
+++ b/make.sh
@@ -57,9 +57,8 @@ build_iOS() {
   else
     IOS_ARCHS="$1"
   fi
-  export CC="$IOS_CC"
-  export LIBARCHS="$IOS_ARCHS"
-  CFLAGS="$IOS_CFLAGS" LDFLAGS="$IOS_LDFLAGS" ${MAKE}
+  # That IS_APPLE logic is wrong but it can break other things in the Makefile
+  CFLAGS="$IOS_CFLAGS" LDFLAGS="$IOS_LDFLAGS" ${MAKE} LIBARCHS="${IOS_ARCHS}" CC="${IOS_CC}" V=1 OS=Darwin IS_APPLE=0
 }

 install() {

@aquynh
Copy link
Collaborator

aquynh commented Jan 22, 2019

Can you send pull req, @radare?

@radare
Copy link
Contributor

radare commented Jan 22, 2019 via email

@longv2go
Copy link
Contributor

I got the same issue.

@aquynh
Copy link
Collaborator

aquynh commented Jan 25, 2019

this should be fixed now with #1354

@AntonKukoba1
Copy link

One thing worth mentioning: this fix didn't make to any release yet. It's only in master branch.

@aquynh
Copy link
Collaborator

aquynh commented Jan 10, 2020

A new release will be out next week.

@AntonKukoba1
Copy link

It's a long week...

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

No branches or pull requests

6 participants