This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: DragonFly support, attempt #3


After two weeks and two previous submissions, I am still trying to get DragonFlyBSD patches submitted to both trunk and branch 2.21.

The previous emails on this topic can be disregarded. I have attached the following updated files which are based on the current repository heads:

For trunk: binutils-current.C.patch
For  2.21: binutils_221.C.patch
For  both: 2011_03_23_changelog.txt
           2011_03_23_changelog.ld.txt
           2011_03_23_changelog.gas.txt
           2011_03_23_changelog.bfd.txt


I have already assigned copyright to FSF (FSF ID: 658681)
It would be really great if somebody with a commit bit could apply these patches. I've gone through a lot of effort to create these and go through the copyright assignment process.


Regards,
John

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 01fa09a..5e67d6b 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -551,13 +551,17 @@ case "${targ}" in
     targ_defvec=i386bsd_vec
     targ_underscore=yes
     ;;
+  i[3-7]86-*-dragonfly*)
+    targ_defvec=bfd_elf32_i386_vec
+    targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
+    ;;
   i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \
   i[3-7]86-*-freebsd[12])
     targ_defvec=i386freebsd_vec
     targ_selvecs=i386bsd_vec
     targ_underscore=yes
     ;;
-  i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
+  i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf32_i386_freebsd_vec
     targ_selvecs="bfd_elf32_i386_vec i386pei_vec i386coff_vec"
     targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
@@ -617,6 +621,11 @@ case "${targ}" in
     targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec i386coff_vec"
     want64=true
     ;;
+  x86_64-*-dragonfly*)
+    targ_defvec=bfd_elf64_x86_64_vec
+    targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec"
+    want64=true
+    ;;
   x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_x86_64_freebsd_vec
     targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
diff --git a/bfd/configure b/bfd/configure
index 63dd10d..d587593 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -15060,8 +15060,6 @@ do
     bfd_elf32_hppa_nbsd_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_dragonfly_vec)
-				tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_sol2_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vxworks_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff --git a/bfd/configure.in b/bfd/configure.in
index 5908a57..eaba44c 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -703,8 +703,6 @@ do
     bfd_elf32_hppa_nbsd_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_dragonfly_vec)
-				tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_sol2_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vxworks_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff --git a/configure b/configure
index aff8033..eed1952 100755
--- a/configure
+++ b/configure
@@ -2896,7 +2896,8 @@ case "${ENABLE_GOLD}" in
     case "${target}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
-      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
+      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+      | *-*-solaris2* | *-*-nto*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
@@ -3091,7 +3092,7 @@ if test x$enable_libgomp = x ; then
     case "${target}" in
     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
 	;;
-    *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
+    *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
 	;;
     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
 	;;
@@ -3127,6 +3128,9 @@ case "${target}" in
     noconfigdirs="$noconfigdirs sim target-rda"
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  *-*-dragonfly*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
   *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
diff --git a/configure.ac b/configure.ac
index c947b94..5017a46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -355,7 +355,8 @@ case "${ENABLE_GOLD}" in
     case "${target}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
-      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
+      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+      | *-*-solaris2* | *-*-nto*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
@@ -537,7 +538,7 @@ if test x$enable_libgomp = x ; then
     case "${target}" in
     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
 	;;
-    *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
+    *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
 	;;
     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
 	;;
@@ -573,6 +574,9 @@ case "${target}" in
     noconfigdirs="$noconfigdirs sim target-rda"
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  *-*-dragonfly*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 5cc8219..e7f9c9a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -303,6 +303,7 @@ const char extra_symbol_chars[] = "*%-(["
 	 && !defined (TE_LINUX)				\
  	 && !defined (TE_NETWARE)			\
 	 && !defined (TE_FreeBSD)			\
