Skip to content

Instantly share code, notes, and snippets.

@henry0312
Created August 28, 2011 06:16
Show Gist options
  • Save henry0312/1176307 to your computer and use it in GitHub Desktop.
Save henry0312/1176307 to your computer and use it in GitHub Desktop.
Fix for building with Xcode 4
diff --git a/src/ChangeLog b/src/ChangeLog
index b158eaf..d3d61a8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * unexmacosx.c (copy_data_segment): Also copy __got section.
+ (Bug#8223)
+
2011-03-07 Chong Yidong <[email protected]>
* Version 23.3 released.
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 2b0addb..89d010a 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -181,7 +181,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
end of the header for adding load commands. Needed for dumping.
0x690 is the total size of 30 segment load commands (at 56
each); under Cocoa 31 commands are required. */
-#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA
+#define LD_SWITCH_SYSTEM_TEMACS -fno-pie -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA
#define C_SWITCH_SYSTEM_TEMACS -Dtemacs
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index df4c0da..d6f170c 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -822,6 +822,7 @@ copy_data_segment (struct load_command *lc)
}
else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
|| strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
+ || strncmp (sectp->sectname, "__got", 16) == 0
|| strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0
|| strncmp (sectp->sectname, "__dyld", 16) == 0
|| strncmp (sectp->sectname, "__const", 16) == 0
@henry0312
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment