2016-08-09 21:12:36 +02:00
|
|
|
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
|
2016-08-13 18:36:34 +02:00
|
|
|
index e398f30..c860ae2 100644
|
2016-08-09 21:12:36 +02:00
|
|
|
--- cctools/misc/nm.c
|
|
|
|
+++ cctools/misc/nm.c
|
2016-08-13 18:36:34 +02:00
|
|
|
@@ -527,7 +527,13 @@ void *cookie)
|
2016-08-09 21:12:36 +02:00
|
|
|
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));
|
2016-08-13 18:36:34 +02:00
|
|
|
+#ifdef LTO_SUPPORT
|
2016-08-09 21:12:36 +02:00
|
|
|
+ llvm_bundle_pointer = NULL;
|
|
|
|
+ llvm_bundle_size = 0;
|
2016-08-13 18:36:34 +02:00
|
|
|
+#endif /* LTO_SUPPORT */
|
2016-08-09 21:12:36 +02:00
|
|
|
+ /* cctools-port end */
|
|
|
|
|
|
|
|
cmd_flags = (struct cmd_flags *)cookie;
|
|
|
|
|