aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/odcctools/files/fix-280.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/odcctools/files/fix-280.patch')
-rw-r--r--recipes-devtools/odcctools/files/fix-280.patch194
1 files changed, 194 insertions, 0 deletions
diff --git a/recipes-devtools/odcctools/files/fix-280.patch b/recipes-devtools/odcctools/files/fix-280.patch
new file mode 100644
index 0000000..3ac8fbf
--- /dev/null
+++ b/recipes-devtools/odcctools/files/fix-280.patch
@@ -0,0 +1,194 @@
+Index: odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 14:29:30.863784082 +0000
++++ odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 14:29:30.931784083 +0000
+@@ -28,6 +28,7 @@
+ #include <stdint.h>
+ #include <math.h>
+ #include <unistd.h>
++#include <stdio.h>
+ #include <sys/param.h>
+ #include <mach-o/ppc/reloc.h>
+ #include <mach-o/stab.h>
+@@ -123,6 +124,21 @@
+ Kinds fKind;
+ };
+
++class BaseAtom : public ObjectFile::Atom
++{
++public:
++ BaseAtom() : fStabsStartIndex(0), fStabsCount(0) {}
++
++ virtual void setSize(uint64_t size) = 0;
++ virtual void addReference(ObjectFile::Reference* ref) = 0;
++ virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
++ virtual void alignAtLeast(uint8_t align) = 0;
++
++ uint32_t fStabsStartIndex;
++ uint32_t fStabsCount;
++};
++
++
+
+ template <typename A>
+ Reference<A>::Reference(Kinds kind, const AtomAndOffset& at, const AtomAndOffset& toTarget)
+@@ -213,19 +229,6 @@
+ DataSegment DataSegment::fgSingleton;
+
+
+-class BaseAtom : public ObjectFile::Atom
+-{
+-public:
+- BaseAtom() : fStabsStartIndex(0), fStabsCount(0) {}
+-
+- virtual void setSize(uint64_t size) = 0;
+- virtual void addReference(ObjectFile::Reference* ref) = 0;
+- virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
+- virtual void alignAtLeast(uint8_t align) = 0;
+-
+- uint32_t fStabsStartIndex;
+- uint32_t fStabsCount;
+-};
+
+
+ //
+Index: odcctools-9.2-ld/ld64/src/MachOWriterExecutable.hpp
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/src/MachOWriterExecutable.hpp 2013-08-15 14:29:30.863784082 +0000
++++ odcctools-9.2-ld/ld64/src/MachOWriterExecutable.hpp 2013-08-15 14:29:30.935784083 +0000
+@@ -5029,6 +5029,30 @@
+ }
+
+ template <>
++StubHelperAtom<x86_64>::StubHelperAtom(Writer<x86_64>& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer)
++ : WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
++{
++ writer.fAllSynthesizedStubHelpers.push_back(this);
++
++ fReferences.push_back(new WriterReference<x86_64>(3, x86_64::kPCRel32, &lazyPointer));
++ fReferences.push_back(new WriterReference<x86_64>(8, x86_64::kPCRel32, writer.fDyldHelper));
++ if ( writer.fDyldHelper == NULL )
++ throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)";
++}
++
++// specialize lazy pointer for x86_64 to initially pointer to stub helper
++template <>
++LazyPointerAtom<x86_64>::LazyPointerAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
++ : WriterAtom<x86_64>(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target)
++{
++ writer.fAllSynthesizedLazyPointers.push_back(this);
++
++ StubHelperAtom<x86_64>* helper = new StubHelperAtom<x86_64>(writer, target, *this);
++ fReferences.push_back(new WriterReference<x86_64>(0, x86_64::kPointer, helper));
++}
++
++
++template <>
+ StubAtom<x86_64>::StubAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
+ : WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
+ {
+@@ -5165,20 +5189,6 @@
+ return "__jump_table";
+ }
+
+-
+-
+-template <>
+-StubHelperAtom<x86_64>::StubHelperAtom(Writer<x86_64>& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer)
+- : WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
+-{
+- writer.fAllSynthesizedStubHelpers.push_back(this);
+-
+- fReferences.push_back(new WriterReference<x86_64>(3, x86_64::kPCRel32, &lazyPointer));
+- fReferences.push_back(new WriterReference<x86_64>(8, x86_64::kPCRel32, writer.fDyldHelper));
+- if ( writer.fDyldHelper == NULL )
+- throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)";
+-}
+-
+ template <>
+ uint64_t StubHelperAtom<x86_64>::getSize() const
+ {
+@@ -5211,17 +5221,6 @@
+ }
+
+
+-// specialize lazy pointer for x86_64 to initially pointer to stub helper
+-template <>
+-LazyPointerAtom<x86_64>::LazyPointerAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
+- : WriterAtom<x86_64>(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target)
+-{
+- writer.fAllSynthesizedLazyPointers.push_back(this);
+-
+- StubHelperAtom<x86_64>* helper = new StubHelperAtom<x86_64>(writer, target, *this);
+- fReferences.push_back(new WriterReference<x86_64>(0, x86_64::kPointer, helper));
+-}
+-
+
+ template <typename A>
+ LazyPointerAtom<A>::LazyPointerAtom(Writer<A>& writer, ObjectFile::Atom& target)
+Index: odcctools-9.2-ld/ld64/src/Options.cpp
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/src/Options.cpp 2013-08-15 14:29:30.863784082 +0000
++++ odcctools-9.2-ld/ld64/src/Options.cpp 2013-08-15 14:29:30.935784083 +0000
+@@ -29,6 +29,10 @@
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <vector>
++#include <stdio.h>
++#include <unistd.h>
++#include <string.h>
++#include <limits.h>
+ #include "config.h"
+
+ #include "strlcpy.h"
+Index: odcctools-9.2-ld/ld64/src/SectCreate.cpp
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/src/SectCreate.cpp 2013-08-15 14:29:30.863784082 +0000
++++ odcctools-9.2-ld/ld64/src/SectCreate.cpp 2013-08-15 14:29:30.935784083 +0000
+@@ -23,7 +23,10 @@
+ */
+
+ #include <vector>
+-
++#include <stdio.h>
++#include <unistd.h>
++#include <time.h>
++#include <string.h>
+ #include "ObjectFile.h"
+
+ namespace SectCreate {
+Index: odcctools-9.2-ld/ld64/Makefile.in
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/Makefile.in 2013-08-15 14:29:30.863784082 +0000
++++ odcctools-9.2-ld/ld64/Makefile.in 2013-08-15 14:29:30.935784083 +0000
+@@ -37,7 +37,7 @@
+ MYWARNINGS =
+ MYDEFS = -DDEBUG
+ MYLDFLAGS = -L$(top_builddir)/libstuff
+-MYLIBS = -lstuff
++MYLIBS = -lstuff -luuid
+
+ MYCOMPILEFLAGS = $(WARNINGS) $(MYWARNINGS) $(DEFS) $(MYDEFS) \
+ $(CPPFLAGS) $(MYINCLUDES) $(CFLAGS) $(MDYNAMICNOPIC)
+Index: odcctools-9.2-ld/ld64/src/ld.cpp
+===================================================================
+--- odcctools-9.2-ld.orig/ld64/src/ld.cpp 2013-08-15 11:27:10.000000000 +0000
++++ odcctools-9.2-ld/ld64/src/ld.cpp 2013-08-15 14:38:22.975773627 +0000
+@@ -639,12 +639,12 @@
+
+ void Linker::getVMInfo(vm_statistics_data_t& info)
+ {
+- mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t);
+- kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO,
+- (host_info_t)&info, &count);
+- if (error != KERN_SUCCESS) {
++ //mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t);
++ //kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO,
++ // (host_info_t)&info, &count);
++ //if (error != KERN_SUCCESS) {
+ bzero(&info, sizeof(vm_statistics_data_t));
+- }
++ //}
+ }
+
+ void Linker::printStatistics()