--- gas/configure.orig 2016-08-03 10:33:37.000000000 +0200 +++ gas/configure 2016-10-06 23:44:42.679462000 +0200 @@ -5545,7 +5545,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + netbsd* | bsdsunix* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5895,13 +5895,13 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +bsdsunix* | freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_deplibs_check_method='file_magic (BSDSUniX|FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; @@ -6739,7 +6739,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +x86_64-*kbsdsunix*-gnu|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -6751,6 +6751,9 @@ case `/usr/bin/file conftest.o` in *32-bit*) case $host in + x86_64-*kbsdsunix*-gnu) + LD="${LD-ld} -m elf_i386_bsdsux" + ;; x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; @@ -6780,6 +6783,9 @@ ;; *64-bit*) case $host in + x86_64-*kbsdsunix*-gnu) + LD="${LD-ld} -m elf_x86_64_bsdsux" + ;; x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; @@ -9228,7 +9234,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + bsdsunix* | freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10126,6 +10132,25 @@ shlibpath_var=LD_LIBRARY_PATH ;; +bsdsunix*) + objformat=elf + version_type=bsdsunix-$objformat + case $version_type in + bsdsunix-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + bsdsunix-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -12305,10 +12330,10 @@ esac # Decide which ABI to target by default. case ${target} in - mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* | mips64*-kfreebsd*-gnu) + mips64*-linux* | mips-sgi-irix6* | mips64*-bsdsunix* | mips64*-kbsdsunix*-gnu | mips64*-freebsd* | mips64*-kfreebsd*-gnu) mips_default_abi=N32_ABI ;; - mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu) + mips*-linux* | mips*-bsdsunix* | mips*-kbsdsunix*-gnu | mips*-freebsd* | mips*-kfreebsd*-gnu) mips_default_abi=O32_ABI ;; mips64*-openbsd*)