mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-08 02:55:56 +01:00
Update cctools to 895 and ld64 to 274.2
Other changes: * Add USE_CLANG_AS build.sh option * build_clang.sh: Update Clang version to 3.9.1 * build_compiler_rt.sh: Adjustments for Clang 4.0 and Clang 5.0
This commit is contained in:
parent
9acc00bfc2
commit
5702a9ab39
158
CHANGELOG
158
CHANGELOG
@ -1,162 +1,176 @@
|
||||
/****************************** v0.15 ********************************/
|
||||
|
||||
Changed:
|
||||
* Updated cctools to 895
|
||||
* Updated ld64 to 274.2 (without TAPIv2 support)
|
||||
|
||||
Added:
|
||||
* Support for ThinLTO:
|
||||
-> https://clang.llvm.org/docs/ThinLTO.html
|
||||
-> http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
|
||||
-> Requires LLVM/Clang >= 3.8. LLVM/Clang >= 3.9 is recommended.
|
||||
* USE_CLANG_AS build.sh option:
|
||||
-> Use Clang as assembler.
|
||||
|
||||
/****************************** v0.14 ********************************/
|
||||
|
||||
changed:
|
||||
* updated cctools to 886
|
||||
* updated ld64 to 264.3.102
|
||||
Changed:
|
||||
* Updated cctools to 886
|
||||
* Updated ld64 to 264.3.102
|
||||
|
||||
/****************************** v0.13 ********************************/
|
||||
|
||||
changed:
|
||||
* updated cctools to 877.8
|
||||
* updated ld64 to 253.9
|
||||
Changed:
|
||||
* Updated cctools to 877.8
|
||||
* Updated ld64 to 253.9
|
||||
|
||||
/****************************** v0.12 ********************************/
|
||||
|
||||
changed:
|
||||
* updated cctools to 877.5
|
||||
* updated ld64 to 253.3
|
||||
Changed:
|
||||
* Updated cctools to 877.5
|
||||
* Updated ld64 to 253.3
|
||||
|
||||
added:
|
||||
* support for Xcode 7.x / El Capitan
|
||||
Added:
|
||||
* Support for Xcode 7.x / El Capitan
|
||||
|
||||
/****************************** v0.11 ********************************/
|
||||
|
||||
changed:
|
||||
* '-oc-use-gcc-libs' has been renamed to '-foc-use-gcc-libstdc++'
|
||||
* support for generating fat object files with gcc and '-foc-use-gcc-libstdc++'
|
||||
Changed:
|
||||
* '-oc-use-GCC-libs' has been renamed to '-foc-use-GCC-libstdc++'
|
||||
* Support for generating fat object files with GCC and '-foc-use-GCC-libstdc++'
|
||||
has been removed.
|
||||
* support for setting the language standard via
|
||||
* Support for setting the language standard via
|
||||
'OSXCROSS_C_STANDARD' / 'OSXCROSS_CXX_STANDARD' (env) has been removed
|
||||
|
||||
added:
|
||||
* support for '-stdc++' and '-gstdc++' compiler "shortcuts"
|
||||
Added:
|
||||
* Support for '-stdc++' and '-gstdc++' compiler "shortcuts"
|
||||
o32-clang++ --> uses libstdc++ for <= 10.8 and libc++ for >= 10.9
|
||||
o32-clang++-libc++ --> uses the SDK's libc++
|
||||
o32-clang++-stdc++ --> uses the SDK's libstdc++
|
||||
o32-clang++-gstdc++ --> uses gcc's (build_gcc.sh) libstdc++
|
||||
* unit tests (wrapper)
|
||||
o32-clang++-gstdc++ --> uses GCC's (build_GCC.sh) libstdc++
|
||||
* Unit tests (wrapper)
|
||||
* llvm-dsymutil build script
|
||||
* dsymutil is now wrapped to llvm-dsymutil (LLVM >= 3.8 only)
|
||||
|
||||
/****************************** v0.10 ********************************/
|
||||
|
||||
changed:
|
||||
* improved and colorized wrapper error/warning/debug/info messages
|
||||
* updated cctools to 870
|
||||
* updated ld64 to 242
|
||||
Changed:
|
||||
* Improved and colorized wrapper error/warning/debug/info messages
|
||||
* Updated cctools to 870
|
||||
* Updated ld64 to 242
|
||||
|
||||
added:
|
||||
Added:
|
||||
* Windows support via Cygwin
|
||||
* OpenBSD and DragonFlyBSD support
|
||||
* Linux ARM support
|
||||
* Linux PPC/PPC64 support: Totally untested, but compiles
|
||||
* gcc compiler support: OSXCross can now be built with gcc
|
||||
* GCC compiler support: OSXCross can now be built with GCC
|
||||
* 'osxcross-man' man page tool
|
||||
* p7zip sdk packaging script
|
||||
* a minimalistic xcrun tool
|
||||
* support for ccache symlinks
|
||||
* A minimalistic xcrun tool
|
||||
* Support for ccache symlinks
|
||||
* darling-dmg sdk packaging script
|
||||
* include path warnings for /usr/include and /usr/local/include
|
||||
(can be switched off via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1')
|
||||
* an option to silence osxcross extension warnings
|
||||
* An option to silence osxcross extension warnings
|
||||
(OSXCROSS_NO_EXTENSION_WARNINGS=1)
|
||||
|
||||
/******************************* v0.9 *******************************/
|
||||
|
||||
changed:
|
||||
* updated cctools to 862
|
||||
* updated ld64 to 241.9
|
||||
Changed:
|
||||
* Updated cctools to 862
|
||||
* Updated ld64 to 241.9
|
||||
|
||||
added:
|
||||
Added:
|
||||
* binutils / gdb build script
|
||||
* OSXCROSS_GCC_NO_STATIC_RUNTIME option (env)
|
||||
* osxcross-macports: a minimalistic macports packet manager
|
||||
* osxcross-macports: A minimalistic macports packet manager
|
||||
|
||||
/******************************* v0.8 *******************************/
|
||||
|
||||
changed:
|
||||
* updated cctools to 855
|
||||
* updated ld64 to 236.3
|
||||
* gcc 4.9.0 -> gcc 4.9.2
|
||||
Changed:
|
||||
* Updated cctools to 855
|
||||
* Updated ld64 to 236.3
|
||||
* GCC 4.9.0 -> GCC 4.9.2
|
||||
|
||||
added:
|
||||
* support for new '-arch x86_64h' (requires clang 3.5+)
|
||||
* support for multiple '-arch' flags with gcc
|
||||
* scripts to make sdk extraction possible on linux (xcode 4.2 only)
|
||||
Added:
|
||||
* Support for new '-arch x86_64h' (requires Clang 3.5+)
|
||||
* Support for multiple '-arch' flags with GCC
|
||||
* Scripts to make sdk extraction possible on linux (xcode 4.2 only)
|
||||
* OS X 10.10 support (DP1)
|
||||
* pkg-config wrapper
|
||||
|
||||
/******************************* v0.7 *******************************/
|
||||
|
||||
added:
|
||||
* new compiler wrapper written in C++
|
||||
* '-oc-use-gcc-libs' option (uses './build_gcc.sh' libstdc++)
|
||||
Added:
|
||||
* New compiler wrapper written in C++
|
||||
* '-oc-use-GCC-libs' option (uses './build_GCC.sh' libstdc++)
|
||||
* 10.6 SDK support (10.4-10.9 are all supported now)
|
||||
* 'sw_vers' tool, which is required by some projects
|
||||
* '-stdlib=' support for gcc (as an extension through the wrapper)
|
||||
* '-stdlib=' support for GCC (as an extension through the wrapper)
|
||||
* 'OSXCROSS_C_STANDARD' env var (set C standard globally)
|
||||
* 'OSXCROSS_CXX_STANDARD' env var (set C++ standard globally)
|
||||
* OS X support (as host)
|
||||
|
||||
changed:
|
||||
Changed:
|
||||
* 'osxcross-conf', 'osxcross-env' and the (fake) 'dsymutil' are now
|
||||
implemented in the wrapper
|
||||
* <arch>-apple-darwinXX-cc/c++ defaults now to clang
|
||||
* switched to two-space indents
|
||||
* gcc 4.8.2 -> gcc 4.9.0
|
||||
* <arch>-apple-darwinXX-cc/c++ defaults now to Clang
|
||||
* Switched to two-space indents
|
||||
* GCC 4.8.2 -> GCC 4.9.0
|
||||
|
||||
fixed:
|
||||
* 'MACOSX_DEPLOYMENT_TARGET' env var is now handled correctly
|
||||
|
||||
/******************************* v0.6 *******************************/
|
||||
|
||||
added:
|
||||
Added:
|
||||
* NetBSD support
|
||||
* dependencies installer script (Don Bright)
|
||||
* Dependencies installer script (Don Bright)
|
||||
* SDK packaging script
|
||||
|
||||
/******************************* v0.5 *******************************/
|
||||
|
||||
added:
|
||||
* libc++ support (for both, clang and gcc)
|
||||
Added:
|
||||
* libc++ support (for both, Clang and GCC)
|
||||
* FreeBSD support
|
||||
|
||||
changed:
|
||||
* attempt to make the toolchain less path dependent
|
||||
* updated cctools to 845
|
||||
Changed:
|
||||
* Attempt to make the toolchain less path dependent
|
||||
* Updated cctools to 845
|
||||
|
||||
fixed:
|
||||
* help clang to find its own intrinsic headers
|
||||
(this issue appears to be fixed in clang 3.4+)
|
||||
* building the toolchain on 32 bit systems
|
||||
* Help Clang to find its own intrinsic headers
|
||||
(this issue appears to be fixed in Clang 3.4+)
|
||||
* Building the toolchain on 32 bit systems
|
||||
|
||||
/******************************* v0.4 *******************************/
|
||||
|
||||
added:
|
||||
* gcc build script
|
||||
* a workaround for buggy unistd.h headers
|
||||
Added:
|
||||
* GCC build script
|
||||
* A workaround for buggy unistd.h headers
|
||||
|
||||
/******************************* v0.3 *******************************/
|
||||
|
||||
added:
|
||||
Added:
|
||||
* 10.9 SDK support
|
||||
* *-apple-darwin*-clang* symlinks (same as invoking oXX-clang)
|
||||
|
||||
changed:
|
||||
* no need to build extra cctools binaries for targeting i386,
|
||||
Changed:
|
||||
* No need to build extra cctools binaries for targeting i386,
|
||||
symlinking the x86_64 builds works as well
|
||||
|
||||
/******************************* v0.2 *******************************/
|
||||
|
||||
added:
|
||||
* a check for broken unistd.h
|
||||
* comments to build.sh
|
||||
Added:
|
||||
* A check for broken unistd.h
|
||||
* Comments to build.sh
|
||||
|
||||
changed:
|
||||
* updated cctools to 839 with ld64-134.9
|
||||
Changed:
|
||||
* Updated cctools to 839 with ld64-134.9
|
||||
|
||||
fixed:
|
||||
* check if MacOSX package is present in tarballs
|
||||
Fixed:
|
||||
* Check if MacOSX package is present in tarballs
|
||||
|
||||
/******************************* v0.1 *******************************/
|
||||
|
||||
|
16
build.sh
16
build.sh
@ -80,7 +80,7 @@ if [ -z "$OSX_VERSION_MIN" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
OSXCROSS_VERSION=0.14
|
||||
OSXCROSS_VERSION=0.15
|
||||
|
||||
X86_64H_SUPPORTED=0
|
||||
|
||||
@ -136,9 +136,9 @@ function remove_locks()
|
||||
source $BASE_DIR/tools/trap_exit.sh
|
||||
|
||||
# CCTOOLS
|
||||
CCTOOLS_PATCH_REV=2
|
||||
LINKER_VERSION=264.3.102
|
||||
CCTOOLS="cctools-886-ld64-$LINKER_VERSION"
|
||||
CCTOOLS_PATCH_REV=0
|
||||
LINKER_VERSION=274.2
|
||||
CCTOOLS="cctools-895-ld64-$LINKER_VERSION"
|
||||
CCTOOLS_TARBALL=$(ls $TARBALL_DIR/$CCTOOLS*.tar.* | head -n1)
|
||||
CCTOOLS_REVHASH=$(echo $(basename "$CCTOOLS_TARBALL") | tr '_' '\n' | \
|
||||
tr '.' '\n' | tail -n3 | head -n1)
|
||||
@ -156,15 +156,9 @@ pushd .. &>/dev/null
|
||||
popd &>/dev/null
|
||||
patch -p0 < $PATCH_DIR/cctools-ld64-1.patch
|
||||
patch -p0 < $PATCH_DIR/cctools-ld64-2.patch
|
||||
patch -p1 < $PATCH_DIR/cctools-ld64-misc-fixes-1.patch
|
||||
pushd .. &>/dev/null
|
||||
patch -p0 < $PATCH_DIR/cctools-ld64-cygwin-buildfix.patch
|
||||
patch -p0 < $PATCH_DIR/cctools-ld64-misc-fixes-2.patch
|
||||
rm -r cctools/ld
|
||||
popd &>/dev/null
|
||||
echo ""
|
||||
CONFFLAGS="--prefix=$TARGET_DIR --target=x86_64-apple-$TARGET "
|
||||
CONFFLAGS+="--disable-clang-as "
|
||||
[ -z "$USE_CLANG_AS" ] && CONFFLAGS+="--disable-clang-as "
|
||||
[ -n "$DISABLE_LTO_SUPPORT" ] && CONFFLAGS+="--disable-lto-support "
|
||||
./configure $CONFFLAGS
|
||||
$MAKE -j$JOBS
|
||||
|
@ -59,7 +59,7 @@ source $BASE_DIR/tools/trap_exit.sh
|
||||
MIRROR="http://llvm.org"
|
||||
|
||||
if [ -z "$CLANG_VERSION" ]; then
|
||||
CLANG_VERSION=3.9.0
|
||||
CLANG_VERSION=3.9.1
|
||||
fi
|
||||
|
||||
if [ -z "$INSTALLPREFIX" ]; then
|
||||
|
@ -51,7 +51,8 @@ case $CLANG_VERSION in
|
||||
3.7*) BRANCH=release_37 ;;
|
||||
3.8*) BRANCH=release_38; USE_CMAKE=1; ;;
|
||||
3.9*) BRANCH=release_39; USE_CMAKE=1; ;;
|
||||
4.0*) BRANCH=master; USE_CMAKE=1; ;;
|
||||
4.0*) BRANCH=release_40; USE_CMAKE=1; ;;
|
||||
5.0*) BRANCH=master; USE_CMAKE=1; ;;
|
||||
* ) echo "Unsupported Clang version, must be >= 3.2 and <= 4.0" 1>&2; exit 1;
|
||||
esac
|
||||
|
||||
|
@ -1,62 +0,0 @@
|
||||
diff --git cctools/configure.ac cctools/configure.ac
|
||||
index 56e8f24..5219e3d 100644
|
||||
--- cctools/configure.ac
|
||||
+++ cctools/configure.ac
|
||||
@@ -49,7 +49,8 @@ case $host_os in
|
||||
;;
|
||||
cygwin* )
|
||||
iscygwin=yes
|
||||
- EXTRAFLAGS="-D__LARGE64_FILES -fno-PIC"
|
||||
+ # https://github.com/tpoechtrager/osxcross/issues/87
|
||||
+ EXTRAFLAGS="-D__LARGE64_FILES -D_GNU_SOURCE -fno-PIC"
|
||||
WARNINGS="-Wno-attributes"
|
||||
XCC="gcc"
|
||||
XCXX="g++"
|
||||
diff --git cctools/include/foreign/machine/endian.h cctools/include/foreign/machine/endian.h
|
||||
index 6cf3901..0920fd6 100644
|
||||
--- cctools/include/foreign/machine/endian.h
|
||||
+++ cctools/include/foreign/machine/endian.h
|
||||
@@ -28,7 +28,8 @@
|
||||
/*
|
||||
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
|
||||
*/
|
||||
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
|
||||
+ defined(__DragonFly__) || defined(__CYGWIN__)
|
||||
#include_next <machine/endian.h>
|
||||
#else
|
||||
#ifndef _BSD_MACHINE_ENDIAN_H_
|
||||
@@ -45,4 +46,5 @@
|
||||
#endif
|
||||
|
||||
#endif /* _BSD_MACHINE_ENDIAN_H_ */
|
||||
-#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
+#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ ||
|
||||
+ __DragonFly__ || __CYGWIN__ */
|
||||
diff --git usage_examples/ios_toolchain/wrapper.c usage_examples/ios_toolchain/wrapper.c
|
||||
index c102d79..b88d35a 100644
|
||||
--- usage_examples/ios_toolchain/wrapper.c
|
||||
+++ usage_examples/ios_toolchain/wrapper.c
|
||||
@@ -85,7 +85,8 @@ char *get_executable_path(char *epath, size_t buflen)
|
||||
if (!ok) return NULL;
|
||||
l = strlen(epath);
|
||||
#else
|
||||
- ssize_t l = readlink("/proc/self/exe", epath, buflen);
|
||||
+ ssize_t l = readlink("/proc/self/exe", epath, buflen - 1);
|
||||
+ if (l > 0) epath[l] = '\0';
|
||||
#endif
|
||||
if (l <= 0) return NULL;
|
||||
epath[buflen - 1] = '\0';
|
||||
--- cctools/configure
|
||||
+++ cctools/configure
|
||||
@@ -2627,7 +2627,8 @@
|
||||
;;
|
||||
cygwin* )
|
||||
iscygwin=yes
|
||||
- EXTRAFLAGS="-D__LARGE64_FILES -fno-PIC"
|
||||
+ # https://github.com/tpoechtrager/osxcross/issues/87
|
||||
+ EXTRAFLAGS="-D__LARGE64_FILES -D_GNU_SOURCE -fno-PIC"
|
||||
WARNINGS="-Wno-attributes"
|
||||
XCC="gcc"
|
||||
XCXX="g++"
|
||||
|
@ -1,83 +0,0 @@
|
||||
diff --git cctools/ld64/src/3rd/helper.h cctools/ld64/src/3rd/helper.h
|
||||
index 7649666..a705ac3 100644
|
||||
--- cctools/ld64/src/3rd/helper.h
|
||||
+++ cctools/ld64/src/3rd/helper.h
|
||||
@@ -32,7 +32,7 @@ typedef char uuid_string_t__[37];
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
-#define stoi(a,b) atoi(a.c_str()); do { const char *p = a.c_str(); *b = 0; while (isdigit(*p++)) (*b)++; } while (0)
|
||||
+#define stoi(a,b) atoi(a.c_str()); do { if (!b) break; const char *p = a.c_str(); *b = 0; while (isdigit(*p++)) (*b)++; } while (0)
|
||||
#endif
|
||||
|
||||
#include <dlfcn.h>
|
||||
diff --git cctools/ld64/src/ld/parsers/libunwind/InternalMacros.h cctools/ld64/src/ld/parsers/libunwind/InternalMacros.h
|
||||
index 25c1631..4e01e00 100644
|
||||
--- cctools/ld64/src/ld/parsers/libunwind/InternalMacros.h
|
||||
+++ cctools/ld64/src/ld/parsers/libunwind/InternalMacros.h
|
||||
@@ -46,8 +46,15 @@ struct v128 { unsigned int vec[4]; };
|
||||
|
||||
#define EXPORT __attribute__((visibility("default")))
|
||||
|
||||
+#if 0 // ld64-port
|
||||
#define COMPILE_TIME_ASSERT( expr ) \
|
||||
extern int compile_time_assert_failed[ ( expr ) ? 1 : -1 ] __attribute__( ( unused ) );
|
||||
+#endif
|
||||
+
|
||||
+// ld64-port start
|
||||
+#define COMPILE_TIME_ASSERT( expr ) \
|
||||
+ static_assert(expr, "");
|
||||
+// ld64-port end
|
||||
|
||||
#define ABORT(msg) __assert_rtn(__func__, __FILE__, __LINE__, msg)
|
||||
|
||||
diff --git cctools/ld64/src/ld/passes/bitcode_bundle.cpp cctools/ld64/src/ld/passes/bitcode_bundle.cpp
|
||||
index 162fc77..d4d7509 100644
|
||||
--- cctools/ld64/src/ld/passes/bitcode_bundle.cpp
|
||||
+++ cctools/ld64/src/ld/passes/bitcode_bundle.cpp
|
||||
@@ -53,13 +53,6 @@ extern "C" {
|
||||
static unsigned int lto_api_version() {
|
||||
return LTO_API_VERSION;
|
||||
}
|
||||
-
|
||||
-#if LTO_API_VERSION < 11
|
||||
-static lto_code_gen_t lto_codegen_create_in_local_context() {
|
||||
- // ::lto_api_version() < 14 makes this function unreachable
|
||||
- __builtin_unreachable();
|
||||
-}
|
||||
-#endif
|
||||
#endif
|
||||
// ld64-port end
|
||||
|
||||
diff --git cctools/libstuff/ofile.c cctools/libstuff/ofile.c
|
||||
index 35121ce..1b9199c 100644
|
||||
--- cctools/libstuff/ofile.c
|
||||
+++ cctools/libstuff/ofile.c
|
||||
@@ -1965,6 +1965,8 @@ struct ofile *ofile)
|
||||
struct ar_hdr *ar_hdr;
|
||||
uint32_t ar_name_size, member_name_offset, n;
|
||||
|
||||
+ ar_name_size = 0; /* cctools-port */
|
||||
+
|
||||
/*
|
||||
* Get the address and size of the archive.
|
||||
*/
|
||||
diff --git cctools/misc/nm.c cctools/misc/nm.c
|
||||
index e398f30..c860ae2 100644
|
||||
--- cctools/misc/nm.c
|
||||
+++ cctools/misc/nm.c
|
||||
@@ -527,7 +527,13 @@ void *cookie)
|
||||
llvm_bundle_found = FALSE;
|
||||
#endif /* LTO_SUPPORT */
|
||||
|
||||
- memset(&process_flags, '\0', sizeof(process_flags)); /* cctools-port */
|
||||
+ /* cctools-port start */
|
||||
+ memset(&process_flags, '\0', sizeof(process_flags));
|
||||
+#ifdef LTO_SUPPORT
|
||||
+ llvm_bundle_pointer = NULL;
|
||||
+ llvm_bundle_size = 0;
|
||||
+#endif /* LTO_SUPPORT */
|
||||
+ /* cctools-port end */
|
||||
|
||||
cmd_flags = (struct cmd_flags *)cookie;
|
||||
|
@ -1,334 +0,0 @@
|
||||
diff --git cctools/Makefile.am cctools/Makefile.am
|
||||
index 9f69d04..be83f0a 100644
|
||||
--- cctools/Makefile.am
|
||||
+++ cctools/Makefile.am
|
||||
@@ -1,7 +1,7 @@
|
||||
if ISDARWIN
|
||||
-SUBDIRS=libstuff ar as misc otool ld64 $(LD_CLASSIC)
|
||||
+SUBDIRS=libstuff ar as misc otool ld64
|
||||
else
|
||||
-SUBDIRS=libstuff ar as misc libobjc2 otool ld64 $(LD_CLASSIC)
|
||||
+SUBDIRS=libstuff ar as misc libobjc2 otool ld64
|
||||
endif
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
diff --git cctools/as/driver.c cctools/as/driver.c
|
||||
index b06d085..92410c7 100644
|
||||
--- cctools/as/driver.c
|
||||
+++ cctools/as/driver.c
|
||||
@@ -283,7 +283,7 @@ char **envp)
|
||||
run_clang = 1;
|
||||
|
||||
#ifndef DISABLE_CLANG_AS /* cctools-port */
|
||||
- if(getenv("NO_CLANG_AS") != NULL) /* cctools-port */
|
||||
+ if(getenv("CCTOOLS_NO_CLANG_AS") != NULL) /* cctools-port */
|
||||
run_clang = 0;
|
||||
|
||||
/*
|
||||
@@ -298,9 +298,13 @@ char **envp)
|
||||
arch_flag.cputype == CPU_TYPE_ARM)){
|
||||
#if 0 /* cctools port */
|
||||
as = makestr(prefix, CLANG, NULL);
|
||||
-#else
|
||||
- as = find_clang();
|
||||
#endif
|
||||
+ /* cctools-port start */
|
||||
+#ifndef __APPLE__
|
||||
+ char *target_triple = getenv("CCTOOLS_CLANG_AS_TARGET_TRIPLE");
|
||||
+#endif /* ! __APPLE__ */
|
||||
+ as = find_clang();
|
||||
+ /* cctools-port end */
|
||||
if(!as || access(as, F_OK) != 0){ /* cctools-port: added !as || */
|
||||
printf("%s: assembler (%s) not installed\n", progname,
|
||||
as ? as : "clang"); /* cctools-port:
|
||||
@@ -364,10 +368,12 @@ char **envp)
|
||||
new_argv[j] = "-c";
|
||||
j++;
|
||||
/* cctools-port start */
|
||||
+#ifndef __APPLE__
|
||||
new_argv[j] = "-target";
|
||||
j++;
|
||||
- new_argv[j] = "unknown-apple-darwin";
|
||||
+ new_argv[j] = target_triple ? target_triple : "unknown-apple-darwin";
|
||||
j++;
|
||||
+#endif /* ! __APPLE__ */
|
||||
/* cctools-port end */
|
||||
new_argv[j] = NULL;
|
||||
if(execute(new_argv, verbose))
|
||||
diff --git cctools/configure.ac cctools/configure.ac
|
||||
index 5219e3d..a6a3dd4 100644
|
||||
--- cctools/configure.ac
|
||||
+++ cctools/configure.ac
|
||||
@@ -358,8 +358,6 @@ if test "x$isdarwin" != "xyes"; then
|
||||
AC_CONFIG_FILES([libobjc2/Makefile])
|
||||
fi
|
||||
|
||||
-AC_CONFIG_FILES([ld/Makefile])
|
||||
-
|
||||
AC_CONFIG_FILES([ld64/Makefile])
|
||||
AC_CONFIG_FILES([ld64/src/Makefile])
|
||||
AC_CONFIG_FILES([ld64/src/3rd/Makefile])
|
||||
diff --git cctools/misc/Makefile.am cctools/misc/Makefile.am
|
||||
index c0b7be8..5256aa2 100644
|
||||
--- cctools/misc/Makefile.am
|
||||
+++ cctools/misc/Makefile.am
|
||||
@@ -16,7 +16,11 @@ bin_PROGRAMS = \
|
||||
pagestuff \
|
||||
ranlib \
|
||||
codesign_allocate \
|
||||
- bitcode_strip
|
||||
+ bitcode_strip \
|
||||
+ ctf_insert \
|
||||
+ check_dylib \
|
||||
+ cmpdylib \
|
||||
+ inout
|
||||
|
||||
LDADD = \
|
||||
$(top_builddir)/libstuff/libstuff.la \
|
||||
@@ -46,3 +50,7 @@ ranlib_CFLAGS = -DRANLIB $(AM_CFLAGS)
|
||||
codesign_allocate_SOURCES = codesign_allocate.c
|
||||
bitcode_strip_SOURCES= bitcode_strip.c
|
||||
bitcode_strip_CFLAGS = -DALLOW_ARCHIVES $(AM_CFLAGS)
|
||||
+ctf_insert_SOURCES= ctf_insert.c
|
||||
+check_dylib_SOURCES= check_dylib.c
|
||||
+cmpdylib_SOURCES= cmpdylib.c
|
||||
+inout_SOURCES= inout.c
|
||||
diff --git usage_examples/ios_toolchain/README usage_examples/ios_toolchain/README
|
||||
index ac51229..fc85462 100644
|
||||
--- usage_examples/ios_toolchain/README
|
||||
+++ usage_examples/ios_toolchain/README
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
Please ensure you have read and understood the Xcode license terms before
|
||||
building this toolchain: https://www.apple.com/legal/sla/docs/xcode.pdf.
|
||||
|
||||
-./build.sh /path/to/sdk.tar.* <target cpu>
|
||||
+[LLVM_DSYMUTIL=llvm-dsymutil] ./build.sh /path/to/sdk.tar.* <target cpu>
|
||||
|
||||
Target CPU should be one of armv6, armv7, armv7s and arm64.
|
||||
|
||||
diff --git usage_examples/ios_toolchain/build.sh usage_examples/ios_toolchain/build.sh
|
||||
index 156c21f..a823fa3 100755
|
||||
--- usage_examples/ios_toolchain/build.sh
|
||||
+++ usage_examples/ios_toolchain/build.sh
|
||||
@@ -5,6 +5,14 @@ pushd "${0%/*}" &>/dev/null
|
||||
|
||||
PLATFORM=$(uname -s)
|
||||
|
||||
+if [ -z "$LLVM_DSYMUTIL" ]; then
|
||||
+ LLVM_DSYMUTIL=llvm-dsymutil
|
||||
+fi
|
||||
+
|
||||
+if [ -z "$JOBS" ]; then
|
||||
+ JOBS=$(nproc 2>/dev/null || ncpus 2>/dev/null || echo 1)
|
||||
+fi
|
||||
+
|
||||
set -e
|
||||
|
||||
function verbose_cmd
|
||||
@@ -29,7 +37,7 @@ function extract()
|
||||
bzip2 -dc $1 | tar $tarflags -
|
||||
;;
|
||||
*)
|
||||
- echo "unhandled archive type"
|
||||
+ echo "unhandled archive type" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -80,7 +88,26 @@ echo ""
|
||||
echo "*** building wrapper ***"
|
||||
echo ""
|
||||
|
||||
-echo "int main(){return 0;}" | cc -xc -O2 -o $TARGETDIR/bin/dsymutil -
|
||||
+OK=0
|
||||
+
|
||||
+set +e
|
||||
+which $LLVM_DSYMUTIL &>/dev/null
|
||||
+if [ $? -eq 0 ]; then
|
||||
+ case $($LLVM_DSYMUTIL --version | \
|
||||
+ grep "LLVM version" | head -1 | awk '{print $3}') in
|
||||
+ 3.8*|3.9*|4.0*) OK=1 ;;
|
||||
+ esac
|
||||
+fi
|
||||
+set -e
|
||||
+
|
||||
+if [ $OK -eq 1 ]; then
|
||||
+ ln -sf $(which $LLVM_DSYMUTIL) $TARGETDIR/bin/dsymutil
|
||||
+ pushd $TARGETDIR/bin &>/dev/null
|
||||
+ ln -sf $TRIPLE-lipo lipo
|
||||
+ popd &>/dev/null
|
||||
+else
|
||||
+ echo "int main(){return 0;}" | cc -xc -O2 -o $TARGETDIR/bin/dsymutil -
|
||||
+fi
|
||||
|
||||
verbose_cmd cc -O2 -Wall -Wextra -pedantic wrapper.c \
|
||||
-DTARGET_CPU=\"\\\"$2\\\"\" \
|
||||
@@ -100,7 +127,7 @@ mkdir -p tmp
|
||||
pushd tmp &>/dev/null
|
||||
git clone https://github.com/tpoechtrager/ldid.git
|
||||
pushd ldid &>/dev/null
|
||||
-make INSTALLPREFIX=$TARGETDIR -j4 install
|
||||
+make INSTALLPREFIX=$TARGETDIR -j$JOBS install
|
||||
popd &>/dev/null
|
||||
popd &>/dev/null
|
||||
|
||||
@@ -112,7 +139,7 @@ pushd ../../cctools &>/dev/null
|
||||
git clean -fdx . &>/dev/null || true
|
||||
./autogen.sh
|
||||
./configure --target=$TRIPLE --prefix=$TARGETDIR
|
||||
-make -j4 && make install
|
||||
+make -j$JOBS && make install
|
||||
popd &>/dev/null
|
||||
|
||||
echo ""
|
||||
--- cctools/configure
|
||||
+++ cctools/configure
|
||||
@@ -17722,9 +17722,6 @@
|
||||
|
||||
fi
|
||||
|
||||
-ac_config_files="$ac_config_files ld/Makefile"
|
||||
-
|
||||
-
|
||||
ac_config_files="$ac_config_files ld64/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files ld64/src/Makefile"
|
||||
@@ -18881,7 +18878,6 @@
|
||||
"misc/Makefile") CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;;
|
||||
"otool/Makefile") CONFIG_FILES="$CONFIG_FILES otool/Makefile" ;;
|
||||
"libobjc2/Makefile") CONFIG_FILES="$CONFIG_FILES libobjc2/Makefile" ;;
|
||||
- "ld/Makefile") CONFIG_FILES="$CONFIG_FILES ld/Makefile" ;;
|
||||
"ld64/Makefile") CONFIG_FILES="$CONFIG_FILES ld64/Makefile" ;;
|
||||
"ld64/src/Makefile") CONFIG_FILES="$CONFIG_FILES ld64/src/Makefile" ;;
|
||||
"ld64/src/3rd/Makefile") CONFIG_FILES="$CONFIG_FILES ld64/src/3rd/Makefile" ;;
|
||||
--- cctools/misc/Makefile.in
|
||||
+++ cctools/misc/Makefile.in
|
||||
@@ -95,7 +95,8 @@
|
||||
seg_hack$(EXEEXT) install_name_tool$(EXEEXT) indr$(EXEEXT) \
|
||||
strip$(EXEEXT) nmedit$(EXEEXT) segedit$(EXEEXT) \
|
||||
pagestuff$(EXEEXT) ranlib$(EXEEXT) codesign_allocate$(EXEEXT) \
|
||||
- bitcode_strip$(EXEEXT)
|
||||
+ bitcode_strip$(EXEEXT) ctf_insert$(EXEEXT) \
|
||||
+ check_dylib$(EXEEXT) cmpdylib$(EXEEXT) inout$(EXEEXT)
|
||||
subdir = misc
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
@@ -123,21 +124,41 @@
|
||||
bitcode_strip_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(bitcode_strip_CFLAGS) \
|
||||
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
+am_check_dylib_OBJECTS = check_dylib.$(OBJEXT)
|
||||
+check_dylib_OBJECTS = $(am_check_dylib_OBJECTS)
|
||||
+check_dylib_LDADD = $(LDADD)
|
||||
+check_dylib_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_checksyms_OBJECTS = checksyms.$(OBJEXT)
|
||||
checksyms_OBJECTS = $(am_checksyms_OBJECTS)
|
||||
checksyms_LDADD = $(LDADD)
|
||||
checksyms_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
+am_cmpdylib_OBJECTS = cmpdylib.$(OBJEXT)
|
||||
+cmpdylib_OBJECTS = $(am_cmpdylib_OBJECTS)
|
||||
+cmpdylib_LDADD = $(LDADD)
|
||||
+cmpdylib_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_codesign_allocate_OBJECTS = codesign_allocate.$(OBJEXT)
|
||||
codesign_allocate_OBJECTS = $(am_codesign_allocate_OBJECTS)
|
||||
codesign_allocate_LDADD = $(LDADD)
|
||||
codesign_allocate_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
+am_ctf_insert_OBJECTS = ctf_insert.$(OBJEXT)
|
||||
+ctf_insert_OBJECTS = $(am_ctf_insert_OBJECTS)
|
||||
+ctf_insert_LDADD = $(LDADD)
|
||||
+ctf_insert_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_indr_OBJECTS = indr.$(OBJEXT)
|
||||
indr_OBJECTS = $(am_indr_OBJECTS)
|
||||
indr_LDADD = $(LDADD)
|
||||
indr_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
+am_inout_OBJECTS = inout.$(OBJEXT)
|
||||
+inout_OBJECTS = $(am_inout_OBJECTS)
|
||||
+inout_LDADD = $(LDADD)
|
||||
+inout_DEPENDENCIES = $(top_builddir)/libstuff/libstuff.la \
|
||||
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_install_name_tool_OBJECTS = install_name_tool.$(OBJEXT)
|
||||
install_name_tool_OBJECTS = $(am_install_name_tool_OBJECTS)
|
||||
install_name_tool_LDADD = $(LDADD)
|
||||
@@ -247,19 +268,21 @@
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
-SOURCES = $(bitcode_strip_SOURCES) $(checksyms_SOURCES) \
|
||||
- $(codesign_allocate_SOURCES) $(indr_SOURCES) \
|
||||
- $(install_name_tool_SOURCES) $(libtool_SOURCES) \
|
||||
- $(lipo_SOURCES) $(nm_SOURCES) $(nmedit_SOURCES) \
|
||||
- $(pagestuff_SOURCES) $(ranlib_SOURCES) \
|
||||
+SOURCES = $(bitcode_strip_SOURCES) $(check_dylib_SOURCES) \
|
||||
+ $(checksyms_SOURCES) $(cmpdylib_SOURCES) \
|
||||
+ $(codesign_allocate_SOURCES) $(ctf_insert_SOURCES) \
|
||||
+ $(indr_SOURCES) $(inout_SOURCES) $(install_name_tool_SOURCES) \
|
||||
+ $(libtool_SOURCES) $(lipo_SOURCES) $(nm_SOURCES) \
|
||||
+ $(nmedit_SOURCES) $(pagestuff_SOURCES) $(ranlib_SOURCES) \
|
||||
$(redo_prebinding_SOURCES) $(seg_addr_table_SOURCES) \
|
||||
$(seg_hack_SOURCES) $(segedit_SOURCES) $(size_SOURCES) \
|
||||
$(strings_SOURCES) $(strip_SOURCES)
|
||||
-DIST_SOURCES = $(bitcode_strip_SOURCES) $(checksyms_SOURCES) \
|
||||
- $(codesign_allocate_SOURCES) $(indr_SOURCES) \
|
||||
- $(install_name_tool_SOURCES) $(libtool_SOURCES) \
|
||||
- $(lipo_SOURCES) $(nm_SOURCES) $(nmedit_SOURCES) \
|
||||
- $(pagestuff_SOURCES) $(ranlib_SOURCES) \
|
||||
+DIST_SOURCES = $(bitcode_strip_SOURCES) $(check_dylib_SOURCES) \
|
||||
+ $(checksyms_SOURCES) $(cmpdylib_SOURCES) \
|
||||
+ $(codesign_allocate_SOURCES) $(ctf_insert_SOURCES) \
|
||||
+ $(indr_SOURCES) $(inout_SOURCES) $(install_name_tool_SOURCES) \
|
||||
+ $(libtool_SOURCES) $(lipo_SOURCES) $(nm_SOURCES) \
|
||||
+ $(nmedit_SOURCES) $(pagestuff_SOURCES) $(ranlib_SOURCES) \
|
||||
$(redo_prebinding_SOURCES) $(seg_addr_table_SOURCES) \
|
||||
$(seg_hack_SOURCES) $(segedit_SOURCES) $(size_SOURCES) \
|
||||
$(strings_SOURCES) $(strip_SOURCES)
|
||||
@@ -460,6 +483,10 @@
|
||||
codesign_allocate_SOURCES = codesign_allocate.c
|
||||
bitcode_strip_SOURCES = bitcode_strip.c
|
||||
bitcode_strip_CFLAGS = -DALLOW_ARCHIVES $(AM_CFLAGS)
|
||||
+ctf_insert_SOURCES = ctf_insert.c
|
||||
+check_dylib_SOURCES = check_dylib.c
|
||||
+cmpdylib_SOURCES = cmpdylib.c
|
||||
+inout_SOURCES = inout.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -547,18 +574,34 @@
|
||||
@rm -f bitcode_strip$(EXEEXT)
|
||||
$(AM_V_CCLD)$(bitcode_strip_LINK) $(bitcode_strip_OBJECTS) $(bitcode_strip_LDADD) $(LIBS)
|
||||
|
||||
+check_dylib$(EXEEXT): $(check_dylib_OBJECTS) $(check_dylib_DEPENDENCIES) $(EXTRA_check_dylib_DEPENDENCIES)
|
||||
+ @rm -f check_dylib$(EXEEXT)
|
||||
+ $(AM_V_CCLD)$(LINK) $(check_dylib_OBJECTS) $(check_dylib_LDADD) $(LIBS)
|
||||
+
|
||||
checksyms$(EXEEXT): $(checksyms_OBJECTS) $(checksyms_DEPENDENCIES) $(EXTRA_checksyms_DEPENDENCIES)
|
||||
@rm -f checksyms$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(checksyms_OBJECTS) $(checksyms_LDADD) $(LIBS)
|
||||
|
||||
+cmpdylib$(EXEEXT): $(cmpdylib_OBJECTS) $(cmpdylib_DEPENDENCIES) $(EXTRA_cmpdylib_DEPENDENCIES)
|
||||
+ @rm -f cmpdylib$(EXEEXT)
|
||||
+ $(AM_V_CCLD)$(LINK) $(cmpdylib_OBJECTS) $(cmpdylib_LDADD) $(LIBS)
|
||||
+
|
||||
codesign_allocate$(EXEEXT): $(codesign_allocate_OBJECTS) $(codesign_allocate_DEPENDENCIES) $(EXTRA_codesign_allocate_DEPENDENCIES)
|
||||
@rm -f codesign_allocate$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(codesign_allocate_OBJECTS) $(codesign_allocate_LDADD) $(LIBS)
|
||||
|
||||
+ctf_insert$(EXEEXT): $(ctf_insert_OBJECTS) $(ctf_insert_DEPENDENCIES) $(EXTRA_ctf_insert_DEPENDENCIES)
|
||||
+ @rm -f ctf_insert$(EXEEXT)
|
||||
+ $(AM_V_CCLD)$(LINK) $(ctf_insert_OBJECTS) $(ctf_insert_LDADD) $(LIBS)
|
||||
+
|
||||
indr$(EXEEXT): $(indr_OBJECTS) $(indr_DEPENDENCIES) $(EXTRA_indr_DEPENDENCIES)
|
||||
@rm -f indr$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(indr_OBJECTS) $(indr_LDADD) $(LIBS)
|
||||
|
||||
+inout$(EXEEXT): $(inout_OBJECTS) $(inout_DEPENDENCIES) $(EXTRA_inout_DEPENDENCIES)
|
||||
+ @rm -f inout$(EXEEXT)
|
||||
+ $(AM_V_CCLD)$(LINK) $(inout_OBJECTS) $(inout_LDADD) $(LIBS)
|
||||
+
|
||||
install_name_tool$(EXEEXT): $(install_name_tool_OBJECTS) $(install_name_tool_DEPENDENCIES) $(EXTRA_install_name_tool_DEPENDENCIES)
|
||||
@rm -f install_name_tool$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(install_name_tool_OBJECTS) $(install_name_tool_LDADD) $(LIBS)
|
Binary file not shown.
BIN
tarballs/cctools-895-ld64-274.2_8e9c3f2.tar.xz
Normal file
BIN
tarballs/cctools-895-ld64-274.2_8e9c3f2.tar.xz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user