Skip to content

Instantly share code, notes, and snippets.

@matthiasr
Created February 24, 2011 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthiasr/841929 to your computer and use it in GitHub Desktop.
Save matthiasr/841929 to your computer and use it in GitHub Desktop.
patch for bringing pcc 1.0.0-BETA up to date on DragonFly BSD
diff --git a/configure b/configure
index 9395d88..406f602 100755
--- a/configure
+++ b/configure
@@ -1944,6 +1944,7 @@ case "$target_os" in
tls=yes
case "$target_cpu" in
i?86) targmach=i386 ;;
+ x86_64) targmach=amd64 ;;
esac
;;
diff --git a/configure.ac b/configure.ac
index 6394ab9..6ea40c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@ case "$target_os" in
tls=yes
case "$target_cpu" in
i?86) targmach=i386 ;;
+ x86_64) targmach=amd64 ;;
esac
;;
diff --git a/os/dragonfly/ccconfig.h b/os/dragonfly/ccconfig.h
index 865166a..4cc0aaa 100644
--- a/os/dragonfly/ccconfig.h
+++ b/os/dragonfly/ccconfig.h
@@ -34,15 +34,19 @@
/* common cpp predefines */
#define CPPADD { "-D__DragonFly__", "-D__ELF__", NULL, }
#define DYNLINKER { "-dynamic-linker", "/usr/libexec/ld-elf.so.2", NULL }
-#define CRT0FILE "/usr/lib/gcc34/crt1.o"
-#define CRT0FILE_PROFILE "/usr/lib/gcc34/gcrt1.o"
-#define STARTFILES { "/usr/lib/gcc34/crti.o", "/usr/lib/gcc34/crtbegin.o", NULL }
-#define LIBCLIBS { "-lc", "-L/usr/lib/gcc34", "-lgcc", NULL }
-#define ENDFILES { "/usr/lib/gcc34/crtend.o", "/usr/lib/gcc34/crtn.o", NULL }
+#define CRT0FILE "/usr/lib/crt1.o"
+#define CRT0FILE_PROFILE "/usr/lib/gcrt1.o"
+#define STARTFILES { "/usr/lib/crti.o", "/usr/lib/gcc41/crtbegin.o", NULL }
+#define LIBCLIBS { "-lc", "-L/usr/lib/gcc41", "-lgcc", NULL }
+#define ENDFILES { "/usr/lib/gcc41/crtend.o", "/usr/lib/crtn.o", NULL }
#define STARTLABEL "_start"
#if defined(mach_i386)
#define CPPMDADD { "-D__i386__", NULL, }
+#elif defined(mach_amd64)
+#define CPPMDADD \
+ { "-D__x86_64__", "-D__x86_64", "-D__amd64__", "-D__amd64", \
+ "-D__LP64__=1", "-D_LP64=1", NULL, }
#else
#error defines for arch missing
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment