Index: Makefile =================================================================== --- Makefile (revision 520226) +++ Makefile (working copy) @@ -23,6 +23,8 @@ CONFLICTS= libbfd-[0-9]* +EXTRA_PATCHES= ${PATCHDIR}/libcft-failures.diff:-p1 + #TEST_DEPENDS+= runtest:misc/dejagnu TEST_TARGET= check Index: files/libcft-failures.diff =================================================================== --- files/libcft-failures.diff (nonexistent) +++ files/libcft-failures.diff (working copy) @@ -0,0 +1,1728 @@ +Have a squash of the commits that should land on master and then the +2.33 branch once I finish testing them here, to fix the port. I'm +afraid it's a patch -p1: it's a bit tricky to generate a -p0 if you're +starting from a git repo. I hope this'll do. + +This is a squash of the following patches, some of which are already +upstream, some of which are not yet, with a few simple conflict +resolutions and reautoconfs for 2.33 and with changelog changes removed: + +libctf: support platforms with separate libintl +libctf: add some missing #includes. +libctf, elfcpp, gold: do not assume that contains bswap_* +libctf: work with compilers not supporting GNU C attributes +libiberty, include, libctf: Use bsearch_r to avoid nonportable __thread +libctf: mark swap.h inline functions as static +libctf: make it compile for old glibc + +diff -x .git -x autom4te.cache -durN binutils.orig/elfcpp/elfcpp_swap.h binutils/elfcpp/elfcpp_swap.h +--- binutils.orig/elfcpp/elfcpp_swap.h 2019-12-16 13:05:01.030039000 +0000 ++++ binutils/elfcpp/elfcpp_swap.h 2019-12-16 14:31:06.256848000 +0000 +@@ -46,15 +46,19 @@ + + #ifdef HAVE_BYTESWAP_H + #include +-#else ++#endif // defined(HAVE_BYTESWAP_H) ++ + // Provide our own versions of the byteswap functions. +-inline uint16_t ++#if !HAVE_DECL_BSWAP_16 ++static inline uint16_t + bswap_16(uint16_t v) + { + return ((v >> 8) & 0xff) | ((v & 0xff) << 8); + } ++#endif // !HAVE_DECL_BSWAP16 + +-inline uint32_t ++#if !HAVE_DECL_BSWAP_32 ++static inline uint32_t + bswap_32(uint32_t v) + { + return ( ((v & 0xff000000) >> 24) +@@ -62,8 +66,10 @@ + | ((v & 0x0000ff00) << 8) + | ((v & 0x000000ff) << 24)); + } ++#endif // !HAVE_DECL_BSWAP32 + +-inline uint64_t ++#if !HAVE_DECL_BSWAP_64 ++static inline uint64_t + bswap_64(uint64_t v) + { + return ( ((v & 0xff00000000000000ULL) >> 56) +@@ -75,7 +81,7 @@ + | ((v & 0x000000000000ff00ULL) << 40) + | ((v & 0x00000000000000ffULL) << 56)); + } +-#endif // !defined(HAVE_BYTESWAP_H) ++#endif // !HAVE_DECL_BSWAP64 + + // gcc 4.3 and later provides __builtin_bswap32 and __builtin_bswap64. + +diff -x .git -x autom4te.cache -durN binutils.orig/gold/config.in binutils/gold/config.in +--- binutils.orig/gold/config.in 2019-12-16 13:05:01.030429000 +0000 ++++ binutils/gold/config.in 2019-12-16 14:31:06.257181000 +0000 +@@ -52,6 +52,18 @@ + don't. */ + #undef HAVE_DECL_BASENAME + ++/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_16 ++ ++/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_32 ++ ++/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_64 ++ + /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ + #undef HAVE_DECL_FFS + +diff -x .git -x autom4te.cache -durN binutils.orig/gold/configure binutils/gold/configure +--- binutils.orig/gold/configure 2019-12-16 13:05:01.035440000 +0000 ++++ binutils/gold/configure 2019-12-16 14:31:06.259631000 +0000 +@@ -2167,6 +2167,52 @@ + + } # ac_fn_cxx_check_header_mongrel + ++# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES ++# ----------------------------------------------- ++# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR ++# accordingly. ++ac_fn_cxx_check_decl () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ as_decl_name=`echo $2|sed 's/ *(.*//'` ++ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 ++$as_echo_n "checking whether $as_decl_name is declared... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++#ifndef $as_decl_name ++#ifdef __cplusplus ++ (void) $as_decl_use; ++#else ++ (void) $as_decl_name; ++#endif ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_cxx_check_decl ++ + # ac_fn_cxx_try_link LINENO + # ------------------------- + # Try to link conftest.$ac_ext, and return whether this succeeded. +@@ -2279,52 +2325,6 @@ + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + + } # ac_fn_cxx_check_func +- +-# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES +-# ----------------------------------------------- +-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +-# accordingly. +-ac_fn_cxx_check_decl () +-{ +- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- as_decl_name=`echo $2|sed 's/ *(.*//'` +- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +-$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +-if eval \${$3+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-$4 +-int +-main () +-{ +-#ifndef $as_decl_name +-#ifdef __cplusplus +- (void) $as_decl_use; +-#else +- (void) $as_decl_name; +-#endif +-#endif +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- eval "$3=yes" +-else +- eval "$3=no" +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-eval ac_res=\$$3 +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +- +-} # ac_fn_cxx_check_decl + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. +@@ -9778,6 +9778,41 @@ + fi + + done ++ ++ ++ac_fn_cxx_check_decl "$LINENO" "bswap_16" "ac_cv_have_decl_bswap_16" "#include ++" ++if test "x$ac_cv_have_decl_bswap_16" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_16 $ac_have_decl ++_ACEOF ++ac_fn_cxx_check_decl "$LINENO" "bswap_32" "ac_cv_have_decl_bswap_32" "#include ++" ++if test "x$ac_cv_have_decl_bswap_32" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_32 $ac_have_decl ++_ACEOF ++ac_fn_cxx_check_decl "$LINENO" "bswap_64" "ac_cv_have_decl_bswap_64" "#include ++" ++if test "x$ac_cv_have_decl_bswap_64" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_64 $ac_have_decl ++_ACEOF + + + for ac_header in windows.h +diff -x .git -x autom4te.cache -durN binutils.orig/gold/configure.ac binutils/gold/configure.ac +--- binutils.orig/gold/configure.ac 2019-12-16 13:05:01.035714000 +0000 ++++ binutils/gold/configure.ac 2019-12-16 14:31:06.259853000 +0000 +@@ -602,6 +602,9 @@ + AC_CHECK_HEADERS(ext/hash_map ext/hash_set) + AC_CHECK_HEADERS(byteswap.h) + ++dnl Check for bswap_{16,32,64} ++AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include ]]) ++ + dnl When plugins enabled dynamic loader interface is required. Check headers + dnl which may provide this interface. Add the necessary library to link. + AC_CHECK_HEADERS(windows.h) +diff -x .git -x autom4te.cache -durN binutils.orig/include/libiberty.h binutils/include/libiberty.h +--- binutils.orig/include/libiberty.h 2019-12-16 13:05:01.036032000 +0000 ++++ binutils/include/libiberty.h 2019-12-16 14:31:06.260125000 +0000 +@@ -637,6 +637,13 @@ + + extern int pwait (int, int *, int); + ++/* Like bsearch, but takes and passes on an argument like qsort_r. */ ++ ++extern void *bsearch_r (register const void *, const void *, ++ size_t, register size_t, ++ register int (*)(const void *, const void *, void *), ++ void *); ++ + #if defined(HAVE_DECL_ASPRINTF) && !HAVE_DECL_ASPRINTF + /* Like sprintf but provides a pointer to malloc'd storage, which must + be freed by the caller. */ +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/Makefile.in binutils/libctf/Makefile.in +--- binutils.orig/libctf/Makefile.in 2019-12-16 12:41:49.155077000 +0000 ++++ binutils/libctf/Makefile.in 2019-12-16 14:33:27.386326000 +0000 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.15.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.1 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2017 Free Software Foundation, Inc. ++# Copyright (C) 1994-2018 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -108,6 +108,7 @@ + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ ++ $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/warnings.m4 \ +@@ -156,7 +157,15 @@ + am__v_at_1 = + DEFAULT_INCLUDES = -I.@am__isrc@ + depcomp = $(SHELL) $(top_srcdir)/../depcomp +-am__depfiles_maybe = depfiles ++am__maybe_remake_depfiles = depfiles ++am__depfiles_remade = ./$(DEPDIR)/ctf-archive.Po \ ++ ./$(DEPDIR)/ctf-create.Po ./$(DEPDIR)/ctf-decl.Po \ ++ ./$(DEPDIR)/ctf-dump.Po ./$(DEPDIR)/ctf-error.Po \ ++ ./$(DEPDIR)/ctf-hash.Po ./$(DEPDIR)/ctf-labels.Po \ ++ ./$(DEPDIR)/ctf-lookup.Po ./$(DEPDIR)/ctf-open-bfd.Po \ ++ ./$(DEPDIR)/ctf-open.Po ./$(DEPDIR)/ctf-qsort_r.Po \ ++ ./$(DEPDIR)/ctf-string.Po ./$(DEPDIR)/ctf-subr.Po \ ++ ./$(DEPDIR)/ctf-types.Po ./$(DEPDIR)/ctf-util.Po + am__mv = mv -f + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@@ -229,12 +238,15 @@ + AUTOHEADER = @AUTOHEADER@ + AUTOMAKE = @AUTOMAKE@ + AWK = @AWK@ ++CATALOGS = @CATALOGS@ ++CATOBJEXT = @CATOBJEXT@ + CC = @CC@ + CCDEPMODE = @CCDEPMODE@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ + CYGPATH_W = @CYGPATH_W@ ++DATADIRNAME = @DATADIRNAME@ + DEFS = @DEFS@ + DEPDIR = @DEPDIR@ + ECHO_C = @ECHO_C@ +@@ -242,13 +254,19 @@ + ECHO_T = @ECHO_T@ + EGREP = @EGREP@ + EXEEXT = @EXEEXT@ ++GENCAT = @GENCAT@ ++GMSGFMT = @GMSGFMT@ + GREP = @GREP@ ++INCINTL = @INCINTL@ + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ++INSTOBJEXT = @INSTOBJEXT@ + LDFLAGS = @LDFLAGS@ ++LIBINTL = @LIBINTL@ ++LIBINTL_DEP = @LIBINTL_DEP@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LTLIBOBJS = @LTLIBOBJS@ +@@ -264,13 +282,16 @@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ ++POSUB = @POSUB@ + RANLIB = @RANLIB@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ + STRIP = @STRIP@ ++USE_NLS = @USE_NLS@ + VERSION = @VERSION@ + WARN_PEDANTIC = @WARN_PEDANTIC@ + WERROR = @WERROR@ ++XGETTEXT = @XGETTEXT@ + abs_builddir = @abs_builddir@ + abs_srcdir = @abs_srcdir@ + abs_top_builddir = @abs_top_builddir@ +@@ -360,8 +381,8 @@ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ +- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ +- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ ++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ ++ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + + $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +@@ -402,22 +423,28 @@ + distclean-compile: + -rm -f *.tab.c + +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-archive.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-create.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-decl.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-dump.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-error.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-hash.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-labels.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-lookup.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-open-bfd.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-open.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-qsort_r.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-string.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-subr.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-types.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-util.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-archive.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-create.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-decl.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-dump.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-error.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-hash.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-labels.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-lookup.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-open-bfd.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-open.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-qsort_r.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-string.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-subr.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-types.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctf-util.Po@am__quote@ # am--include-marker + ++$(am__depfiles_remade): ++ @$(MKDIR_P) $(@D) ++ @echo '# dummy' >$@-t && $(am__mv) $@-t $@ ++ ++am--depfiles: $(am__depfiles_remade) ++ + .c.o: + @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@@ -491,7 +518,10 @@ + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +-distdir: $(DISTFILES) ++distdir: $(BUILT_SOURCES) ++ $(MAKE) $(AM_MAKEFLAGS) distdir-am ++ ++distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ +@@ -694,7 +724,21 @@ + + distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +- -rm -rf ./$(DEPDIR) ++ -rm -f ./$(DEPDIR)/ctf-archive.Po ++ -rm -f ./$(DEPDIR)/ctf-create.Po ++ -rm -f ./$(DEPDIR)/ctf-decl.Po ++ -rm -f ./$(DEPDIR)/ctf-dump.Po ++ -rm -f ./$(DEPDIR)/ctf-error.Po ++ -rm -f ./$(DEPDIR)/ctf-hash.Po ++ -rm -f ./$(DEPDIR)/ctf-labels.Po ++ -rm -f ./$(DEPDIR)/ctf-lookup.Po ++ -rm -f ./$(DEPDIR)/ctf-open-bfd.Po ++ -rm -f ./$(DEPDIR)/ctf-open.Po ++ -rm -f ./$(DEPDIR)/ctf-qsort_r.Po ++ -rm -f ./$(DEPDIR)/ctf-string.Po ++ -rm -f ./$(DEPDIR)/ctf-subr.Po ++ -rm -f ./$(DEPDIR)/ctf-types.Po ++ -rm -f ./$(DEPDIR)/ctf-util.Po + -rm -f Makefile + distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags +@@ -742,7 +786,21 @@ + maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache +- -rm -rf ./$(DEPDIR) ++ -rm -f ./$(DEPDIR)/ctf-archive.Po ++ -rm -f ./$(DEPDIR)/ctf-create.Po ++ -rm -f ./$(DEPDIR)/ctf-decl.Po ++ -rm -f ./$(DEPDIR)/ctf-dump.Po ++ -rm -f ./$(DEPDIR)/ctf-error.Po ++ -rm -f ./$(DEPDIR)/ctf-hash.Po ++ -rm -f ./$(DEPDIR)/ctf-labels.Po ++ -rm -f ./$(DEPDIR)/ctf-lookup.Po ++ -rm -f ./$(DEPDIR)/ctf-open-bfd.Po ++ -rm -f ./$(DEPDIR)/ctf-open.Po ++ -rm -f ./$(DEPDIR)/ctf-qsort_r.Po ++ -rm -f ./$(DEPDIR)/ctf-string.Po ++ -rm -f ./$(DEPDIR)/ctf-subr.Po ++ -rm -f ./$(DEPDIR)/ctf-types.Po ++ -rm -f ./$(DEPDIR)/ctf-util.Po + -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-generic + +@@ -762,21 +820,21 @@ + + .MAKE: all install-am install-strip + +-.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ +- clean-cscope clean-generic clean-noinstLIBRARIES cscope \ +- cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ +- dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ +- distcheck distclean distclean-compile distclean-generic \ +- distclean-hdr distclean-tags distcleancheck distdir \ +- distuninstallcheck dvi dvi-am html html-am info info-am \ +- install install-am install-data install-data-am install-dvi \ +- install-dvi-am install-exec install-exec-am install-html \ +- install-html-am install-info install-info-am install-man \ +- install-pdf install-pdf-am install-ps install-ps-am \ +- install-strip installcheck installcheck-am installdirs \ +- maintainer-clean maintainer-clean-generic mostlyclean \ +- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ +- tags tags-am uninstall uninstall-am ++.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ ++ check-am clean clean-cscope clean-generic \ ++ clean-noinstLIBRARIES cscope cscopelist-am ctags ctags-am dist \ ++ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ ++ dist-xz dist-zip distcheck distclean distclean-compile \ ++ distclean-generic distclean-hdr distclean-tags distcleancheck \ ++ distdir distuninstallcheck dvi dvi-am html html-am info \ ++ info-am install install-am install-data install-data-am \ ++ install-dvi install-dvi-am install-exec install-exec-am \ ++ install-html install-html-am install-info install-info-am \ ++ install-man install-pdf install-pdf-am install-ps \ ++ install-ps-am install-strip installcheck installcheck-am \ ++ installdirs maintainer-clean maintainer-clean-generic \ ++ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ++ ps ps-am tags tags-am uninstall uninstall-am + + .PRECIOUS: Makefile + +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/aclocal.m4 binutils/libctf/aclocal.m4 +--- binutils.orig/libctf/aclocal.m4 2019-12-16 12:41:49.155502000 +0000 ++++ binutils/libctf/aclocal.m4 2019-12-16 14:33:22.570144000 +0000 +@@ -1,6 +1,6 @@ +-# generated automatically by aclocal 1.15.1 -*- Autoconf -*- ++# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +-# Copyright (C) 1996-2017 Free Software Foundation, Inc. ++# Copyright (C) 1996-2018 Free Software Foundation, Inc. + + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -20,7 +20,7 @@ + If you have problems, you may need to regenerate the build system entirely. + To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +-# Copyright (C) 2002-2017 Free Software Foundation, Inc. ++# Copyright (C) 2002-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -32,10 +32,10 @@ + # generated from the m4 files accompanying Automake X.Y. + # (This private macro should not be called outside this file.) + AC_DEFUN([AM_AUTOMAKE_VERSION], +-[am__api_version='1.15' ++[am__api_version='1.16' + dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to + dnl require some minimum version. Point them to the right macro. +-m4_if([$1], [1.15.1], [], ++m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl + ]) + +@@ -51,12 +51,12 @@ + # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. + # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +-[AM_AUTOMAKE_VERSION([1.15.1])dnl ++[AM_AUTOMAKE_VERSION([1.16.1])dnl + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl + _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +-# Copyright (C) 2011-2017 Free Software Foundation, Inc. ++# Copyright (C) 2011-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -118,7 +118,7 @@ + + # AM_AUX_DIR_EXPAND -*- Autoconf -*- + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -170,7 +170,7 @@ + + # AM_CONDITIONAL -*- Autoconf -*- + +-# Copyright (C) 1997-2017 Free Software Foundation, Inc. ++# Copyright (C) 1997-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -201,7 +201,7 @@ + Usually this means the macro was only invoked conditionally.]]) + fi])]) + +-# Copyright (C) 1999-2017 Free Software Foundation, Inc. ++# Copyright (C) 1999-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -392,13 +392,12 @@ + + # Generate code to set up dependency tracking. -*- Autoconf -*- + +-# Copyright (C) 1999-2017 Free Software Foundation, Inc. ++# Copyright (C) 1999-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +- + # _AM_OUTPUT_DEPENDENCY_COMMANDS + # ------------------------------ + AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +@@ -406,49 +405,41 @@ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. +- case $CONFIG_FILES in +- *\'*) eval set x "$CONFIG_FILES" ;; +- *) set x $CONFIG_FILES ;; +- esac ++ # TODO: see whether this extra hack can be removed once we start ++ # requiring Autoconf 2.70 or later. ++ AS_CASE([$CONFIG_FILES], ++ [*\'*], [eval set x "$CONFIG_FILES"], ++ [*], [set x $CONFIG_FILES]) + shift +- for mf ++ # Used to flag and report bootstrapping failures. ++ am_rc=0 ++ for am_mf + do + # Strip MF so we end up with the name of the file. +- mf=`echo "$mf" | sed -e 's/:.*$//'` +- # Check whether this is an Automake generated Makefile or not. +- # We used to match only the files named 'Makefile.in', but +- # some people rename them; so instead we look at the file content. +- # Grep'ing the first line is not enough: some people post-process +- # each Makefile.in and add a new line on top of each file to say so. +- # Grep'ing the whole file is not good either: AIX grep has a line ++ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` ++ # Check whether this is an Automake generated Makefile which includes ++ # dependency-tracking related rules and includes. ++ # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. +- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then +- dirpart=`AS_DIRNAME("$mf")` +- else +- continue +- fi +- # Extract the definition of DEPDIR, am__include, and am__quote +- # from the Makefile without running 'make'. +- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` +- test -z "$DEPDIR" && continue +- am__include=`sed -n 's/^am__include = //p' < "$mf"` +- test -z "$am__include" && continue +- am__quote=`sed -n 's/^am__quote = //p' < "$mf"` +- # Find all dependency output files, they are included files with +- # $(DEPDIR) in their names. We invoke sed twice because it is the +- # simplest approach to changing $(DEPDIR) to its actual value in the +- # expansion. +- for file in `sed -n " +- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ +- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do +- # Make sure the directory exists. +- test -f "$dirpart/$file" && continue +- fdir=`AS_DIRNAME(["$file"])` +- AS_MKDIR_P([$dirpart/$fdir]) +- # echo "creating $dirpart/$file" +- echo '# dummy' > "$dirpart/$file" +- done ++ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ ++ || continue ++ am_dirpart=`AS_DIRNAME(["$am_mf"])` ++ am_filepart=`AS_BASENAME(["$am_mf"])` ++ AM_RUN_LOG([cd "$am_dirpart" \ ++ && sed -e '/# am--include-marker/d' "$am_filepart" \ ++ | $MAKE -f - am--depfiles]) || am_rc=$? + done ++ if test $am_rc -ne 0; then ++ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments ++ for automatic dependency tracking. Try re-running configure with the ++ '--disable-dependency-tracking' option to at least be able to build ++ the package (albeit without support for automatic dependency tracking).]) ++ fi ++ AS_UNSET([am_dirpart]) ++ AS_UNSET([am_filepart]) ++ AS_UNSET([am_mf]) ++ AS_UNSET([am_rc]) ++ rm -f conftest-deps.mk + } + ])# _AM_OUTPUT_DEPENDENCY_COMMANDS + +@@ -457,18 +448,17 @@ + # ----------------------------- + # This macro should only be invoked once -- use via AC_REQUIRE. + # +-# This code is only required when automatic dependency tracking +-# is enabled. FIXME. This creates each '.P' file that we will +-# need in order to bootstrap the dependency handling code. ++# This code is only required when automatic dependency tracking is enabled. ++# This creates each '.Po' and '.Plo' makefile fragment that we'll need in ++# order to bootstrap the dependency handling code. + AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], + [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], +- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +-]) ++ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + + # Do all the work for Automake. -*- Autoconf -*- + +-# Copyright (C) 1996-2017 Free Software Foundation, Inc. ++# Copyright (C) 1996-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -555,8 +545,8 @@ + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + # For better backward compatibility. To be removed once Automake 1.9.x + # dies out for good. For more background, see: +-# +-# ++# ++# + AC_SUBST([mkdir_p], ['$(MKDIR_P)']) + # We need awk for the "check" target (and possibly the TAP driver). The + # system "awk" is bad on some platforms. +@@ -623,7 +613,7 @@ + Aborting the configuration process, to ensure you take notice of the issue. + + You can download and install GNU coreutils to get an 'rm' implementation +-that behaves properly: . ++that behaves properly: . + + If you want to complete the configuration process using your problematic + 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +@@ -665,7 +655,7 @@ + done + echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -689,7 +679,7 @@ + # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- + # From Jim Meyering + +-# Copyright (C) 1996-2017 Free Software Foundation, Inc. ++# Copyright (C) 1996-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -724,7 +714,7 @@ + + # Check to see how 'make' treats includes. -*- Autoconf -*- + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -732,49 +722,42 @@ + + # AM_MAKE_INCLUDE() + # ----------------- +-# Check to see how make treats includes. ++# Check whether make has an 'include' directive that can support all ++# the idioms we need for our automatic dependency tracking code. + AC_DEFUN([AM_MAKE_INCLUDE], +-[am_make=${MAKE-make} +-cat > confinc << 'END' ++[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) ++cat > confinc.mk << 'END' + am__doit: +- @echo this is the am__doit target ++ @echo this is the am__doit target >confinc.out + .PHONY: am__doit + END +-# If we don't find an include directive, just comment out the code. +-AC_MSG_CHECKING([for style of include used by $am_make]) + am__include="#" + am__quote= +-_am_result=none +-# First try GNU make style include. +-echo "include confinc" > confmf +-# Ignore all kinds of additional output from 'make'. +-case `$am_make -s -f confmf 2> /dev/null` in #( +-*the\ am__doit\ target*) +- am__include=include +- am__quote= +- _am_result=GNU +- ;; +-esac +-# Now try BSD make style include. +-if test "$am__include" = "#"; then +- echo '.include "confinc"' > confmf +- case `$am_make -s -f confmf 2> /dev/null` in #( +- *the\ am__doit\ target*) +- am__include=.include +- am__quote="\"" +- _am_result=BSD +- ;; +- esac +-fi +-AC_SUBST([am__include]) +-AC_SUBST([am__quote]) +-AC_MSG_RESULT([$_am_result]) +-rm -f confinc confmf +-]) ++# BSD make does it like this. ++echo '.include "confinc.mk" # ignored' > confmf.BSD ++# Other make implementations (GNU, Solaris 10, AIX) do it like this. ++echo 'include confinc.mk # ignored' > confmf.GNU ++_am_result=no ++for s in GNU BSD; do ++ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) ++ AS_CASE([$?:`cat confinc.out 2>/dev/null`], ++ ['0:this is the am__doit target'], ++ [AS_CASE([$s], ++ [BSD], [am__include='.include' am__quote='"'], ++ [am__include='include' am__quote=''])]) ++ if test "$am__include" != "#"; then ++ _am_result="yes ($s style)" ++ break ++ fi ++done ++rm -f confinc.* confmf.* ++AC_MSG_RESULT([${_am_result}]) ++AC_SUBST([am__include])]) ++AC_SUBST([am__quote])]) + + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +-# Copyright (C) 1997-2017 Free Software Foundation, Inc. ++# Copyright (C) 1997-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -813,7 +796,7 @@ + + # Helper functions for option handling. -*- Autoconf -*- + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -842,7 +825,7 @@ + AC_DEFUN([_AM_IF_OPTION], + [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +-# Copyright (C) 1999-2017 Free Software Foundation, Inc. ++# Copyright (C) 1999-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -889,7 +872,7 @@ + # For backward compatibility. + AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -908,7 +891,7 @@ + + # Check to make sure that the build environment is sane. -*- Autoconf -*- + +-# Copyright (C) 1996-2017 Free Software Foundation, Inc. ++# Copyright (C) 1996-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -989,7 +972,7 @@ + rm -f conftest.file + ]) + +-# Copyright (C) 2009-2017 Free Software Foundation, Inc. ++# Copyright (C) 2009-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1049,7 +1032,7 @@ + _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl + ]) + +-# Copyright (C) 2001-2017 Free Software Foundation, Inc. ++# Copyright (C) 2001-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1077,7 +1060,7 @@ + INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +-# Copyright (C) 2006-2017 Free Software Foundation, Inc. ++# Copyright (C) 2006-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1096,7 +1079,7 @@ + + # Check how to create a tarball. -*- Autoconf -*- + +-# Copyright (C) 2004-2017 Free Software Foundation, Inc. ++# Copyright (C) 2004-2018 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1228,6 +1211,7 @@ + ]) # _AM_PROG_TAR + + m4_include([../config/depstand.m4]) ++m4_include([../config/gettext-sister.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/override.m4]) + m4_include([../config/warnings.m4]) +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/config.h.in binutils/libctf/config.h.in +--- binutils.orig/libctf/config.h.in 2019-12-16 13:05:01.036237000 +0000 ++++ binutils/libctf/config.h.in 2019-12-16 14:31:49.184504000 +0000 +@@ -3,11 +3,27 @@ + /* Define if building universal (internal helper macro) */ + #undef AC_APPLE_UNIVERSAL_BUILD + ++/* Define to 1 if translation of program messages to the user's native ++ language is requested. */ ++#undef ENABLE_NLS ++ + /* Whether libbfd was configured for an ELF target. */ + #undef HAVE_BFD_ELF + + /* Define to 1 if you have the header file. */ + #undef HAVE_BYTESWAP_H ++ ++/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_16 ++ ++/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_32 ++ ++/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you ++ don't. */ ++#undef HAVE_DECL_BSWAP_64 + + /* Define to 1 if you have the header file. */ + #undef HAVE_ENDIAN_H +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/configure binutils/libctf/configure +--- binutils.orig/libctf/configure 2019-12-16 13:05:01.037775000 +0000 ++++ binutils/libctf/configure 2019-12-16 14:33:31.352108000 +0000 +@@ -637,6 +637,18 @@ + WARN_PEDANTIC + c_warn + warn ++CATOBJEXT ++GENCAT ++INSTOBJEXT ++DATADIRNAME ++CATALOGS ++POSUB ++GMSGFMT ++XGETTEXT ++INCINTL ++LIBINTL_DEP ++LIBINTL ++USE_NLS + ac_ct_AR + AR + RANLIB +@@ -651,7 +663,6 @@ + AMDEPBACKSLASH + AMDEP_FALSE + AMDEP_TRUE +-am__quote + am__include + DEPDIR + am__untar +@@ -724,7 +735,8 @@ + PACKAGE_TARNAME + PACKAGE_NAME + PATH_SEPARATOR +-SHELL' ++SHELL ++am__quote' + ac_subst_files='' + ac_user_opts=' + enable_option_checking +@@ -1812,6 +1824,52 @@ + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + + } # ac_fn_c_check_func ++ ++# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES ++# --------------------------------------------- ++# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR ++# accordingly. ++ac_fn_c_check_decl () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ as_decl_name=`echo $2|sed 's/ *(.*//'` ++ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 ++$as_echo_n "checking whether $as_decl_name is declared... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++#ifndef $as_decl_name ++#ifdef __cplusplus ++ (void) $as_decl_use; ++#else ++ (void) $as_decl_name; ++#endif ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_decl + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. +@@ -3512,7 +3570,7 @@ + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + +-am__api_version='1.15' ++am__api_version='1.16' + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or +@@ -3938,46 +3996,46 @@ + + ac_config_commands="$ac_config_commands depfiles" + +- +-am_make=${MAKE-make} +-cat > confinc << 'END' ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 ++$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } ++cat > confinc.mk << 'END' + am__doit: +- @echo this is the am__doit target ++ @echo this is the am__doit target >confinc.out + .PHONY: am__doit + END +-# If we don't find an include directive, just comment out the code. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +-$as_echo_n "checking for style of include used by $am_make... " >&6; } + am__include="#" + am__quote= +-_am_result=none +-# First try GNU make style include. +-echo "include confinc" > confmf +-# Ignore all kinds of additional output from 'make'. +-case `$am_make -s -f confmf 2> /dev/null` in #( +-*the\ am__doit\ target*) +- am__include=include +- am__quote= +- _am_result=GNU +- ;; +-esac +-# Now try BSD make style include. +-if test "$am__include" = "#"; then +- echo '.include "confinc"' > confmf +- case `$am_make -s -f confmf 2> /dev/null` in #( +- *the\ am__doit\ target*) +- am__include=.include +- am__quote="\"" +- _am_result=BSD ++# BSD make does it like this. ++echo '.include "confinc.mk" # ignored' > confmf.BSD ++# Other make implementations (GNU, Solaris 10, AIX) do it like this. ++echo 'include confinc.mk # ignored' > confmf.GNU ++_am_result=no ++for s in GNU BSD; do ++ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 ++ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++ case $?:`cat confinc.out 2>/dev/null` in #( ++ '0:this is the am__doit target') : ++ case $s in #( ++ BSD) : ++ am__include='.include' am__quote='"' ;; #( ++ *) : ++ am__include='include' am__quote='' ;; ++esac ;; #( ++ *) : + ;; +- esac +-fi ++esac ++ if test "$am__include" != "#"; then ++ _am_result="yes ($s style)" ++ break ++ fi ++done ++rm -f confinc.* confmf.* ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 ++$as_echo "${_am_result}" >&6; } + +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +-$as_echo "$_am_result" >&6; } +-rm -f confinc confmf +- + # Check whether --enable-dependency-tracking was given. + if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +@@ -4088,8 +4146,8 @@ + + # For better backward compatibility. To be removed once Automake 1.9.x + # dies out for good. For more background, see: +-# +-# ++# ++# + mkdir_p='$(MKDIR_P)' + + # We need awk for the "check" target (and possibly the TAP driver). The +@@ -4268,7 +4326,7 @@ + Aborting the configuration process, to ensure you take notice of the issue. + + You can download and install GNU coreutils to get an 'rm' implementation +-that behaves properly: . ++that behaves properly: . + + If you want to complete the configuration process using your problematic + 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +@@ -5173,7 +5231,77 @@ + ;; + esac + ++# If we haven't got the data from the intl directory, ++# assume NLS is disabled. ++USE_NLS=no ++LIBINTL= ++LIBINTL_DEP= ++INCINTL= ++XGETTEXT= ++GMSGFMT= ++POSUB= + ++if test -f ../intl/config.intl; then ++ . ../intl/config.intl ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 ++$as_echo_n "checking whether NLS is requested... " >&6; } ++if test x"$USE_NLS" != xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++$as_echo "#define ENABLE_NLS 1" >>confdefs.h ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 ++$as_echo_n "checking for catalogs to be installed... " >&6; } ++ # Look for .po and .gmo files in the source directory. ++ CATALOGS= ++ XLINGUAS= ++ for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do ++ # If there aren't any .gmo files the shell will give us the ++ # literal string "../path/to/srcdir/po/*.gmo" which has to be ++ # weeded out. ++ case "$cat" in *\**) ++ continue;; ++ esac ++ # The quadruple backslash is collapsed to a double backslash ++ # by the backticks, then collapsed again by the double quotes, ++ # leaving us with one backslash in the sed expression (right ++ # before the dot that mustn't act as a wildcard). ++ cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` ++ lang=`echo $cat | sed -e "s!\\\\.gmo!!"` ++ # The user is allowed to set LINGUAS to a list of languages to ++ # install catalogs for. If it's empty that means "all of them." ++ if test "x$LINGUAS" = x; then ++ CATALOGS="$CATALOGS $cat" ++ XLINGUAS="$XLINGUAS $lang" ++ else ++ case "$LINGUAS" in *$lang*) ++ CATALOGS="$CATALOGS $cat" ++ XLINGUAS="$XLINGUAS $lang" ++ ;; ++ esac ++ fi ++ done ++ LINGUAS="$XLINGUAS" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 ++$as_echo "$LINGUAS" >&6; } ++ ++ ++ DATADIRNAME=share ++ ++ INSTOBJEXT=.mo ++ ++ GENCAT=gencat ++ ++ CATOBJEXT=.gmo ++ ++fi ++ + # Check whether --enable-largefile was given. + if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +@@ -6360,9 +6488,44 @@ + done + + ++ac_fn_c_check_decl "$LINENO" "bswap_16" "ac_cv_have_decl_bswap_16" "#include ++" ++if test "x$ac_cv_have_decl_bswap_16" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi + ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_16 $ac_have_decl ++_ACEOF ++ac_fn_c_check_decl "$LINENO" "bswap_32" "ac_cv_have_decl_bswap_32" "#include ++" ++if test "x$ac_cv_have_decl_bswap_32" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi + ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_32 $ac_have_decl ++_ACEOF ++ac_fn_c_check_decl "$LINENO" "bswap_64" "ac_cv_have_decl_bswap_64" "#include ++" ++if test "x$ac_cv_have_decl_bswap_64" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi + ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_BSWAP_64 $ac_have_decl ++_ACEOF ++ ++ ++ ++ ++ + for ac_func in $ac_func_list + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +@@ -7227,7 +7390,7 @@ + # + # INIT-COMMANDS + # +-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" ++AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + _ACEOF + +@@ -7839,29 +8002,35 @@ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. +- case $CONFIG_FILES in +- *\'*) eval set x "$CONFIG_FILES" ;; +- *) set x $CONFIG_FILES ;; +- esac ++ # TODO: see whether this extra hack can be removed once we start ++ # requiring Autoconf 2.70 or later. ++ case $CONFIG_FILES in #( ++ *\'*) : ++ eval set x "$CONFIG_FILES" ;; #( ++ *) : ++ set x $CONFIG_FILES ;; #( ++ *) : ++ ;; ++esac + shift +- for mf ++ # Used to flag and report bootstrapping failures. ++ am_rc=0 ++ for am_mf + do + # Strip MF so we end up with the name of the file. +- mf=`echo "$mf" | sed -e 's/:.*$//'` +- # Check whether this is an Automake generated Makefile or not. +- # We used to match only the files named 'Makefile.in', but +- # some people rename them; so instead we look at the file content. +- # Grep'ing the first line is not enough: some people post-process +- # each Makefile.in and add a new line on top of each file to say so. +- # Grep'ing the whole file is not good either: AIX grep has a line ++ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` ++ # Check whether this is an Automake generated Makefile which includes ++ # dependency-tracking related rules and includes. ++ # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. +- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then +- dirpart=`$as_dirname -- "$mf" || +-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$mf" : 'X\(//\)[^/]' \| \ +- X"$mf" : 'X\(//\)$' \| \ +- X"$mf" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$mf" | ++ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ ++ || continue ++ am_dirpart=`$as_dirname -- "$am_mf" || ++$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$am_mf" : 'X\(//\)[^/]' \| \ ++ X"$am_mf" : 'X\(//\)$' \| \ ++ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -7879,53 +8048,48 @@ + q + } + s/.*/./; q'` +- else +- continue +- fi +- # Extract the definition of DEPDIR, am__include, and am__quote +- # from the Makefile without running 'make'. +- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` +- test -z "$DEPDIR" && continue +- am__include=`sed -n 's/^am__include = //p' < "$mf"` +- test -z "$am__include" && continue +- am__quote=`sed -n 's/^am__quote = //p' < "$mf"` +- # Find all dependency output files, they are included files with +- # $(DEPDIR) in their names. We invoke sed twice because it is the +- # simplest approach to changing $(DEPDIR) to its actual value in the +- # expansion. +- for file in `sed -n " +- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ +- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do +- # Make sure the directory exists. +- test -f "$dirpart/$file" && continue +- fdir=`$as_dirname -- "$file" || +-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$file" : 'X\(//\)[^/]' \| \ +- X"$file" : 'X\(//\)$' \| \ +- X"$file" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$file" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ am_filepart=`$as_basename -- "$am_mf" || ++$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$am_mf" : 'X\(//\)$' \| \ ++ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X/"$am_mf" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } +- /^X\(\/\/\)[^/].*/{ ++ /^X\/\(\/\/\)$/{ + s//\1/ + q + } +- /^X\(\/\/\)$/{ ++ /^X\/\(\/\).*/{ + s//\1/ + q + } +- /^X\(\/\).*/{ +- s//\1/ +- q +- } + s/.*/./; q'` +- as_dir=$dirpart/$fdir; as_fn_mkdir_p +- # echo "creating $dirpart/$file" +- echo '# dummy' > "$dirpart/$file" +- done ++ { echo "$as_me:$LINENO: cd "$am_dirpart" \ ++ && sed -e '/# am--include-marker/d' "$am_filepart" \ ++ | $MAKE -f - am--depfiles" >&5 ++ (cd "$am_dirpart" \ ++ && sed -e '/# am--include-marker/d' "$am_filepart" \ ++ | $MAKE -f - am--depfiles) >&5 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } || am_rc=$? + done ++ if test $am_rc -ne 0; then ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "Something went wrong bootstrapping makefile fragments ++ for automatic dependency tracking. Try re-running configure with the ++ '--disable-dependency-tracking' option to at least be able to build ++ the package (albeit without support for automatic dependency tracking). ++See \`config.log' for more details" "$LINENO" 5; } ++ fi ++ { am_dirpart=; unset am_dirpart;} ++ { am_filepart=; unset am_filepart;} ++ { am_mf=; unset am_mf;} ++ { am_rc=; unset am_rc;} ++ rm -f conftest-deps.mk + } + ;; + +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/configure.ac binutils/libctf/configure.ac +--- binutils.orig/libctf/configure.ac 2019-12-16 13:05:01.037964000 +0000 ++++ binutils/libctf/configure.ac 2019-12-16 14:31:49.144635000 +0000 +@@ -30,6 +30,7 @@ + AC_PROG_CC + AC_PROG_RANLIB + AM_PROG_AR ++ZW_GNU_GETTEXT_SISTER_DIR + + AC_SYS_LARGEFILE + +@@ -90,6 +91,9 @@ + AC_C_BIGENDIAN + AC_CHECK_HEADERS(byteswap.h endian.h) + AC_CHECK_FUNCS(pread) ++ ++dnl Check for bswap_{16,32,64} ++AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include ]]) + + dnl Check for qsort_r. (Taken from gnulib.) + AC_CHECK_FUNCS_ONCE([qsort_r]) +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/ctf-archive.c binutils/libctf/ctf-archive.c +--- binutils.orig/libctf/ctf-archive.c 2019-12-16 13:05:01.038294000 +0000 ++++ binutils/libctf/ctf-archive.c 2019-12-16 14:31:06.262127000 +0000 +@@ -44,9 +44,6 @@ + const char **errmsg); + static int arc_mmap_unmap (void *header, size_t headersz, const char **errmsg); + +-/* bsearch() internal state. */ +-static __thread char *search_nametbl; +- + /* Write out a CTF archive. The entries in CTF_FILES are referenced by name: + the names are passed in the names array, which must have CTF_FILES entries. + +@@ -300,13 +297,14 @@ + &nametbl[le64toh (b->name_offset)]); + } + +-/* bsearch() function to search for a given name in the sorted array of struct ++/* bsearch_r() function to search for a given name in the sorted array of struct + ctf_archive_modents. */ + static int +-search_modent_by_name (const void *key, const void *ent) ++search_modent_by_name (const void *key, const void *ent, void *arg) + { + const char *k = key; + const struct ctf_archive_modent *v = ent; ++ const char *search_nametbl = arg; + + return strcmp (k, &search_nametbl[le64toh (v->name_offset)]); + } +@@ -419,6 +417,7 @@ + const char *name, int *errp) + { + struct ctf_archive_modent *modent; ++ const char *search_nametbl; + + if (name == NULL) + name = _CTF_SECTION; /* The default name. */ +@@ -428,10 +427,10 @@ + modent = (ctf_archive_modent_t *) ((char *) arc + + sizeof (struct ctf_archive)); + +- search_nametbl = (char *) arc + le64toh (arc->ctfa_names); +- modent = bsearch (name, modent, le64toh (arc->ctfa_nfiles), +- sizeof (struct ctf_archive_modent), +- search_modent_by_name); ++ search_nametbl = (const char *) arc + le64toh (arc->ctfa_names); ++ modent = bsearch_r (name, modent, le64toh (arc->ctfa_nfiles), ++ sizeof (struct ctf_archive_modent), ++ search_modent_by_name, (void *) search_nametbl); + + /* This is actually a common case and normal operation: no error + debug output. */ +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/ctf-create.c binutils/libctf/ctf-create.c +--- binutils.orig/libctf/ctf-create.c 2019-12-16 13:05:01.038815000 +0000 ++++ binutils/libctf/ctf-create.c 2019-12-16 14:31:06.262525000 +0000 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + #ifndef roundup +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/ctf-endian.h binutils/libctf/ctf-endian.h +--- binutils.orig/libctf/ctf-endian.h 2019-12-16 12:41:49.160410000 +0000 ++++ binutils/libctf/ctf-endian.h 2019-12-16 14:31:06.262648000 +0000 +@@ -24,10 +24,10 @@ + #include + #include "swap.h" + +-#ifndef HAVE_ENDIAN_H ++#if !defined (HAVE_ENDIAN_H) || !defined (htole64) + #ifndef WORDS_BIGENDIAN +-# define htole64(x) bswap_identity_64 ((x)) +-# define le64toh(x) bswap_identity_64 ((x)) ++# define htole64(x) (x) ++# define le64toh(x) (x) + #else + # define htole64(x) bswap_64 ((x)) + # define le64toh(x) bswap_64 ((x)) +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/ctf-impl.h binutils/libctf/ctf-impl.h +--- binutils.orig/libctf/ctf-impl.h 2019-12-16 13:05:01.039050000 +0000 ++++ binutils/libctf/ctf-impl.h 2019-12-16 14:31:06.262883000 +0000 +@@ -58,6 +58,13 @@ + #define _libctf_unused_ __attribute__ ((__unused__)) + #define _libctf_malloc_ __attribute__((__malloc__)) + ++#else ++ ++#define _libctf_printflike_(string_index,first_to_check) ++#define _libctf_unlikely_(x) (x) ++#define _libctf_unused_ ++#define _libctf_malloc_ ++ + #endif + + /* libctf in-memory state. */ +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/ctf-open-bfd.c binutils/libctf/ctf-open-bfd.c +--- binutils.orig/libctf/ctf-open-bfd.c 2019-12-16 13:05:01.039304000 +0000 ++++ binutils/libctf/ctf-open-bfd.c 2019-12-16 14:31:06.263077000 +0000 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include "swap.h" +diff -x .git -x autom4te.cache -durN binutils.orig/libctf/swap.h binutils/libctf/swap.h +--- binutils.orig/libctf/swap.h 2019-12-16 13:05:01.039437000 +0000 ++++ binutils/libctf/swap.h 2019-12-16 14:31:06.263198000 +0000 +@@ -25,16 +25,20 @@ + + #ifdef HAVE_BYTESWAP_H + #include +-#else ++#endif /* defined(HAVE_BYTESWAP_H) */ + + /* Provide our own versions of the byteswap functions. */ +-inline uint16_t ++ ++#if !HAVE_DECL_BSWAP_16 ++static inline uint16_t + bswap_16 (uint16_t v) + { + return ((v >> 8) & 0xff) | ((v & 0xff) << 8); + } ++#endif /* !HAVE_DECL_BSWAP16 */ + +-inline uint32_t ++#if !HAVE_DECL_BSWAP_32 ++static inline uint32_t + bswap_32 (uint32_t v) + { + return ( ((v & 0xff000000) >> 24) +@@ -42,14 +46,10 @@ + | ((v & 0x0000ff00) << 8) + | ((v & 0x000000ff) << 24)); + } ++#endif /* !HAVE_DECL_BSWAP32 */ + +-inline uint64_t +-bswap_identity_64 (uint64_t v) +-{ +- return v; +-} +- +-inline uint64_t ++#if !HAVE_DECL_BSWAP_64 ++static inline uint64_t + bswap_64 (uint64_t v) + { + return ( ((v & 0xff00000000000000ULL) >> 56) +@@ -61,6 +61,6 @@ + | ((v & 0x000000000000ff00ULL) << 40) + | ((v & 0x00000000000000ffULL) << 56)); + } +-#endif /* !defined(HAVE_BYTESWAP_H) */ ++#endif /* !HAVE_DECL_BSWAP64 */ + + #endif /* !defined(_CTF_SWAP_H) */ +diff -x .git -x autom4te.cache -durN binutils.orig/libiberty/Makefile.in binutils/libiberty/Makefile.in +--- binutils.orig/libiberty/Makefile.in 2019-12-16 13:05:01.042227000 +0000 ++++ binutils/libiberty/Makefile.in 2019-12-16 14:31:06.263555000 +0000 +@@ -123,7 +123,7 @@ + # CONFIGURED_OFILES and funcs in configure.ac. Also run "make maint-deps" + # to build the new rules. + CFILES = alloca.c argv.c asprintf.c atexit.c \ +- basename.c bcmp.c bcopy.c bsearch.c bzero.c \ ++ basename.c bcmp.c bcopy.c bsearch.c bsearch_r.c bzero.c \ + calloc.c choose-temp.c clock.c concat.c cp-demangle.c \ + cp-demint.c cplus-dem.c crc32.c \ + d-demangle.c dwarfnames.c dyn-string.c \ +@@ -167,6 +167,7 @@ + ./regex.$(objext) ./cplus-dem.$(objext) ./cp-demangle.$(objext) \ + ./md5.$(objext) ./sha1.$(objext) ./alloca.$(objext) \ + ./argv.$(objext) \ ++ ./bsearch_r.$(objext) \ + ./choose-temp.$(objext) ./concat.$(objext) \ + ./cp-demint.$(objext) ./crc32.$(objext) ./d-demangle.$(objext) \ + ./dwarfnames.$(objext) ./dyn-string.$(objext) \ +@@ -596,6 +597,15 @@ + $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/bsearch.c -o noasan/$@; \ + else true; fi + $(COMPILE.c) $(srcdir)/bsearch.c $(OUTPUT_OPTION) ++ ++./bsearch_r.$(objext): $(srcdir)/bsearch_r.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch_r.c -o pic/$@; \ ++ else true; fi ++ if [ x"$(NOASANFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/bsearch_r.c -o noasan/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/bsearch_r.c $(OUTPUT_OPTION) + + ./bzero.$(objext): $(srcdir)/bzero.c + if [ x"$(PICFLAG)" != x ]; then \ +diff -x .git -x autom4te.cache -durN binutils.orig/libiberty/bsearch_r.c binutils/libiberty/bsearch_r.c +--- binutils.orig/libiberty/bsearch_r.c 1970-01-01 01:00:00.000000000 +0100 ++++ binutils/libiberty/bsearch_r.c 2019-12-16 14:31:06.263681000 +0000 +@@ -0,0 +1,92 @@ ++/* ++ * Copyright (c) 1990 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. [rescinded 22 July 1999] ++ * 4. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++/* ++ ++@deftypefn Supplemental void* bsearch_r (const void *@var{key}, @ ++ const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, @ ++ int (*@var{compar})(const void *, const void *, void *), void *@var{arg}) ++ ++Performs a search over an array of @var{nmemb} elements pointed to by ++@var{base} for a member that matches the object pointed to by @var{key}. ++The size of each member is specified by @var{size}. The array contents ++should be sorted in ascending order according to the @var{compar} ++comparison function. This routine should take two arguments pointing to ++the @var{key} and to an array member, in that order, and should return an ++integer less than, equal to, or greater than zero if the @var{key} object ++is respectively less than, matching, or greater than the array member. ++ ++@end deftypefn ++ ++*/ ++ ++#include "config.h" ++#include "ansidecl.h" ++#include /* size_t */ ++#include ++ ++/* ++ * Perform a binary search. ++ * ++ * The code below is a bit sneaky. After a comparison fails, we ++ * divide the work in half by moving either left or right. If lim ++ * is odd, moving left simply involves halving lim: e.g., when lim ++ * is 5 we look at item 2, so we change lim to 2 so that we will ++ * look at items 0 & 1. If lim is even, the same applies. If lim ++ * is odd, moving right again involes halving lim, this time moving ++ * the base up one item past p: e.g., when lim is 5 we change base ++ * to item 3 and make lim 2 so that we will look at items 3 and 4. ++ * If lim is even, however, we have to shrink it by one before ++ * halving: e.g., when lim is 4, we still looked at item 2, so we ++ * have to make lim 3, then halve, obtaining 1, so that we will only ++ * look at item 3. ++ */ ++void * ++bsearch_r (register const void *key, const void *base0, ++ size_t nmemb, register size_t size, ++ register int (*compar)(const void *, const void *, void *), ++ void *arg) ++{ ++ register const char *base = (const char *) base0; ++ register int lim, cmp; ++ register const void *p; ++ ++ for (lim = nmemb; lim != 0; lim >>= 1) { ++ p = base + (lim >> 1) * size; ++ cmp = (*compar)(key, p, arg); ++ if (cmp == 0) ++ return (void *)p; ++ if (cmp > 0) { /* key > p: move right */ ++ base = (const char *)p + size; ++ lim--; ++ } /* else move left */ ++ } ++ return (NULL); ++} + Property changes on: files/libcft-failures.diff ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property