+	 && !defined (TE_DragonFly)			\
 	 && !defined (TE_NetBSD)))
 /* This array holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  The option
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 8ce9003..a01ff6c 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -205,8 +205,8 @@ case ${generic_target} in
   i386-*-freebsdaout*)			fmt=aout em=386bsd ;;
   i386-*-freebsd[12].*)			fmt=aout em=386bsd ;;
   i386-*-freebsd[12])			fmt=aout em=386bsd ;;
-  i386-*-freebsd* | i386-*-kfreebsd*-gnu | i386-*-dragonfly*)
-					fmt=elf em=freebsd ;;
+  i386-*-freebsd* \
+  | i386-*-kfreebsd*-gnu)		fmt=elf em=freebsd ;;
   i386-*-sysv*)				fmt=coff ;;
   i386-*-sco3.2v5*coff)			fmt=coff ;;
   i386-*-isc*)				fmt=coff ;;
@@ -421,6 +421,7 @@ case ${generic_target} in
   z8k-*-coff | z8k-*-sim)		fmt=coff ;;
 
   *-*-aout | *-*-scout)			fmt=aout ;;
+  *-*-dragonfly*)			fmt=elf em=dragonfly ;;
   *-*-freebsd* | *-*-kfreebsd*-gnu)	fmt=elf em=freebsd ;;
   *-*-bsd*)				fmt=aout em=sun3 ;;
   *-*-generic)				fmt=generic ;;
diff --git a/ld/configure.host b/ld/configure.host
index f2dffe6..f47b961 100644
--- a/ld/configure.host
+++ b/ld/configure.host
@@ -18,7 +18,12 @@ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libg
 
 case "${host}" in
 
-*-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
+*-*-dragonfly*)
+  HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.2\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.2` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
+  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
+  ;;
+
+*-*-freebsd* | *-*-kfreebsd*-gnu)
   HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
   ;;
@@ -200,7 +205,10 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
   ;;
 
-*-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
+*-*-dragonfly*)
+  ;;
+
+*-*-freebsd* | *-*-kfreebsd*-gnu)
   ;;
 
 *-*-linux* | *-*-gnu*)
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 88ebee3..f574e24 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -249,7 +249,11 @@ x86_64-*-elf*)		targ_emul=elf_x86_64
 i[3-7]86-*-kaos*)	targ_emul=elf_i386 ;;
 i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
 			targ_emul=i386bsd ;;
-i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
+i[3-7]86-*-dragonfly*)	targ_emul=elf_i386
+			targ_extra_emuls="i386bsd" ;;
+x86_64-*-dragonfly*)	targ_emul=elf_x86_64
+			targ_extra_emuls="elf_i386 elf_l1om" ;;
+i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
 		        targ_emul=elf_i386_fbsd
 			targ_extra_emuls="elf_i386 i386bsd" ;;
 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
@@ -683,7 +687,11 @@ esac
 NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
 case "${target}" in
 
-*-*-freebsd* | *-*-dragonfly*)
+*-*-dragonfly*)
+  NATIVE_LIB_DIRS='/usr/lib /usr/pkg/lib /usr/local/lib'
+  ;;
+
+*-*-freebsd*)
   NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
   ;;
 
@@ -723,9 +731,6 @@ i[03-9x]86-*-cygwin*)
 *-*-linux*)
   ;;
 
-*-*-freebsd* | *-*-dragonfly*)
-  ;;
-
 *-*-netbsd*)
   ;;
 
diff --git a/ld/ldlex.l b/ld/ldlex.l
index c77357b..a1c9548 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -60,7 +60,9 @@ const char *lex_string = NULL;
 #undef YY_INPUT
 #define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size)
 
+#ifndef YY_NO_UNPUT
 #define YY_NO_UNPUT
+#endif
 
 #define MAX_INCLUDE_DEPTH 10
 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 2de94a4..fbf77ad 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -551,13 +551,17 @@ case "${targ}" in
     targ_defvec=i386bsd_vec
     targ_underscore=yes
     ;;
+  i[3-7]86-*-dragonfly*)
+    targ_defvec=bfd_elf32_i386_vec
+    targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
+    ;;
   i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \
   i[3-7]86-*-freebsd[12])
     targ_defvec=i386freebsd_vec
     targ_selvecs=i386bsd_vec
     targ_underscore=yes
     ;;
-  i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
+  i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf32_i386_freebsd_vec
     targ_selvecs="bfd_elf32_i386_vec i386pei_vec i386coff_vec"
     targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
@@ -617,6 +621,11 @@ case "${targ}" in
     targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec i386coff_vec"
     want64=true
     ;;
+  x86_64-*-dragonfly*)
+    targ_defvec=bfd_elf64_x86_64_vec
+    targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec"
+    want64=true
+    ;;
   x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_x86_64_freebsd_vec
     targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
diff --git a/bfd/configure b/bfd/configure
index c8d48fd..301def9 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -15068,8 +15068,6 @@ do
     bfd_elf32_hppa_nbsd_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_dragonfly_vec)
-				tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_sol2_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vxworks_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff --git a/bfd/configure.in b/bfd/configure.in
index d758a51..4076c6e 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -703,8 +703,6 @@ do
     bfd_elf32_hppa_nbsd_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_dragonfly_vec)
-				tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_sol2_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vxworks_vec)	tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff --git a/configure b/configure
index 7212797..81c167a 100755
--- a/configure
+++ b/configure
@@ -2869,7 +2869,8 @@ case "${ENABLE_GOLD}" in
     case "${target}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
-      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
+      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+      | *-*-solaris2* | *-*-nto*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
@@ -3035,7 +3036,7 @@ if test x$enable_libgomp = x ; then
     case "${target}" in
     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
 	;;
-    *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
+    *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
 	;;
     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
 	;;
@@ -3071,6 +3072,9 @@ case "${target}" in
     noconfigdirs="$noconfigdirs sim target-rda"
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  *-*-dragonfly*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
   *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
diff --git a/configure.ac b/configure.ac
index 19cf53f..22c0c73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,7 +351,8 @@ case "${ENABLE_GOLD}" in
     case "${target}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
-      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
+      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+      | *-*-solaris2* | *-*-nto*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
@@ -507,7 +508,7 @@ if test x$enable_libgomp = x ; then
     case "${target}" in
     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
 	;;
-    *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
+    *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
 	;;
     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
 	;;
@@ -543,6 +544,9 @@ case "${target}" in
     noconfigdirs="$noconfigdirs sim target-rda"
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  *-*-dragonfly*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 9c33cf9..c667d44 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -303,6 +303,7 @@ const char extra_symbol_chars[] = "*%-(["
 	 && !defined (TE_LINUX)				\
  	 && !defined (TE_NETWARE)			\
 	 && !defined (TE_FreeBSD)			\
+	 && !defined (TE_DragonFly)			\
 	 && !defined (TE_NetBSD)))
 /* This array holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  The option
diff --git a/gas/configure.tgt b/gas/configure.tgt
index c05a64a..aa12fbb 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -205,8 +205,8 @@ case ${generic_target} in
   i386-*-freebsdaout*)			fmt=aout em=386bsd ;;
   i386-*-freebsd[12].*)			fmt=aout em=386bsd ;;
   i386-*-freebsd[12])			fmt=aout em=386bsd ;;
-  i386-*-freebsd* | i386-*-kfreebsd*-gnu | i386-*-dragonfly*)
-					fmt=elf em=freebsd ;;
+  i386-*-freebsd* \
+  | i386-*-kfreebsd*-gnu)		fmt=elf em=freebsd ;;
   i386-*-sysv*)				fmt=coff ;;
   i386-*-sco3.2v5*coff)			fmt=coff ;;
   i386-*-isc*)				fmt=coff ;;
@@ -419,6 +419,7 @@ case ${generic_target} in
   z8k-*-coff | z8k-*-sim)		fmt=coff ;;
 
   *-*-aout | *-*-scout)			fmt=aout ;;
+  *-*-dragonfly*)			fmt=elf em=dragonfly ;;
   *-*-freebsd* | *-*-kfreebsd*-gnu)	fmt=elf em=freebsd ;;
   *-*-bsd*)				fmt=aout em=sun3 ;;
   *-*-generic)				fmt=generic ;;
diff --git a/ld/configure.host b/ld/configure.host
index f2dffe6..f47b961 100644
--- a/ld/configure.host
+++ b/ld/configure.host
@@ -18,7 +18,12 @@ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libg
 
 case "${host}" in
 
-*-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
+*-*-dragonfly*)
+  HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.2\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.2` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
+  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
+  ;;
+
+*-*-freebsd* | *-*-kfreebsd*-gnu)
   HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
   ;;
@@ -200,7 +205,10 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
   ;;
 
-*-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
+*-*-dragonfly*)
+  ;;
+
+*-*-freebsd* | *-*-kfreebsd*-gnu)
   ;;
 
 *-*-linux* | *-*-gnu*)
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 4e90739..90d7461 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -248,7 +248,11 @@ x86_64-*-elf*)		targ_emul=elf_x86_64
 i[3-7]86-*-kaos*)	targ_emul=elf_i386 ;;
 i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
 			targ_emul=i386bsd ;;
-i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
+i[3-7]86-*-dragonfly*)	targ_emul=elf_i386
+			targ_extra_emuls="i386bsd" ;;
+x86_64-*-dragonfly*)	targ_emul=elf_x86_64
+			targ_extra_emuls="elf_i386 elf_l1om" ;;
+i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
 		        targ_emul=elf_i386_fbsd
 			targ_extra_emuls="elf_i386 i386bsd" ;;
 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
@@ -666,7 +670,11 @@ esac
 NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
 case "${target}" in
 
-*-*-freebsd* | *-*-dragonfly*)
+*-*-dragonfly*)
+  NATIVE_LIB_DIRS='/usr/lib /usr/pkg/lib /usr/local/lib'
+  ;;
+
+*-*-freebsd*)
   NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
   ;;
 
@@ -706,9 +714,6 @@ i[03-9x]86-*-cygwin*)
 *-*-linux*)
   ;;
 
-*-*-freebsd* | *-*-dragonfly*)
-  ;;
-
 *-*-netbsd*)
   ;;
 
diff --git a/ld/ldlex.l b/ld/ldlex.l
index bb09bd9..3213cf7 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -60,7 +60,9 @@ const char *lex_string = NULL;
 #undef YY_INPUT
 #define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size)
 
+#ifndef YY_NO_UNPUT
 #define YY_NO_UNPUT
+#endif
 
 #define MAX_INCLUDE_DEPTH 10
 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
2011-03-23  John Marino  <binutils@marino.st>

	* config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*.
	* configure.in: Delete unused bfd_elf32_i386_dragonfly_vec.
	* configure: Regenerate.
2011-03-23  John Marino  <binutils@marino.st>

	* configure.tgt: Fix support for *-*-dragonfly*.
	* config/tc-i386.c: define SVR4_COMMENT_CHARS for dragonfly.
	* config/te-dragonfly.h: New file.

2011-03-23  John Marino  <binutils@marino.st>

	* configure.host: Update *-*-dragonfly* host entry.
	* configure.tgt: Update *-*-dragonfly* target entry.
	* ldlex.l: prevent redefinition of YY_NO_UNPUT.
2011-03-23  John Marino  <binutils@marino.st>

	* configure.ac: Add support for *-*-dragonfly*
	* configure: Regenerate.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]