summaryrefslogtreecommitdiff
path: root/data/ld64
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-10-12 16:21:47 -1000
committerSam Bingner <sam@bingner.com>2018-10-12 16:21:47 -1000
commit295030d5719c3af352cfc5394b8ce13e3a1e0fb9 (patch)
tree608f1f9cf9a8ea9ae8e26f1f07b50d14426a675a /data/ld64
parent4a80cac9cb4be1d154f5346423667310219bd27a (diff)
Add and update a number of packages
Diffstat (limited to 'data/ld64')
-rw-r--r--data/ld64/_metadata/description1
l---------data/ld64/_metadata/libtapi.dep1
l---------data/ld64/_metadata/license1
-rw-r--r--data/ld64/_metadata/maintainer1
-rw-r--r--data/ld64/_metadata/priority1
-rw-r--r--data/ld64/_metadata/role1
-rw-r--r--data/ld64/_metadata/section1
-rw-r--r--data/ld64/_metadata/tags1
-rw-r--r--data/ld64/_metadata/version1
l---------data/ld64/_metadata/xar.dep1
-rw-r--r--data/ld64/arch.diff13
-rw-r--r--data/ld64/got32.diff12
-rw-r--r--data/ld64/ld64-274.2.tar.gzbin0 -> 671652 bytes
-rw-r--r--data/ld64/make.sh4
-rw-r--r--data/ld64/makefile.diff59
-rw-r--r--data/ld64/searchpaths.diff39
-rw-r--r--data/ld64/thinlto.diff34
-rw-r--r--data/ld64/typos.diff12
-rw-r--r--data/ld64/version.diff28
19 files changed, 211 insertions, 0 deletions
diff --git a/data/ld64/_metadata/description b/data/ld64/_metadata/description
new file mode 100644
index 000000000..97fce8bc3
--- /dev/null
+++ b/data/ld64/_metadata/description
@@ -0,0 +1 @@
+64bit iOS linker
diff --git a/data/ld64/_metadata/libtapi.dep b/data/ld64/_metadata/libtapi.dep
new file mode 120000
index 000000000..5c5ceb1d6
--- /dev/null
+++ b/data/ld64/_metadata/libtapi.dep
@@ -0,0 +1 @@
+../../libtapi \ No newline at end of file
diff --git a/data/ld64/_metadata/license b/data/ld64/_metadata/license
new file mode 120000
index 000000000..9e5e5e89d
--- /dev/null
+++ b/data/ld64/_metadata/license
@@ -0,0 +1 @@
+../../../licenses/apsl-2.0 \ No newline at end of file
diff --git a/data/ld64/_metadata/maintainer b/data/ld64/_metadata/maintainer
new file mode 100644
index 000000000..55521c7d0
--- /dev/null
+++ b/data/ld64/_metadata/maintainer
@@ -0,0 +1 @@
+Sam Bingner <maintainer@sbdhi.com>
diff --git a/data/ld64/_metadata/priority b/data/ld64/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/ld64/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/ld64/_metadata/role b/data/ld64/_metadata/role
new file mode 100644
index 000000000..8d0320866
--- /dev/null
+++ b/data/ld64/_metadata/role
@@ -0,0 +1 @@
+developer
diff --git a/data/ld64/_metadata/section b/data/ld64/_metadata/section
new file mode 100644
index 000000000..e0eb96881
--- /dev/null
+++ b/data/ld64/_metadata/section
@@ -0,0 +1 @@
+Development
diff --git a/data/ld64/_metadata/tags b/data/ld64/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/ld64/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/ld64/_metadata/version b/data/ld64/_metadata/version
new file mode 100644
index 000000000..a159459e8
--- /dev/null
+++ b/data/ld64/_metadata/version
@@ -0,0 +1 @@
+274.2
diff --git a/data/ld64/_metadata/xar.dep b/data/ld64/_metadata/xar.dep
new file mode 120000
index 000000000..7d8571a6b
--- /dev/null
+++ b/data/ld64/_metadata/xar.dep
@@ -0,0 +1 @@
+../../xar \ No newline at end of file
diff --git a/data/ld64/arch.diff b/data/ld64/arch.diff
new file mode 100644
index 000000000..e4cd7ab0f
--- /dev/null
+++ b/data/ld64/arch.diff
@@ -0,0 +1,13 @@
+Only in ld64-274.2+iPhone: InputFiles.o
+diff -ur ld64-274.2/src/ld/InputFiles.cpp ld64-274.2+iPhone/src/ld/InputFiles.cpp
+--- ld64-274.2/src/ld/InputFiles.cpp 2016-07-01 15:46:14.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/InputFiles.cpp 2018-09-05 11:18:34.000000000 -1000
+@@ -881,6 +881,8 @@
+ opts.setArchitecture(CPU_TYPE_X86_64, CPU_SUBTYPE_X86_64_ALL, Options::kPlatformOSX);
+ #elif __arm__
+ opts.setArchitecture(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V6, Options::kPlatformOSX);
++#elif __arm64__
++ opts.setArchitecture(CPU_TYPE_ARM64, CPU_SUBTYPE_ARM_V8, Options::kPlatformOSX);
+ #else
+ #error unknown default architecture
+ #endif
diff --git a/data/ld64/got32.diff b/data/ld64/got32.diff
new file mode 100644
index 000000000..48f570329
--- /dev/null
+++ b/data/ld64/got32.diff
@@ -0,0 +1,12 @@
+diff -ur ld64-274.2/src/ld/ld.hpp ld64-274.2+iPhone/src/ld/ld.hpp
+--- ld64-274.2/src/ld/ld.hpp 2017-01-20 12:24:09.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/ld.hpp 2018-09-05 12:14:17.000000000 -1000
+@@ -433,7 +433,7 @@
+ kindStoreARM64GOTLeaPage21, kindStoreARM64GOTLeaPageOff12,
+ kindStoreARM64TLVPLoadPage21, kindStoreARM64TLVPLoadPageOff12,
+ kindStoreARM64TLVPLoadNowLeaPage21, kindStoreARM64TLVPLoadNowLeaPageOff12,
+- kindStoreARM64PointerToGOT, kindStoreARM64PCRelToGOT,
++ kindStoreARM64PointerToGOT, kindStoreARM64PCRelToGOT, kindStoreARM64PointerToGOT32,
+ #endif
+ // dtrace probes
+ kindDtraceExtra,
diff --git a/data/ld64/ld64-274.2.tar.gz b/data/ld64/ld64-274.2.tar.gz
new file mode 100644
index 000000000..039b85144
--- /dev/null
+++ b/data/ld64/ld64-274.2.tar.gz
Binary files differ
diff --git a/data/ld64/make.sh b/data/ld64/make.sh
new file mode 100644
index 000000000..831f083f4
--- /dev/null
+++ b/data/ld64/make.sh
@@ -0,0 +1,4 @@
+pkg:setup
+pkg:make
+pkg:install
+pkg: ln -s ld64 /usr/bin/ld
diff --git a/data/ld64/makefile.diff b/data/ld64/makefile.diff
new file mode 100644
index 000000000..72994fe68
--- /dev/null
+++ b/data/ld64/makefile.diff
@@ -0,0 +1,59 @@
+diff -uNr ld64-274.2/Makefile ld64-274.2+iPhone/Makefile
+--- ld64-274.2/Makefile 1969-12-31 14:00:00.000000000 -1000
++++ ld64-274.2+iPhone/Makefile 2018-09-05 22:32:02.000000000 -1000
+@@ -0,0 +1,55 @@
++SUBDIRS = src
++OTHERS = $(patsubst src/other/%.cpp,%,$(filter-out src/other/PruneTrie.cpp src/other/objcimageinfo.cpp, $(wildcard src/other/*.cpp)))
++BINS = ld64 $(OTHERS)
++LIBS = libprunetrie.a
++DEPS = include/configure.h include/compile_stubs.h
++LD_SOURCES = $(wildcard src/ld/*.cpp src/ld/*.c src/ld/parsers/*.cpp src/ld/passes/*.cpp src/ld/passes/stubs/*.cpp)
++LD_OBJS = $(patsubst %.c,%.c.o,$(patsubst %.cpp,%.cpp.o,$(LD_SOURCES)))
++DERIVED_FILE_DIR = include
++
++.PHONY: all
++
++all: $(LIBS) $(BINS)
++
++include:
++ mkdir include
++
++include/configure.h: include
++ DERIVED_FILE_DIR="$(DERIVED_FILE_DIR)" IPHONEOS_DEPLOYMENT_TARGET="11.0" src/create_configure
++
++include/compile_stubs.h: include
++ echo "static const char *compile_stubs = " > $(DERIVED_FILE_DIR)/compile_stubs.h
++ cat compile_stubs | sed s/\"/\\\\\"/g | sed s/^/\"/ | sed s/\$$/\\\\n\"/ >> $(DERIVED_FILE_DIR)/compile_stubs.h
++ echo ";" >> $(DERIVED_FILE_DIR)/compile_stubs.h
++
++$(LD_OBJS): $(DEPS)
++
++%.cpp.o: %.cpp
++ $(CXX) -std=c++11 -o $@ -c $< -Isrc/abstraction -I$(DERIVED_FILE_DIR) -Isrc/ld/parsers -Isrc/ld -DVERSION=\"274.2\"
++
++%.c.o: %.c
++ $(CC) -o $@ -c $< -Isrc/abstraction -I$(DERIVED_FILE_DIR) -Isrc/ld/parsers -Isrc/ld -DVERSION=\"274.2\"
++
++ld64: $(LD_OBJS)
++ $(CXX) -o $@ $^ -ltapi -lLTO -lxar
++
++libld64.a: $(filter-out src/ld/ld.cpp.o, $(LD_OBJS))
++ ar -r libld64.a $^
++
++$(OTHERS): % : src/other/%.cpp libld64.a
++ $(CXX) -o $@ $^ -ltapi -lLTO -lxar -Isrc/abstraction -I$(DERIVED_FILE_DIR) -Isrc/ld/parsers -Isrc/ld
++
++libprunetrie.a: src/other/PruneTrie.cpp.o
++ ar -r libprunetrie.a $^
++
++install:
++ mkdir -p $(DESTDIR)/usr/{bin,lib,include/mach-o}
++ cp $(BINS) $(DESTDIR)/usr/bin/
++ cp $(LIBS) $(DESTDIR)/usr/lib/
++ cp src/other/prune_trie.h $(DESTDIR)/usr/include/mach-o/
++
++clean:
++ rm -f $(BINS) $(LIBS) $(LD_OBJS) libld64.a src/other/PruneTrie.cpp.o
++
++distclean: clean
++ rm -rf $(DERIVED_FILE_DIR)
diff --git a/data/ld64/searchpaths.diff b/data/ld64/searchpaths.diff
new file mode 100644
index 000000000..c3d9c541b
--- /dev/null
+++ b/data/ld64/searchpaths.diff
@@ -0,0 +1,39 @@
+diff -ur ld64-274.2/src/ld/Options.cpp ld64-274.2+iPhone/src/ld/Options.cpp
+--- ld64-274.2/src/ld/Options.cpp 2017-01-20 12:24:09.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/Options.cpp 2018-09-17 13:33:42.000000000 -1000
+@@ -3992,9 +3992,16 @@
+ libraryPaths.push_back("/usr/lib");
+ libraryPaths.push_back("/usr/local/lib");
+
++ // <rdar://problem/5433882> remove /Network/Library/Frameworks from default search path
++ if ( fSDKPaths.size() == 0 ) {
++ libraryPaths.push_back("/usr/share/SDKs/iPhoneOS.sdk/usr/lib");
++ libraryPaths.push_back("/usr/share/SDKs/iPhoneOS.sdk/usr/local/lib");
++ frameworkPaths.push_back("/usr/share/SDKs/iPhoneOS.sdk/Library/Frameworks/");
++ frameworkPaths.push_back("/usr/share/SDKs/iPhoneOS.sdk/System/Library/Frameworks/");
++ }
++
+ frameworkPaths.push_back("/Library/Frameworks/");
+ frameworkPaths.push_back("/System/Library/Frameworks/");
+- // <rdar://problem/5433882> remove /Network/Library/Frameworks from default search path
+ }
+
+ // <rdar://problem/5829579> Support for configure based hacks
+@@ -4051,7 +4058,7 @@
+ else
+ fLibrarySearchPaths.push_back(libDir);
+ }
+- else if ( !addStandardLibraryDirectories || (strcmp(libDir, "/usr/local/lib") != 0) ) {
++ else if ( !addStandardLibraryDirectories || ( (strcmp(libDir, "/usr/local/lib") != 0) && (strncmp(libDir, "/usr/share/SDKs/iPhoneOS.sdk/", 29) != 0) ) ) {
+ warning("directory not found for option '-L%s'", libDir);
+ }
+ }
+@@ -4105,7 +4112,7 @@
+ else
+ fFrameworkSearchPaths.push_back(frameworkDir);
+ }
+- else if ( !addStandardLibraryDirectories || (strcmp(frameworkDir, "/Library/Frameworks/") != 0) ) {
++ else if ( !addStandardLibraryDirectories || ( (strcmp(frameworkDir, "/Library/Frameworks/") != 0) && (strncmp(frameworkDir, "/usr/share/SDKs/iPhoneOS.sdk/", 29) != 0) ) ) {
+ warning("directory not found for option '-F%s'", frameworkDir);
+ }
+ }
diff --git a/data/ld64/thinlto.diff b/data/ld64/thinlto.diff
new file mode 100644
index 000000000..0466146c2
--- /dev/null
+++ b/data/ld64/thinlto.diff
@@ -0,0 +1,34 @@
+diff -ur ld64-274.2/src/ld/parsers/lto_file.cpp ld64-274.2+iPhone/src/ld/parsers/lto_file.cpp
+--- ld64-274.2/src/ld/parsers/lto_file.cpp 2016-10-21 10:04:17.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/parsers/lto_file.cpp 2018-09-05 11:48:40.000000000 -1000
+@@ -291,12 +291,14 @@
+ std::vector<const ld::Atom*>& newAtoms,
+ std::vector<const char*>& additionalUndefines);
+
++#if LTO_API_VERSION >= 18
+ static thinlto_code_gen_t init_thinlto_codegen(const std::vector<File*>& files,
+ const std::vector<const ld::Atom*>& allAtoms,
+ ld::Internal& state,
+ const OptimizeOptions& options,
+ CStringToAtom& deadllvmAtoms,
+ CStringToAtom& llvmAtoms);
++#endif
+
+ static std::vector<File*> _s_files;
+ static bool _s_llvmOptionsProcessed;
+@@ -1028,6 +1030,7 @@
+ return true;
+ }
+
++#if LTO_API_VERSION >= 18
+ // Create the ThinLTO codegenerator
+ thinlto_code_gen_t Parser::init_thinlto_codegen(const std::vector<File*>& files,
+ const std::vector<const ld::Atom*>& allAtoms,
+@@ -1178,6 +1181,7 @@
+
+ return thingenerator;
+ }
++#endif
+
+ // Full LTO processing
+ bool Parser::optimizeThinLTO(const std::vector<File*>& files,
diff --git a/data/ld64/typos.diff b/data/ld64/typos.diff
new file mode 100644
index 000000000..697745f1c
--- /dev/null
+++ b/data/ld64/typos.diff
@@ -0,0 +1,12 @@
+diff -ur ld64-274.2/src/ld/parsers/textstub_dylib_file.cpp ld64-274.2+iPhone/src/ld/parsers/textstub_dylib_file.cpp
+--- ld64-274.2/src/ld/parsers/textstub_dylib_file.cpp 2016-07-26 11:15:31.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/parsers/textstub_dylib_file.cpp 2018-09-05 12:09:16.000000000 -1000
+@@ -29,7 +29,7 @@
+ #include <vector>
+
+ #include "Architectures.hpp"
+-#include "bitcode.hpp"
++#include "Bitcode.hpp"
+ #include "MachOFileAbstraction.hpp"
+ #include "MachOTrie.hpp"
+ #include "generic_dylib_file.hpp"
diff --git a/data/ld64/version.diff b/data/ld64/version.diff
new file mode 100644
index 000000000..017fe256c
--- /dev/null
+++ b/data/ld64/version.diff
@@ -0,0 +1,28 @@
+diff -ur ld64-274.2/src/ld/Options.cpp ld64-274.2+iPhone/src/ld/Options.cpp
+--- ld64-274.2/src/ld/Options.cpp 2017-01-20 12:24:09.000000000 -1000
++++ ld64-274.2+iPhone/src/ld/Options.cpp 2018-09-05 18:36:45.000000000 -1000
+@@ -45,6 +45,8 @@
+ #include "MachOFileAbstraction.hpp"
+ #include "Snapshot.h"
+
++const char *ldVersionString = "@(#)PROGRAM:ld PROJECT:ld64-" VERSION "\n";
++
+
+ // from FunctionNameDemangle.h
+ extern "C" size_t fnd_get_demangled_name(const char *mangledName, char *outputBuffer, size_t length);
+@@ -3946,7 +3948,6 @@
+ addStandardLibraryDirectories = false;
+ else if ( strcmp(argv[i], "-v") == 0 ) {
+ fVerbose = true;
+- extern const char ldVersionString[];
+ fprintf(stderr, "%s", ldVersionString);
+ fprintf(stderr, "configured to support archs: %s\n", ALL_SUPPORTED_ARCHS);
+ // if only -v specified, exit cleanly
+@@ -5864,7 +5865,6 @@
+ uint8_t version = depLinkerVersion;
+ if ( write(fDependencyFileDescriptor, &version, 1) == -1 )
+ throwf("write() to -dependency_info failed, errno=%d", errno);
+- extern const char ldVersionString[];
+ if ( write(fDependencyFileDescriptor, ldVersionString, strlen(ldVersionString)+1) == -1 )
+ throwf("write() to -dependency_info failed, errno=%d", errno);
+ }