--- gcc/configure.orig 2020-03-04 19:32:12.000000000 +1100 +++ gcc/configure 2020-09-11 13:03:20.868857000 +1000 @@ -13010,7 +13010,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bsdsunix* | netbsd* | 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` @@ -13360,6 +13360,20 @@ lt_cv_deplibs_check_method=pass_all ;; +bsdsunix*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + lt_cv_deplibs_check_method='file_magic (BSDSUniX)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in @@ -16692,7 +16706,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 @@ -17590,6 +17604,17 @@ shlibpath_var=LD_LIBRARY_PATH ;; +bsdsunix*) + objformat=elf + version_type=bsdsunix-$objformat + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no need_lib_prefix=no + 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. @@ -19487,11 +19512,11 @@ ld_shlibs_CXX=no ;; - freebsd-elf*) + bsdsunix-elf*|freebsd-elf*) archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + bsdsunix* | freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -20456,7 +20481,7 @@ ;; esac ;; - freebsd* | dragonfly*) + bsdsunix* | freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -21250,6 +21275,17 @@ shlibpath_var=LD_LIBRARY_PATH ;; +bsdsunix*) + objformat=elf + version_type=bsdsunix-$objformat + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no need_lib_prefix=no + 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. @@ -28864,7 +28900,7 @@ esac case "$target:$tm_file" in - powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) + powerpc64-*-bsdsunix* | powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) case "$target" in *le-*-linux*) emul_name="-melf64lppc" @@ -28875,6 +28911,9 @@ *-*-freebsd*) emul_name="-melf64ppc_fbsd" ;; + *-*-bsdsunix*) + emul_name="-melf64ppc_bsdsux" + ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for omitting dot symbols" >&5 $as_echo_n "checking linker support for omitting dot symbols... " >&6; } @@ -29233,7 +29272,7 @@ # realistically usable GNU/Hurd configurations. # All supported versions of musl provide it as well gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd* | *-*-netbsd*) + *-*-bsdsunix* | *-*-darwin* | *-*-freebsd* | *-*-netbsd*) ac_fn_cxx_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" if test "x$ac_cv_func___stack_chk_fail" = x""yes; then : gcc_cv_libc_provides_ssp=yes @@ -29402,7 +29441,7 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; - *-*-dragonfly* | *-*-freebsd*) + *-*-dragonfly* | *-*-freebsd* | *-*-bsdsunix*) if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then gcc_cv_target_dl_iterate_phdr=yes else