Commit a3519fbd authored by Max Lv's avatar Max Lv

enable aarch64 and x86_64 build

parent 486288a5
...@@ -304,13 +304,13 @@ openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \ ...@@ -304,13 +304,13 @@ openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \
include $(openssl_subdirs) include $(openssl_subdirs)
# Iptables # Iptables
LOCAL_PATH := $(ROOT_PATH) # LOCAL_PATH := $(ROOT_PATH)
iptables_subdirs := $(addprefix $(LOCAL_PATH)/iptables/,$(addsuffix /Android.mk, \ # iptables_subdirs := $(addprefix $(LOCAL_PATH)/iptables/,$(addsuffix /Android.mk, \
iptables \ # iptables \
extensions \ # extensions \
libiptc \ # libiptc \
)) # ))
include $(iptables_subdirs) # include $(iptables_subdirs)
# Import cpufeatures # Import cpufeatures
$(call import-module,android/cpufeatures) $(call import-module,android/cpufeatures)
APP_ABI := armeabi-v7a x86 APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_PLATFORM := android-16 APP_PLATFORM := android-16
APP_STL := stlport_static APP_STL := stlport_static
NDK_TOOLCHAIN_VERSION := 4.9 NDK_TOOLCHAIN_VERSION := 4.9
...@@ -477,6 +477,7 @@ arc4random(void) ...@@ -477,6 +477,7 @@ arc4random(void)
} }
#endif #endif
#ifndef _EVENT_HAVE_ARC4RANDOM_BUF
ARC4RANDOM_EXPORT void ARC4RANDOM_EXPORT void
arc4random_buf(void *_buf, size_t n) arc4random_buf(void *_buf, size_t n)
{ {
...@@ -490,6 +491,7 @@ arc4random_buf(void *_buf, size_t n) ...@@ -490,6 +491,7 @@ arc4random_buf(void *_buf, size_t n)
} }
_ARC4_UNLOCK(); _ARC4_UNLOCK();
} }
#endif
#ifndef ARC4RANDOM_NOUNIFORM #ifndef ARC4RANDOM_NOUNIFORM
/* /*
......
...@@ -31,11 +31,20 @@ ...@@ -31,11 +31,20 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
int int
epoll_create(int size) epoll_create(int size)
{ {
return (syscall(__NR_epoll_create, size)); #if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
if (size <= 0) {
errno = EINVAL;
return -1;
}
return (syscall(__NR_epoll_create1, 0));
#else
return (syscall(__NR_epoll_create, size));
#endif
} }
int int
...@@ -48,5 +57,9 @@ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) ...@@ -48,5 +57,9 @@ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
int int
epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{ {
return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout)); #if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
#else
return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
#endif
} }
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
/* #undef _EVENT_DISABLE_THREAD_SUPPORT */ /* #undef _EVENT_DISABLE_THREAD_SUPPORT */
/* Define to 1 if you have the `arc4random' function. */ /* Define to 1 if you have the `arc4random' function. */
#if !defined(__aarch64__) && !defined(__x86_64__)
#define _EVENT_HAVE_ARC4RANDOM 1 #define _EVENT_HAVE_ARC4RANDOM 1
#endif
/* Define to 1 if you have the `arc4random_buf' function. */ /* Define to 1 if you have the `arc4random_buf' function. */
/* #undef _EVENT_HAVE_ARC4RANDOM_BUF */ #define _EVENT_HAVE_ARC4RANDOM_BUF
/* Define to 1 if you have the <arpa/inet.h> header file. */ /* Define to 1 if you have the <arpa/inet.h> header file. */
#define _EVENT_HAVE_ARPA_INET_H 1 #define _EVENT_HAVE_ARPA_INET_H 1
...@@ -262,7 +264,7 @@ ...@@ -262,7 +264,7 @@
/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */ /* #undef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
/* Define to 1 if you have the `sysctl' function. */ /* Define to 1 if you have the `sysctl' function. */
#define _EVENT_HAVE_SYSCTL 1 // #define _EVENT_HAVE_SYSCTL 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */ /* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */ /* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
...@@ -301,7 +303,7 @@ ...@@ -301,7 +303,7 @@
#define _EVENT_HAVE_SYS_STAT_H 1 #define _EVENT_HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */ /* Define to 1 if you have the <sys/sysctl.h> header file. */
#define _EVENT_HAVE_SYS_SYSCTL_H 1 //#define _EVENT_HAVE_SYS_SYSCTL_H 1
/* Define to 1 if you have the <sys/time.h> header file. */ /* Define to 1 if you have the <sys/time.h> header file. */
#define _EVENT_HAVE_SYS_TIME_H 1 #define _EVENT_HAVE_SYS_TIME_H 1
......
...@@ -15,7 +15,7 @@ LOCAL_CFLAGS += -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_SCTP \ ...@@ -15,7 +15,7 @@ LOCAL_CFLAGS += -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_SCTP \
# LOCAL_CFLAGS += -DOPENSSL_NO_DEPRECATED # LOCAL_CFLAGS += -DOPENSSL_NO_DEPRECATED
# Extra # Extra
LOCAL_CFLAGS += -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB LOCAL_CFLAGS += -DOPENSSL_NO_HW -DOPENSSL_NO_ASM -DOPENSSL_NO_ENGINE -DZLIB
# Debug # Debug
# LOCAL_CFLAGS += -DCIPHER_DEBUG # LOCAL_CFLAGS += -DCIPHER_DEBUG
...@@ -219,7 +219,9 @@ ...@@ -219,7 +219,9 @@
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
/* Define to 1 if you have the `getline' function. */ /* Define to 1 if you have the `getline' function. */
//#define HAVE_GETLINE 1 #if defined(__aarch64__) || defined(__x86_64__)
#define HAVE_GETLINE 1
#endif
/* Define to 1 if you have the `getpwnam_r' function. */ /* Define to 1 if you have the `getpwnam_r' function. */
//#define HAVE_GETPWNAM_R 1 //#define HAVE_GETPWNAM_R 1
...@@ -282,7 +284,9 @@ ...@@ -282,7 +284,9 @@
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
/* Define to 1 if you have the `stpcpy' function. */ /* Define to 1 if you have the `stpcpy' function. */
//#define HAVE_STPCPY 1 #if defined(__aarch64__) || defined(__x86_64__)
#define HAVE_STPCPY 1
#endif
/* Define to 1 if you have the `stpncpy' function. */ /* Define to 1 if you have the `stpncpy' function. */
//#define HAVE_STPNCPY 1 //#define HAVE_STPNCPY 1
......
...@@ -151,7 +151,9 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW ...@@ -151,7 +151,9 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
/* This is the IPv6 flowid that we pass on to the IPv6 protocol stack. This value was not currently defined /* This is the IPv6 flowid that we pass on to the IPv6 protocol stack. This value was not currently defined
* at the time of writing. Should this change, define a appropriate flowinfo here. */ * at the time of writing. Should this change, define a appropriate flowinfo here. */
#ifndef IPV6_FLOWINFO
#define IPV6_FLOWINFO 0 #define IPV6_FLOWINFO 0
#endif
/* There does not seem to be a function/macro to generate IPv6-mapped IPv4-Adresses. So here comes mine. /* There does not seem to be a function/macro to generate IPv6-mapped IPv4-Adresses. So here comes mine.
* Pass an in_addr* and an in6_addr* */ * Pass an in_addr* and an in6_addr* */
......
...@@ -830,14 +830,6 @@ class Shadowsocks ...@@ -830,14 +830,6 @@ class Shadowsocks
crash_recovery() crash_recovery()
copyAssets(System.getABI)
val ab = new ArrayBuffer[String]
for (executable <- Shadowsocks.EXECUTABLES) {
ab.append("chmod 755 " + Path.BASE + executable)
}
Console.runCommand(ab.toArray)
} }
private def recovery() { private def recovery() {
......
...@@ -68,8 +68,8 @@ object Utils { ...@@ -68,8 +68,8 @@ object Utils {
val DEFAULT_SHELL: String = "/system/bin/sh" val DEFAULT_SHELL: String = "/system/bin/sh"
val DEFAULT_ROOT: String = "/system/bin/su" val DEFAULT_ROOT: String = "/system/bin/su"
val ALTERNATIVE_ROOT: String = "/system/xbin/su" val ALTERNATIVE_ROOT: String = "/system/xbin/su"
val DEFAULT_IPTABLES: String = "/data/data/com.github.shadowsocks/iptables" val DEFAULT_IPTABLES: String = "/system/bin/iptables"
val ALTERNATIVE_IPTABLES: String = "/system/bin/iptables" val ALTERNATIVE_IPTABLES: String = "/data/data/com.github.shadowsocks/iptables"
val TIME_OUT: Int = -99 val TIME_OUT: Int = -99
var initialized: Boolean = false var initialized: Boolean = false
var hasRedirectSupport: Int = -1 var hasRedirectSupport: Int = -1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment