mirror of
https://github.com/darlinghq/cctools-port.git
synced 2024-11-26 21:50:26 +00:00
Fixes to make cctools and ld64 work on Android
This commit is contained in:
parent
406ce466ac
commit
5e9c52005f
@ -7,8 +7,8 @@ Originally ported by [cjacker](http://ios-toolchain-based-on-clang-for-linux.goo
|
||||
|
||||
**SUPPORTED OPERATING SYSTEMS:**
|
||||
|
||||
Linux, FreeBSD, Mac OS X, iOS,
|
||||
OpenBSD and NetBSD
|
||||
Linux, Android (Termux), FreeBSD,
|
||||
Mac OS X, iOS, OpenBSD and NetBSD
|
||||
|
||||
**SUPPORTED HOST ARCHITECTURES:**
|
||||
|
||||
|
@ -78,6 +78,7 @@ static char rcsid[] = "$NetBSD: archive.c,v 1.7 1995/03/26 03:27:46 glass Exp $"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mach-o/fat.h>
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <mach-o/arm/reloc.h>
|
||||
#include "as.h"
|
||||
#include "flonum.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include "libc.h"
|
||||
#include <sys/file.h>
|
||||
#include <mach/mach.h>
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <libgen.h>
|
||||
|
@ -29,6 +29,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <assert.h>
|
||||
#include <libc.h>
|
||||
#include "input-file.h"
|
||||
|
@ -19,6 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <ctype.h>
|
||||
#include "as.h"
|
||||
#include "hash.h"
|
||||
|
@ -19,7 +19,7 @@ fi
|
||||
export LIBTOOLIZE
|
||||
mkdir -p m4
|
||||
|
||||
$LIBTOOLIZE -c -i
|
||||
$LIBTOOLIZE -c -i --force
|
||||
aclocal -I m4
|
||||
autoconf
|
||||
|
||||
|
12
cctools/configure
vendored
12
cctools/configure
vendored
@ -16995,6 +16995,18 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
for ac_func in bcopy bcmp bzero index rindex
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
### Check how to access struct stat's tv_nsec field.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_mtimespec.tv_nsec in struct stat" >&5
|
||||
|
@ -202,6 +202,7 @@ AC_CHECK_LIB([uuid],[uuid_generate_random],[
|
||||
AC_SUBST(UUID_LIB)
|
||||
|
||||
AC_CHECK_FUNCS([strmode utimens utimensat])
|
||||
AC_CHECK_FUNCS([bcopy bcmp bzero index rindex])
|
||||
|
||||
### Check how to access struct stat's tv_nsec field.
|
||||
AC_MSG_CHECKING(for st_mtimespec.tv_nsec in struct stat)
|
||||
|
@ -95,7 +95,8 @@
|
||||
#define I386_PGBYTES 4096 /* bytes per 80386 page */
|
||||
#define I386_PGSHIFT 12 /* bitshift for pages */
|
||||
|
||||
#undef PAGE_SIZE /* Cygwin */
|
||||
#undef PAGE_SIZE /* cctools-port */
|
||||
#undef PAGE_MASK
|
||||
#define PAGE_SIZE I386_PGBYTES
|
||||
#define PAGE_SHIFT I386_PGSHIFT
|
||||
#define PAGE_MASK (PAGE_SIZE - 1)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || \
|
||||
defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__ANDROID__)
|
||||
|
||||
#include_next <sys/cdefs.h>
|
||||
|
||||
|
@ -5,18 +5,6 @@
|
||||
#define __USE_GNU
|
||||
#endif
|
||||
|
||||
#ifndef __has_extension
|
||||
#define __has_extension(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef __has_include
|
||||
#define __has_include(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef __has_include_next
|
||||
#define __has_include_next(x) 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -34,7 +34,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#ifndef __ANDROID__ // ld64-port
|
||||
#include <spawn.h>
|
||||
#endif
|
||||
#include <cxxabi.h>
|
||||
#include <Availability.h>
|
||||
#ifdef TAPI_SUPPORT
|
||||
|
@ -22,6 +22,7 @@
|
||||
*/
|
||||
#ifndef KLD
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <libc.h> /* first to get rid of pre-comp warning */
|
||||
#include <mach/mach.h> /* first to get rid of pre-comp warning */
|
||||
#include "stdio.h"
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/file.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <stdlib.h>
|
||||
#include <libc.h>
|
||||
#include <sys/file.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifdef LTO_SUPPORT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <stdlib.h>
|
||||
#include <libc.h>
|
||||
#include <sys/file.h>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -85,6 +85,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <ctype.h>
|
||||
#include <libc.h>
|
||||
#include <dlfcn.h>
|
||||
|
@ -86,6 +86,7 @@
|
||||
#import <stdio.h>
|
||||
#import <stdlib.h>
|
||||
#import <string.h>
|
||||
#import <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#import <limits.h>
|
||||
#import <libc.h>
|
||||
#import <malloc/malloc.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/file.h>
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <libc.h>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <stdlib.h>
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/nlist.h>
|
||||
|
@ -57,6 +57,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/nlist.h>
|
||||
#include <mach-o/reloc.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "stdlib.h"
|
||||
#include "stddef.h"
|
||||
#include "string.h"
|
||||
#include <strings.h> /* cctools-port: For bcmp, bzero ... */
|
||||
#include "mach-o/loader.h"
|
||||
#include "mach-o/arm64/reloc.h"
|
||||
#include "stuff/allocate.h"
|
||||
|
@ -4,6 +4,12 @@ export LC_ALL=C
|
||||
pushd "${0%/*}" &>/dev/null
|
||||
|
||||
PLATFORM=$(uname -s)
|
||||
OPERATING_SYSTEM=$(uname -o || echo "-")
|
||||
|
||||
if [ $OPERATING_SYSTEM == "Android" ]; then
|
||||
export CC="clang -D__ANDROID_API__=26"
|
||||
export CXX="clang++ -D__ANDROID_API__=26"
|
||||
fi
|
||||
|
||||
if [ -z "$LLVM_DSYMUTIL" ]; then
|
||||
LLVM_DSYMUTIL=llvm-dsymutil
|
||||
@ -141,7 +147,7 @@ if [ $OK -eq 1 ]; then
|
||||
pushd $TARGETDIR/bin &>/dev/null
|
||||
ln -sf $TRIPLE-lipo lipo
|
||||
popd &>/dev/null
|
||||
else
|
||||
elif ! which dsymutil &>/dev/null; then
|
||||
echo "int main(){return 0;}" | cc -xc -O2 -o $TARGETDIR/bin/dsymutil -
|
||||
fi
|
||||
|
||||
|
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
target_info(argv, &target, &compiler);
|
||||
if (!get_executable_path(execpath, sizeof(execpath))) abort();
|
||||
snprintf(sdkpath, sizeof(sdkpath), "%s/../SDK/" SDK_DIR, execpath);
|
||||
snprintf(sdkpath, sizeof(sdkpath) - 1, "%s/../SDK/" SDK_DIR, execpath);
|
||||
|
||||
snprintf(codesign_allocate, sizeof(codesign_allocate),
|
||||
"%s-codesign_allocate", target);
|
||||
|
Loading…
Reference in New Issue
Block a user