From 3e42a88d488b4684ddff701dfd1557c6c0d8279a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 25 Apr 2010 05:52:59 +0000 Subject: [PATCH] Temporary hacks to make 64-bit compile work. --- GNUmakefile.in | 3 ++- Mach/Inject.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index c380435..7136ff9 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -182,7 +182,8 @@ inject += Mach/Inject.lo Mach/Inject.lo: Trampoline.t.hpp Baton.hpp %.t.hpp: %.t.cpp - $(libtool) --mode=compile $(cxx) -c -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o $*.t.lo $< $(cflags) && { file=($$($(otool) -l .libs/$*.t.o | $(sed) -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT$$/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} .libs/$*.t.o | $(sed) -e 's/^[^ ]*//' | tr $$'\n' ' ' | $(sed) -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | $(sed) -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(otool) -vVt .libs/$*.t.o && echo "*/"; } >$@ && rm -f $*.t.lo .libs/$*.t.o + # LC_SEGMENT_64 + $(libtool) --mode=compile $(cxx) -c -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o $*.t.lo $< $(cflags) && { file=($$($(otool) -l .libs/$*.t.o | $(sed) -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} .libs/$*.t.o | $(sed) -e 's/^[^ ]*//' | tr $$'\n' ' ' | $(sed) -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | $(sed) -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(otool) -vVt .libs/$*.t.o && echo "*/"; } >$@ && rm -f $*.t.lo .libs/$*.t.o endif endif diff --git a/Mach/Inject.cpp b/Mach/Inject.cpp index bd7fba8..8de0eaa 100644 --- a/Mach/Inject.cpp +++ b/Mach/Inject.cpp @@ -82,8 +82,10 @@ void InjectLibrary(pid_t pid) { struct nlist nl[3]; memset(nl, 0, sizeof(nl)); +#if defined(__i386__) nl[0].n_un.n_name = (char *) "__pthread_set_self"; nl[1].n_un.n_name = (char *) "___pthread_set_self"; +#endif nlist("/usr/lib/libSystem.B.dylib", nl); nlset(set_self_internal, nl, 0); nlset(set_self_external, nl, 1); -- 2.45.2