commit: b63e437927c32bf6562c92220f428910c107eddf Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Thu Oct 2 00:30:06 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Oct 2 00:30:06 2025 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b63e4379
16.0.0: add toplevel sync patches Signed-off-by: Sam James <sam <AT> gentoo.org> 16.0.0/gentoo/87_all_sync_toplevel-1.patch | 621 +++++ 16.0.0/gentoo/88_all_sync_toplevel-2.patch | 3427 ++++++++++++++++++++++++++++ 16.0.0/gentoo/README.history | 5 + 3 files changed, 4053 insertions(+) diff --git a/16.0.0/gentoo/87_all_sync_toplevel-1.patch b/16.0.0/gentoo/87_all_sync_toplevel-1.patch new file mode 100644 index 0000000..1db674f --- /dev/null +++ b/16.0.0/gentoo/87_all_sync_toplevel-1.patch @@ -0,0 +1,621 @@ +From b1803529c91ad49f51b63fb1eaba407eb944df22 Mon Sep 17 00:00:00 2001 +Message-ID: <b1803529c91ad49f51b63fb1eaba407eb944df22.1759364954.git....@gentoo.org> +From: "H.J. Lu" <[email protected]> +Date: Thu, 2 Oct 2025 06:13:41 +0800 +Subject: [PATCH] Sync toplevel files from binutils-gdb + +commit 28ea7ae220a0343ff7fe531ec761bd77d00dcb1c +Author: Matthieu Longo <[email protected]> +Date: Tue May 28 10:49:45 2024 +0100 + + autoupdate: replace old version of AC_INIT by the new one + + - old AC_INIT by AC_INIT + AC_CONFIG_SRC_DIR + https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fINIT-3 + +commit 29496481662736f0a24bfc1daf31dbfc9d2bb7ee +Author: Matthieu Longo <[email protected]> +Date: Tue May 28 10:49:43 2024 +0100 + + autoupdate: replace obsolete macros AC_CANONICAL_SYSTEM + + - AC_CANONICAL_SYSTEM by: + * AC_CANONICAL_HOST where host, and host_alias are needed + * AC_CANONICAL_TARGET where target_alias is needed + https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fCANONICAL_005fTARGET-1 + +commit d9639e091c77689b10363ecb197466deaa161ade +Author: Maciej W. Rozycki <[email protected]> +Date: Mon Apr 28 18:53:30 2025 +0100 + + Fix 64-bit BFD detection causing build failures + + We have a discrepancy with 64-bit BFD handling across our component + subdirectories leading to link failures such as: + + ld: ../opcodes/.libs/libopcodes.a(disassemble.o): in function `disassembler': disassemble.c:(.text+0x65): undefined reference to `print_insn_alpha' + ld: disassemble.c:(.text+0x105): undefined reference to `print_insn_ia64' + ld: disassemble.c:(.text+0x11d): undefined reference to `print_insn_loongarch' + ld: disassemble.c:(.text+0x1a1): undefined reference to `print_insn_big_mips' + [...] + + with some configurations having a 32-bit host and 64-bit BFD, such as: + `--host=i386-linux-gnu --target=riscv64-linux-gnu --enable-targets=all'. + This is ultimately due to how 64-bit BFD is enabled for bfd/ itself and + other subdirectorses and has been a regression from commit 1d5269c994bf + ("unify 64-bit bfd checks"). + + For bfd/ the BFD_64_BIT autoconf macro from config/bfd64.m4 is used + combined with this logic in bfd/configure.ac: + + case ${host64}-${target64}-${want64} in + *true*) + wordsize=64 + bfd64_libs='$(BFD64_LIBS)' + all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' + [...] + ;; + false-false-false) + wordsize=32 + all_backends='$(BFD32_BACKENDS)' + ;; + esac + + where the value of ${wordsize} switches between 32-bit and 64-bit BFD + via these pieces: + + #define BFD_ARCH_SIZE @wordsize@ + + and: + + #if BFD_ARCH_SIZE >= 64 + #define BFD64 + #endif + + in bfd/bfd-in.h, which ultimately becomes a part of "bfd.h". + + Then ${host64} is determined in bfd/configure.ac from the host's word + size, via the host's pointer size: + + if test "x${ac_cv_sizeof_void_p}" = "x8"; then + host64=true + fi + + And ${target64} is determined in bfd/configure.ac from the target's word + size: + + if test ${target_size} = 64; then + target64=true + fi + + Where multiple targets have been requested with `--enable-targets=all' + the presence of any 64-bit target will set "true" here. + + Finally ${want64} is set according to `--enable-64-bit-bfd' user option + with an arrangement involving BFD_64_BIT: + + BFD_64_BIT + if test $enable_64_bit_bfd = yes ; then + want64=true + else + want64=false + fi + + which also, redundantly, checks and sets its result upon the host's word + size. Lastly ${want64} is also selectively set by target fragments in + bfd/config.bfd, which mostly if not completely overlaps with ${target64} + setting as described above. + + Conversely other subdirectories only rely on BFD_64_BIT, so they fail to + notice that BFD is 64-bit and do not enable their 64-bit handling where + the host requested is 32-bit and 64-bit BFD has been enabled other than + with `--enable-64-bit-bfd'. One consequence is opcodes/disassemble.c + enables calls to its numerous own 64-bit backends by checking the BFD64 + macro from "bfd.h", however does not actually enable said backends in + its Makefile. Hence the link errors quoted above. + + Address the problem then by moving the `--enable-64-bit-bfd' option back + to bfd/configure.ac and remove the call to BFD_64_BIT from there and + then rewrite the macro in terms of checking for the presence of BFD64 + macro in "bfd.h", which is the canonical way of determining whether BFD + is 64-bit or not. + + Rather than running `grep' directly on ../bfd/bfd-in3.h as the opcodes/ + fragment used to before the problematic commit: + + if grep '#define BFD_ARCH_SIZE 64' ../bfd/bfd-in3.h > /dev/null; then + + run the preprocessor on "bfd.h", which allows to invoke the macro from + configure.ac files placed in subdirectories located at deeper levels, by + relying on the preprocessor's search path. + + This requires however that the invokers rely on `all-bfd' rather than + `configure-bfd' for their `configure' invocation stage, because "bfd.h" + is made by `make all' rather than `configure' in bfd/. + + Do not cache the result of this check however, as reconfiguring a tree + such as to flip `--enable-64-bit-bfd' on or to change a secondary target + may affect BFD64 and we have no access to information about secondary + targets in BFD_64_BIT. + + Also remove the ENABLE_BFD_64_BIT automake conditional, as it's not used + anywhere. + + Last but not least remove the hack from gdb/configure.ac to fail builds + for `mips*-*-*' hosts where `--enable-targets=all' has been requested, + but `--enable-64-bit-bfd' has not as it's no longer needed. Such builds + complete successfully now, having enabled 64-bit BFD implicitly. + + Tested-By: Guinevere Larsen <[email protected]> + Tested-By: Luis Machado <[email protected]> + Approved-By: Alan Modra <[email protected]> + Approved-By: Luis Machado <[email protected]> + + * Makefile.def: Synced from binutils-gdb. + * Makefile.in: Regenerated. + +commit 319719bb2921e978738acd408e6b16dabf0e7f5e +Author: Tom Tromey <[email protected]> +Date: Thu Mar 21 17:12:23 2024 -0600 + + Revert "Pass GUILE down to subdirectories" + + This reverts commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f. + + This patch caused problems for some users when building gdb, because + it would cause 'guild' to be invoked with the wrong versin of guile. + On the whole it seems simpler to just back this out. + + I'm checking this in to the binutils-gdb repository in the interest of + fixing the build for Andrew. No one has responded to the identical + patch sent to gcc-patches, but I will ping it there. + +commit da48217f315084097ef25226c0acab3bbd55ebd3 +Author: Simon Marchi <[email protected]> +Date: Thu Mar 14 13:39:18 2024 -0400 + + gdbserver/linux: probe for libiconv in configure + + Make gdbserver's build system locate libiconv when building for Linux. + + Commit 07b3255c3bae ("Filter invalid encodings from Linux thread names") + make libiconv madantory for building gdbserver on Linux. + + While trying to cross-compile gdb for xtensa-fsf-linux-uclibc (with a + toolchain generated with crosstool-ng), I got: + + /home/smarchi/src/binutils-gdb/gdbserver/linux-low.cc:48:10: fatal error: iconv.h: No such file or directory + 48 | #include <iconv.h> + | ^~~~~~~~~ + + I downloaded GNU libiconv, built it for that host, and installed it in + an arbitrary directory. I had to modify the gdbserver build system to + locate libiconv and use it, the result is this patch. + + I eventually found that crosstool-ng has a config option to make uclibc + provide an implementation of iconv, which is of course much easier. But + given that this patch is now written, I think it would be worth merging + it, it could help some people who do not have iconv built-in their libc + in the future (and may not have the luxury of rebuilding their libc like + I do). + + Using AM_ICONV in configure.ac adds these options for configure (the + same we have for gdb): + + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-libiconv-type=TYPE type of library to search for (auto/static/shared) + + It sets the `LIBICONV` variable with whatever is needed to link with + libiconv, and adds the necessary `-I` flag to `CPPFLAGS`. + + To avoid unnecessarily linking against libiconv on hosts that don't need + it, set `MAYBE_LIBICONV` with the contents of `LIBICONV` only if the + host is Linux, and use `MAYBE_LIBICONV` in `Makefile.in`. + + Since libiconv is a hard requirement for Linux hosts, error out if it is + not found. + + The bits in acinclude.m4 are similar to what we have in + gdb/acinclude.m4. + + Update the top-level build system to support building against an in-tree + libiconv (I did not test this part though). Something tells me that the + all-gdbserver dependency on all-libiconv is unnecessary, since there is + already a dependency of configure-gdbserver on all-libiconv (and + all-gdbserver surely depends on configure-gdbserver). I just copied + what's done for GDB though. + + * Makefile.def: Synced from binutils-gdb. + * Makefile.tpl: Likewise. + * configure.ac: Likewise. + * Makefile.in: Regenerated. + * configure: Likewise. + +config/ + + * acx.m4: Synced from binutils-gdb. + * lthostflags.m4: Likewise. + +libbacktrace/ + + * configure.ac: Synced from binutils-gdb. + * configure: Regenerated. + +zlib/ + * configure.ac: Synced from binutils-gdb. + * configure: Regenerated. + +Signed-off-by: H.J. Lu <[email protected]> +--- + Makefile.def | 7 +++--- + Makefile.in | 50 +++++++++++++++++++-------------------- + Makefile.tpl | 7 ++---- + config/acx.m4 | 4 ++-- + config/lthostflags.m4 | 2 +- + configure | 2 +- + configure.ac | 7 +++--- + libbacktrace/configure | 5 ++-- + libbacktrace/configure.ac | 3 ++- + zlib/configure | 5 ++-- + zlib/configure.ac | 2 +- + 11 files changed, 45 insertions(+), 49 deletions(-) + +diff --git a/Makefile.def b/Makefile.def +index fa60f6ea0b90..e5b95d7f705f 100644 +--- a/Makefile.def ++++ b/Makefile.def +@@ -313,7 +313,6 @@ flags_to_pass = { flag= GNATBIND ; }; + flags_to_pass = { flag= GNATMAKE ; }; + flags_to_pass = { flag= GDC ; }; + flags_to_pass = { flag= GDCFLAGS ; }; +-flags_to_pass = { flag= GUILE ; }; + + // Target tools + flags_to_pass = { flag= AR_FOR_TARGET ; }; +@@ -463,9 +462,11 @@ dependencies = { module=all-gdb; on=all-libbacktrace; }; + + // Host modules specific to gdbserver. + dependencies = { module=configure-gdbserver; on=all-gnulib; }; ++dependencies = { module=configure-gdbserver; on=all-libiconv; }; + dependencies = { module=all-gdbserver; on=all-gdbsupport; }; + dependencies = { module=all-gdbserver; on=all-gnulib; }; + dependencies = { module=all-gdbserver; on=all-libiberty; }; ++dependencies = { module=all-gdbserver; on=all-libiconv; }; + + dependencies = { module=configure-libgui; on=configure-tcl; }; + dependencies = { module=configure-libgui; on=configure-tk; }; +@@ -524,7 +525,7 @@ dependencies = { module=install-bfd; on=install-libsframe; }; + dependencies = { module=install-strip-bfd; on=install-strip-libsframe; }; + + // libopcodes depends on libbfd +-dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; }; ++dependencies = { module=configure-opcodes; on=all-bfd; hard=true; }; + dependencies = { module=install-opcodes; on=install-bfd; }; + dependencies = { module=install-strip-opcodes; on=install-strip-bfd; }; + +@@ -550,8 +551,8 @@ dependencies = { module=install-gprofng; on=install-opcodes; }; + dependencies = { module=install-gprofng; on=install-bfd; }; + + dependencies = { module=configure-ld; on=configure-gettext; }; ++dependencies = { module=configure-ld; on=all-bfd; }; + dependencies = { module=all-ld; on=all-libiberty; }; +-dependencies = { module=all-ld; on=all-bfd; }; + dependencies = { module=all-ld; on=all-opcodes; }; + dependencies = { module=all-ld; on=all-build-bison; }; + dependencies = { module=all-ld; on=all-build-flex; }; +diff --git a/Makefile.in b/Makefile.in +index 12d4395d8e2f..8d406d124a12 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -3,7 +3,7 @@ + # + # Makefile for directory with subdirs to build. + # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023 ++# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + # Free Software Foundation + # + # This file is free software; you can redistribute it and/or modify +@@ -144,8 +144,7 @@ BASE_EXPORTS = \ + M4="$(M4)"; export M4; \ + SED="$(SED)"; export SED; \ + AWK="$(AWK)"; export AWK; \ +- MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \ +- GUILE="$(GUILE)"; export GUILE; ++ MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + + # This is the list of variables to export in the environment when + # configuring subdirectories for the build system. +@@ -460,8 +459,6 @@ CRAB1_LIBS = @CRAB1_LIBS@ + + PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ + +-GUILE = guile +- + # Pass additional PGO and LTO compiler options to the PGO build. + BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS) + override CFLAGS += $(BUILD_CFLAGS) +@@ -891,7 +888,6 @@ BASE_FLAGS_TO_PASS = \ + "GNATMAKE=$(GNATMAKE)" \ + "GDC=$(GDC)" \ + "GDCFLAGS=$(GDCFLAGS)" \ +- "GUILE=$(GUILE)" \ + "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ + "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ +@@ -68682,16 +68678,16 @@ install-strip-ld: maybe-install-strip-bfd + install-strip-ld: maybe-install-strip-libctf + install-bfd: maybe-install-libsframe + install-strip-bfd: maybe-install-strip-libsframe +-configure-opcodes: configure-bfd +-configure-stage1-opcodes: configure-stage1-bfd +-configure-stage2-opcodes: configure-stage2-bfd +-configure-stage3-opcodes: configure-stage3-bfd +-configure-stage4-opcodes: configure-stage4-bfd +-configure-stageprofile-opcodes: configure-stageprofile-bfd +-configure-stagetrain-opcodes: configure-stagetrain-bfd +-configure-stagefeedback-opcodes: configure-stagefeedback-bfd +-configure-stageautoprofile-opcodes: configure-stageautoprofile-bfd +-configure-stageautofeedback-opcodes: configure-stageautofeedback-bfd ++configure-opcodes: all-bfd ++configure-stage1-opcodes: all-stage1-bfd ++configure-stage2-opcodes: all-stage2-bfd ++configure-stage3-opcodes: all-stage3-bfd ++configure-stage4-opcodes: all-stage4-bfd ++configure-stageprofile-opcodes: all-stageprofile-bfd ++configure-stagetrain-opcodes: all-stagetrain-bfd ++configure-stagefeedback-opcodes: all-stagefeedback-bfd ++configure-stageautoprofile-opcodes: all-stageautoprofile-bfd ++configure-stageautofeedback-opcodes: all-stageautofeedback-bfd + install-opcodes: maybe-install-bfd + install-strip-opcodes: maybe-install-strip-bfd + configure-gas: maybe-configure-gettext +@@ -68756,6 +68752,16 @@ configure-stagetrain-ld: maybe-configure-stagetrain-gettext + configure-stagefeedback-ld: maybe-configure-stagefeedback-gettext + configure-stageautoprofile-ld: maybe-configure-stageautoprofile-gettext + configure-stageautofeedback-ld: maybe-configure-stageautofeedback-gettext ++configure-ld: maybe-all-bfd ++configure-stage1-ld: maybe-all-stage1-bfd ++configure-stage2-ld: maybe-all-stage2-bfd ++configure-stage3-ld: maybe-all-stage3-bfd ++configure-stage4-ld: maybe-all-stage4-bfd ++configure-stageprofile-ld: maybe-all-stageprofile-bfd ++configure-stagetrain-ld: maybe-all-stagetrain-bfd ++configure-stagefeedback-ld: maybe-all-stagefeedback-bfd ++configure-stageautoprofile-ld: maybe-all-stageautoprofile-bfd ++configure-stageautofeedback-ld: maybe-all-stageautofeedback-bfd + all-ld: maybe-all-libiberty + all-stage1-ld: maybe-all-stage1-libiberty + all-stage2-ld: maybe-all-stage2-libiberty +@@ -68766,16 +68772,6 @@ all-stagetrain-ld: maybe-all-stagetrain-libiberty + all-stagefeedback-ld: maybe-all-stagefeedback-libiberty + all-stageautoprofile-ld: maybe-all-stageautoprofile-libiberty + all-stageautofeedback-ld: maybe-all-stageautofeedback-libiberty +-all-ld: maybe-all-bfd +-all-stage1-ld: maybe-all-stage1-bfd +-all-stage2-ld: maybe-all-stage2-bfd +-all-stage3-ld: maybe-all-stage3-bfd +-all-stage4-ld: maybe-all-stage4-bfd +-all-stageprofile-ld: maybe-all-stageprofile-bfd +-all-stagetrain-ld: maybe-all-stagetrain-bfd +-all-stagefeedback-ld: maybe-all-stagefeedback-bfd +-all-stageautoprofile-ld: maybe-all-stageautoprofile-bfd +-all-stageautofeedback-ld: maybe-all-stageautofeedback-bfd + all-ld: maybe-all-opcodes + all-stage1-ld: maybe-all-stage1-opcodes + all-stage2-ld: maybe-all-stage2-opcodes +@@ -69249,7 +69245,9 @@ all-gdb: maybe-all-opcodes + all-gdb: maybe-all-libdecnumber + all-gdb: maybe-all-libctf + all-gdb: maybe-all-libbacktrace ++configure-gdbserver: maybe-all-libiconv + all-gdbserver: maybe-all-libiberty ++all-gdbserver: maybe-all-libiconv + configure-gdbsupport: maybe-configure-gettext + all-gdbsupport: maybe-all-gettext + configure-gprof: maybe-configure-gettext +diff --git a/Makefile.tpl b/Makefile.tpl +index ddcca5589137..7e74c7219298 100644 +--- a/Makefile.tpl ++++ b/Makefile.tpl +@@ -6,7 +6,7 @@ in + # + # Makefile for directory with subdirs to build. + # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023 ++# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + # Free Software Foundation + # + # This file is free software; you can redistribute it and/or modify +@@ -147,8 +147,7 @@ BASE_EXPORTS = \ + M4="$(M4)"; export M4; \ + SED="$(SED)"; export SED; \ + AWK="$(AWK)"; export AWK; \ +- MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \ +- GUILE="$(GUILE)"; export GUILE; ++ MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + + # This is the list of variables to export in the environment when + # configuring subdirectories for the build system. +@@ -463,8 +462,6 @@ CRAB1_LIBS = @CRAB1_LIBS@ + + PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ + +-GUILE = guile +- + # Pass additional PGO and LTO compiler options to the PGO build. + BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS) + override CFLAGS += $(BUILD_CFLAGS) +diff --git a/config/acx.m4 b/config/acx.m4 +index c45e55e7f517..db54ccf1c7c1 100644 +--- a/config/acx.m4 ++++ b/config/acx.m4 +@@ -107,9 +107,9 @@ AC_SUBST([target_subdir]) []dnl + + + #### +-# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM ++# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_TARGET + # or AC_INIT. +-# These demand that AC_CANONICAL_SYSTEM be called beforehand. ++# These demand that AC_CANONICAL_HOST and AC_CANONICAL_TARGET be called beforehand. + AC_DEFUN([_NCN_TOOL_PREFIXES], + [ncn_tool_prefix= + test -n "$host_alias" && ncn_tool_prefix=$host_alias- +diff --git a/config/lthostflags.m4 b/config/lthostflags.m4 +index bc0f59ee79e0..4a389a75ea83 100644 +--- a/config/lthostflags.m4 ++++ b/config/lthostflags.m4 +@@ -10,7 +10,7 @@ dnl Defines and AC_SUBSTs lt_host_flags + + + AC_DEFUN([ACX_LT_HOST_FLAGS], [ +-AC_REQUIRE([AC_CANONICAL_SYSTEM]) ++AC_REQUIRE([AC_CANONICAL_HOST]) + + case $host in + *-cygwin* | *-mingw*) +diff --git a/configure b/configure +index ccec3f21cd85..549aae7f3e3e 100755 +--- a/configure ++++ b/configure +@@ -2343,6 +2343,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ++ + progname=$0 + # if PWD already has a value, it is probably wrong. + if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi +@@ -2538,7 +2539,6 @@ test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +- + test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" + # Use a double $ so make ignores it. +diff --git a/configure.ac b/configure.ac +index 89ebe4041b61..15dccb651145 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -32,7 +32,8 @@ m4_include([ltversion.m4]) + m4_include([lt~obsolete.m4]) + m4_include([config/isl.m4]) + +-AC_INIT(move-if-change) ++AC_INIT ++AC_CONFIG_SRCDIR([move-if-change]) + AC_DISABLE_OPTION_CHECKING + + progname=$0 +@@ -70,14 +71,14 @@ ACX_NONCANONICAL_TARGET + + dnl Autoconf 2.5x and later will set a default program prefix if + dnl --target was used, even if it was the same as --host. Disable +-dnl that behavior. This must be done before AC_CANONICAL_SYSTEM ++dnl that behavior. This must be done before AC_CANONICAL_TARGET + dnl to take effect. + test "$host_noncanonical" = "$target_noncanonical" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_transform_name=s,y,y, + +-AC_CANONICAL_SYSTEM ++AC_CANONICAL_TARGET + AC_ARG_PROGRAM + + m4_pattern_allow([^AS_FOR_TARGET$])dnl +diff --git a/libbacktrace/configure b/libbacktrace/configure +index 85be043009af..f1b68d6731f7 100755 +--- a/libbacktrace/configure ++++ b/libbacktrace/configure +@@ -2739,7 +2739,6 @@ test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +- + target_alias=${target_alias-$host_alias} + + # Expand $ac_aux_dir to an absolute path. +@@ -11636,7 +11635,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11639 "configure" ++#line 11638 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11742,7 +11741,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11745 "configure" ++#line 11744 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac +index 6549cdeacf4f..0a5e04fcdf77 100644 +--- a/libbacktrace/configure.ac ++++ b/libbacktrace/configure.ac +@@ -37,7 +37,8 @@ if test -n "${with_target_subdir}"; then + AM_ENABLE_MULTILIB(, ..) + fi + +-AC_CANONICAL_SYSTEM ++AC_CANONICAL_HOST ++AC_CANONICAL_TARGET + target_alias=${target_alias-$host_alias} + + AC_USE_SYSTEM_EXTENSIONS +diff --git a/zlib/configure b/zlib/configure +index 202c15f3b513..ac76e60ff337 100755 +--- a/zlib/configure ++++ b/zlib/configure +@@ -2425,7 +2425,6 @@ test -n "$target_alias" && + NONENONEs,x,x, && + program_prefix=${target_alias}- + +- + # This works around an automake problem. + mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" + +@@ -10854,7 +10853,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10857 "configure" ++#line 10856 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10960,7 +10959,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10963 "configure" ++#line 10962 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/zlib/configure.ac b/zlib/configure.ac +index 736b760cdf57..434bfcb072a4 100644 +--- a/zlib/configure.ac ++++ b/zlib/configure.ac +@@ -7,7 +7,7 @@ if test -n "${with_target_subdir}"; then + AM_ENABLE_MULTILIB(, ..) + fi + +-AC_CANONICAL_SYSTEM ++AC_CANONICAL_TARGET + + # This works around an automake problem. + mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" + +base-commit: 790bbb9ca6b7ef871a092c6f5622c7eb9c7306bb +-- +2.51.0 + diff --git a/16.0.0/gentoo/88_all_sync_toplevel-2.patch b/16.0.0/gentoo/88_all_sync_toplevel-2.patch new file mode 100644 index 0000000..fad2097 --- /dev/null +++ b/16.0.0/gentoo/88_all_sync_toplevel-2.patch @@ -0,0 +1,3427 @@ +From 482893c6a913946c0551138e84018be46768294b Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <[email protected]> +Date: Thu, 2 Oct 2025 08:08:09 +0800 +Subject: [PATCH 2/2] Sync toplevel files from binutils-gdb + +commit 76a693c087c30e8108852928c717399011c6166d +Author: H.J. Lu <[email protected]> +Date: Tue Sep 30 11:23:58 2025 +0800 + + binutils: Use AC_TRY_COMPILE to check target clang/gcc + + Use AC_TRY_COMPILE to check for the working target clang and gcc when + configuring for cross tools. + +commit 77c74294bfc5005204a2de3cc64bbdb2f877be29 +Author: H.J. Lu <[email protected]> +Date: Fri Sep 26 08:03:01 2025 +0800 + + binutils: Pass target plugin file to target ar/nm/ranlib + + There are 2 kinds of binutils tests: + + 1. Tests of binutils object files and libraries using the build tools, + like CC, AR, NM and RANLIB. + 2. Tests of binutils programs as the target tools, like CC_FOR_TARGET, + AR_FOR_TARGET, NM_FOR_TARGET and RANLIB_FOR_TARGET. + + Set AR_PLUGIN_OPTION_FOR_TARGET, NM_PLUGIN_OPTION_FOR_TARGET and + RANLIB_PLUGIN_OPTION_FOR_TARGET to the target compiler plugin file for + target ar/nm/ranlib. + +commit 10deea6e2fc1b9ec5818b5fa1bc510c63ff5b2e2 +Author: H.J. Lu <[email protected]> +Date: Tue Sep 23 04:24:00 2025 +0800 + + Binutils/GCC: Add clang LTO support to AR, NM and RANLIB + + Add CLANG_PLUGIN_FILE to find the clang plugin file and pass it to + --plugin for ar, nm and ranlib so that binutils can be built with + clang LTO. Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION since + GCC_PLUGIN_OPTION may return the wrong PLUGIN_OPTION with clang. + + * Makefile.in: Regenerated. + * configure: Likewise. + * Makefile.tpl: Synced from binutils-gdb. + * configure.ac: Likewise. + * libtool.m4: Likewise. + +config/ + + * clang-plugin.m4: Synced from binutils-gdb. + * gcc-plugin.m4: Likewise. + +libbacktrace/ + + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + +libiberty/ + + * aclocal.m4: Regenerated. + * configure: Likewise. + * configure.ac: Synced from binutils-gdb. + +zlib/ + + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + +Signed-off-by: H.J. Lu <[email protected]> +--- + Makefile.in | 8 +- + Makefile.tpl | 8 +- + config/clang-plugin.m4 | 114 ++++++ + config/gcc-plugin.m4 | 43 +++ + configure | 754 +++++++++++++++++++++++++++++++++++- + configure.ac | 36 +- + libbacktrace/Makefile.in | 3 + + libbacktrace/aclocal.m4 | 2 + + libbacktrace/configure | 405 +++++++++++++++++++- + libiberty/aclocal.m4 | 1 + + libiberty/configure | 548 +++++++++++++++++++------- + libiberty/configure.ac | 43 ++- + libtool.m4 | 49 +-- + zlib/Makefile.in | 3 + + zlib/aclocal.m4 | 2 + + zlib/configure | 809 ++++++++++++++++++++++++++++----------- + 16 files changed, 2410 insertions(+), 418 deletions(-) + create mode 100644 config/clang-plugin.m4 + +diff --git a/Makefile.in b/Makefile.in +index 8d406d124a1..621e8dedc09 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -433,7 +433,7 @@ DLLTOOL = @DLLTOOL@ + DSYMUTIL = @DSYMUTIL@ + LD = @LD@ + LIPO = @LIPO@ +-NM = @NM@ ++NM = @NM@ @NM_PLUGIN_OPTION@ + OBJDUMP = @OBJDUMP@ + OTOOL = @OTOOL@ + RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@ +@@ -664,7 +664,7 @@ do-compare3 = $(do-compare) + # Programs producing files for the TARGET machine + # ----------------------------------------------- + +-AR_FOR_TARGET=@AR_FOR_TARGET@ ++AR_FOR_TARGET=@AR_FOR_TARGET@ @AR_PLUGIN_OPTION_FOR_TARGET@ + AS_FOR_TARGET=@AS_FOR_TARGET@ + CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ + +@@ -684,11 +684,11 @@ DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@ + LD_FOR_TARGET=@LD_FOR_TARGET@ + + LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ +-NM_FOR_TARGET=@NM_FOR_TARGET@ ++NM_FOR_TARGET=@NM_FOR_TARGET@ @NM_PLUGIN_OPTION_FOR_TARGET@ + OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ + OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ + OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@ +-RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ ++RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ @RANLIB_PLUGIN_OPTION_FOR_TARGET@ + READELF_FOR_TARGET=@READELF_FOR_TARGET@ + STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ + WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +diff --git a/Makefile.tpl b/Makefile.tpl +index 7e74c721929..2ac4d5b4668 100644 +--- a/Makefile.tpl ++++ b/Makefile.tpl +@@ -436,7 +436,7 @@ DLLTOOL = @DLLTOOL@ + DSYMUTIL = @DSYMUTIL@ + LD = @LD@ + LIPO = @LIPO@ +-NM = @NM@ ++NM = @NM@ @NM_PLUGIN_OPTION@ + OBJDUMP = @OBJDUMP@ + OTOOL = @OTOOL@ + RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@ +@@ -587,7 +587,7 @@ do-compare3 = $(do-compare) + # Programs producing files for the TARGET machine + # ----------------------------------------------- + +-AR_FOR_TARGET=@AR_FOR_TARGET@ ++AR_FOR_TARGET=@AR_FOR_TARGET@ @AR_PLUGIN_OPTION_FOR_TARGET@ + AS_FOR_TARGET=@AS_FOR_TARGET@ + CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ + +@@ -607,11 +607,11 @@ DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@ + LD_FOR_TARGET=@LD_FOR_TARGET@ + + LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ +-NM_FOR_TARGET=@NM_FOR_TARGET@ ++NM_FOR_TARGET=@NM_FOR_TARGET@ @NM_PLUGIN_OPTION_FOR_TARGET@ + OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ + OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ + OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@ +-RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ ++RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ @RANLIB_PLUGIN_OPTION_FOR_TARGET@ + READELF_FOR_TARGET=@READELF_FOR_TARGET@ + STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ + WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +diff --git a/config/clang-plugin.m4 b/config/clang-plugin.m4 +new file mode 100644 +index 00000000000..b6b28ab8d21 +--- /dev/null ++++ b/config/clang-plugin.m4 +@@ -0,0 +1,114 @@ ++# clang-plugin.m4 -*- Autoconf -*- ++# Check clang plugin file. ++ ++dnl Copyright (C) 2025 Free Software Foundation, Inc. ++dnl This file is free software, distributed under the terms of the GNU ++dnl General Public License. As a special exception to the GNU General ++dnl Public License, this file may be distributed as part of a program ++dnl that contains a configuration script generated by Autoconf, under ++dnl the same distribution terms as the rest of that program. ++ ++dnl ++dnl ++dnl CLANG_PLUGIN_FILE ++dnl (SHELL-CODE_HANDLER) ++dnl ++AC_DEFUN([CLANG_PLUGIN_FILE],[dnl ++ AC_CACHE_CHECK([for clang], clang_cv_is_clang, [ ++ AC_EGREP_CPP(yes, [ ++#ifdef __clang__ ++ yes ++#endif ++ ], clang_cv_is_clang=yes, clang_cv_is_clang=no)]) ++ plugin_file= ++ if test $clang_cv_is_clang = yes; then ++ AC_MSG_CHECKING([for clang plugin file]) ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ AC_CHECK_TOOL(LLVM_CONFIG, llvm-config) ++ if test "$?" != 0; then ++ AC_MSG_ERROR([Required tool 'llvm-config' not found on PATH.]) ++ fi ++ clang_lib_dir=`$LLVM_CONFIG --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ fi ++ done ++ if test -z $plugin_file; then ++ AC_MSG_ERROR([Couldn't find clang plugin file for $CC.]) ++ fi ++ dnl Check if ${AR} $plugin_option rc works. ++ AC_CHECK_TOOL(AR, ar) ++ if test "${AR}" = "" ; then ++ AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.]) ++ fi ++ plugin_option="--plugin $plugin_file" ++ touch conftest.c ++ ${AR} $plugin_option rc conftest.a conftest.c ++ if test "$?" != 0; then ++ AC_MSG_WARN([Failed: $AR $plugin_option rc]) ++ plugin_file= ++ fi ++ rm -f conftest.* ++ AC_MSG_RESULT($plugin_file) ++ fi ++ $1="$plugin_file" ++]) ++ ++dnl ++dnl ++dnl CLANG_PLUGIN_FILE_FOR_TARGET ++dnl (SHELL-CODE_HANDLER) ++dnl ++AC_DEFUN([CLANG_PLUGIN_FILE_FOR_TARGET],[dnl ++ COMPILER_FOR_TARGET="${CC_FOR_TARGET}" ++ if test x${COMPILER_FOR_TARGET} = x"\$(CC)"; then ++ COMPILER_FOR_TARGET="$CC" ++ fi ++ saved_CC="$CC" ++ CC="$COMPILER_FOR_TARGET" ++ AC_CACHE_CHECK([for clang for target], clang_target_cv_working, [ ++ AC_TRY_COMPILE([ ++#ifndef __clang__ ++#error Not clang ++#endif ++ ], ++ [], ++ clang_target_cv_working=yes, clang_target_cv_working=no)]) ++ CC="$saved_CC" ++ plugin_file= ++ if test $clang_target_cv_working = yes; then ++ AC_MSG_CHECKING([for clang plugin file for target]) ++ plugin_names="LLVMgold.so" ++ dnl Check if the host compiler is used. ++ for plugin in $plugin_names; do ++ plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ GCC_TARGET_TOOL(llvm-config, LLVM_CONFIG_FOR_TARGET, LLVM_CONFIG) ++ if test "$?" != 0; then ++ AC_MSG_ERROR([Required target tool 'llvm-config' not found.]) ++ fi ++ clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ plugin_file= ++ done ++ if test -n $plugin_file; then ++ AC_MSG_RESULT($plugin_file) ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ fi ++ $1="$plugin_file" ++]) +diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 +index c30cfdd8fad..687af3e7c17 100644 +--- a/config/gcc-plugin.m4 ++++ b/config/gcc-plugin.m4 +@@ -169,3 +169,46 @@ else + AC_MSG_RESULT([no]) + fi + ]) ++ ++dnl ++dnl ++dnl GCC_PLUGIN_OPTION_FOR_TARGET ++dnl (SHELL-CODE_HANDLER) ++dnl ++AC_DEFUN([GCC_PLUGIN_OPTION_FOR_TARGET],[dnl ++COMPILER_FOR_TARGET="${CC_FOR_TARGET}" ++dnl Check if the host compiler is used. ++if test x${COMPILER_FOR_TARGET} = x"\$(CC)"; then ++ COMPILER_FOR_TARGET="$CC" ++fi ++saved_CC="$CC" ++CC="$COMPILER_FOR_TARGET" ++AC_CACHE_CHECK([for gcc for target], gcc_target_cv_working, [ ++ AC_TRY_COMPILE( ++ [], ++ [], ++ gcc_target_cv_working=yes, ++ gcc_target_cv_working=no)]) ++CC="$saved_CC" ++AC_MSG_CHECKING([for -plugin option]) ++plugin_option= ++if test $gcc_target_cv_working = yes; then ++ plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" ++ for plugin in $plugin_names; do ++ plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-prog-name $plugin` ++ if test x$plugin_so = x$plugin; then ++ plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` ++ fi ++ if test x$plugin_so != x$plugin; then ++ plugin_option="--plugin $plugin_so" ++ break ++ fi ++ done ++fi ++if test -n "$plugin_option"; then ++ $1="$plugin_option" ++ AC_MSG_RESULT($plugin_option) ++else ++ AC_MSG_RESULT([no]) ++fi ++]) +diff --git a/configure b/configure +index 549aae7f3e3..a960918dcf6 100755 +--- a/configure ++++ b/configure +@@ -596,6 +596,10 @@ MAINTAINER_MODE_TRUE + COMPILER_NM_FOR_TARGET + COMPILER_LD_FOR_TARGET + COMPILER_AS_FOR_TARGET ++RANLIB_PLUGIN_OPTION_FOR_TARGET ++NM_PLUGIN_OPTION_FOR_TARGET ++AR_PLUGIN_OPTION_FOR_TARGET ++LLVM_CONFIG_FOR_TARGET + FLAGS_FOR_TARGET + RAW_CXX_FOR_TARGET + WINDMC_FOR_TARGET +@@ -621,7 +625,12 @@ GCC_FOR_TARGET + CXX_FOR_TARGET + CC_FOR_TARGET + RANLIB_PLUGIN_OPTION ++NM_PLUGIN_OPTION + AR_PLUGIN_OPTION ++LLVM_CONFIG ++EGREP ++GREP ++CPP + PKG_CONFIG_PATH + GDCFLAGS + READELF +@@ -893,6 +902,7 @@ OBJCOPY + OBJDUMP + OTOOL + READELF ++CPP + CC_FOR_TARGET + CXX_FOR_TARGET + GCC_FOR_TARGET +@@ -1693,6 +1703,7 @@ Some influential environment variables: + OBJDUMP OBJDUMP for the host + OTOOL OTOOL for the host + READELF READELF for the host ++ CPP C preprocessor + CC_FOR_TARGET + CC for the target + CXX_FOR_TARGET +@@ -1985,6 +1996,43 @@ fi + as_fn_set_status $ac_retval + + } # ac_fn_c_try_link ++ ++# ac_fn_c_try_cpp LINENO ++# ---------------------- ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } > conftest.i && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_cpp + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. +@@ -14221,7 +14269,529 @@ fi + GDCFLAGS=${GDCFLAGS-${CFLAGS}} + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong PLUGIN_OPTION with clang. ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++$as_echo_n "checking how to run the C preprocessor... " >&6; } ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++ if ${ac_cv_prog_CPP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Double quotes because CPP needs to be expanded ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" ++ do ++ ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ # <limits.h> exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ break ++fi ++ ++ done ++ ac_cv_prog_CPP=$CPP ++ ++fi ++ CPP=$ac_cv_prog_CPP ++else ++ ac_cv_prog_CPP=$CPP ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++$as_echo "$CPP" >&6; } ++ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ # <limits.h> exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 ++$as_echo_n "checking for grep that handles long lines and -e... " >&6; } ++if ${ac_cv_path_GREP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -z "$GREP"; then ++ ac_path_GREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in grep ggrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" ++ as_fn_executable_p "$ac_path_GREP" || continue ++# Check for GNU ac_path_GREP and select it if it is found. ++ # Check for GNU $ac_path_GREP ++case `"$ac_path_GREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'GREP' >> "conftest.nl" ++ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_GREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_GREP="$ac_path_GREP" ++ ac_path_GREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_GREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_GREP"; then ++ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_GREP=$GREP ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 ++$as_echo "$ac_cv_path_GREP" >&6; } ++ GREP="$ac_cv_path_GREP" ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 ++$as_echo_n "checking for egrep... " >&6; } ++if ${ac_cv_path_EGREP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 ++ then ac_cv_path_EGREP="$GREP -E" ++ else ++ if test -z "$EGREP"; then ++ ac_path_EGREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in egrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" ++ as_fn_executable_p "$ac_path_EGREP" || continue ++# Check for GNU ac_path_EGREP and select it if it is found. ++ # Check for GNU $ac_path_EGREP ++case `"$ac_path_EGREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'EGREP' >> "conftest.nl" ++ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_EGREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_EGREP="$ac_path_EGREP" ++ ac_path_EGREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_EGREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_EGREP"; then ++ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_EGREP=$EGREP ++fi ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 ++$as_echo "$ac_cv_path_EGREP" >&6; } ++ EGREP="$ac_cv_path_EGREP" ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 ++$as_echo_n "checking for clang... " >&6; } ++if ${clang_cv_is_clang+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef __clang__ ++ yes ++#endif ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "yes" >/dev/null 2>&1; then : ++ clang_cv_is_clang=yes ++else ++ clang_cv_is_clang=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 ++$as_echo "$clang_cv_is_clang" >&6; } ++ plugin_file= ++ if test $clang_cv_is_clang = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 ++$as_echo_n "checking for clang plugin file... " >&6; } ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$LLVM_CONFIG"; then ++ ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG ++if test -n "$LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 ++$as_echo "$LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_LLVM_CONFIG"; then ++ ac_ct_LLVM_CONFIG=$LLVM_CONFIG ++ # Extract the first word of "llvm-config", so it can be a program name with args. ++set dummy llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_LLVM_CONFIG"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG ++if test -n "$ac_ct_LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 ++$as_echo "$ac_ct_LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_LLVM_CONFIG" = x; then ++ LLVM_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ LLVM_CONFIG=$ac_ct_LLVM_CONFIG ++ fi ++else ++ LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" ++fi ++ ++ if test "$?" != 0; then ++ as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 ++ fi ++ clang_lib_dir=`$LLVM_CONFIG --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ fi ++ done ++ if test -z $plugin_file; then ++ as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 ++ fi ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++ if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++ fi ++ plugin_option="--plugin $plugin_file" ++ touch conftest.c ++ ${AR} $plugin_option rc conftest.a conftest.c ++ if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_file= ++ fi ++ rm -f conftest.* ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 ++$as_echo "$plugin_file" >&6; } ++ fi ++ PLUGIN_FILE="$plugin_file" ++ ++if test -n "$PLUGIN_FILE"; then ++ PLUGIN_OPTION="--plugin $PLUGIN_FILE" ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 + $as_echo_n "checking for -plugin option... " >&6; } + + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +@@ -14348,12 +14918,17 @@ else + $as_echo "no" >&6; } + fi + ++fi + AR_PLUGIN_OPTION= ++NM_PLUGIN_OPTION= + RANLIB_PLUGIN_OPTION= + if test -n "$PLUGIN_OPTION"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR_PLUGIN_OPTION="$PLUGIN_OPTION" + fi ++ if $NM --help 2>&1 | grep -q "\--plugin"; then ++ NM_PLUGIN_OPTION="$PLUGIN_OPTION" ++ fi + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" + fi +@@ -14361,6 +14936,7 @@ fi + + + ++ + # Target tools. + + # Check whether --with-build-time-tools was given. +@@ -20024,6 +20600,182 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} + RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} + NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} + ++# Try CLANG_PLUGIN_FILE_FOR_TARGET first since GCC_PLUGIN_OPTION_FOR_TARGET ++# may return the wrong PLUGIN_OPTION_FOR_TARGET with clang. ++ COMPILER_FOR_TARGET="${CC_FOR_TARGET}" ++ if test x${COMPILER_FOR_TARGET} = x"\$(CC)"; then ++ COMPILER_FOR_TARGET="$CC" ++ fi ++ saved_CC="$CC" ++ CC="$COMPILER_FOR_TARGET" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang for target" >&5 ++$as_echo_n "checking for clang for target... " >&6; } ++if ${clang_target_cv_working+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifndef __clang__ ++#error Not clang ++#endif ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ clang_target_cv_working=yes ++else ++ clang_target_cv_working=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_target_cv_working" >&5 ++$as_echo "$clang_target_cv_working" >&6; } ++ CC="$saved_CC" ++ plugin_file= ++ if test $clang_target_cv_working = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file for target" >&5 ++$as_echo_n "checking for clang plugin file for target... " >&6; } ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target llvm-config" >&5 ++$as_echo_n "checking where to find the target llvm-config... " >&6; } ++if test "x${build}" != "x${host}" ; then ++ if expr "x$LLVM_CONFIG_FOR_TARGET" : "x/" > /dev/null; then ++ # We already found the complete path ++ ac_dir=`dirname $LLVM_CONFIG_FOR_TARGET` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 ++$as_echo "pre-installed in $ac_dir" >&6; } ++ else ++ # Canadian cross, just use what we found ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 ++$as_echo "pre-installed" >&6; } ++ fi ++else ++ if expr "x$LLVM_CONFIG_FOR_TARGET" : "x/" > /dev/null; then ++ # We already found the complete path ++ ac_dir=`dirname $LLVM_CONFIG_FOR_TARGET` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 ++$as_echo "pre-installed in $ac_dir" >&6; } ++ elif test "x$target" = "x$host"; then ++ # We can use an host tool ++ LLVM_CONFIG_FOR_TARGET='$(LLVM_CONFIG)' ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5 ++$as_echo "host tool" >&6; } ++ else ++ # We need a cross tool ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 ++$as_echo "pre-installed" >&6; } ++ fi ++fi ++ ++ if test "$?" != 0; then ++ as_fn_error $? "Required target tool 'llvm-config' not found." "$LINENO" 5 ++ fi ++ clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ plugin_file= ++ done ++ if test -n $plugin_file; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 ++$as_echo "$plugin_file" >&6; } ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ fi ++ fi ++ PLUGIN_FILE_FOR_TARGET="$plugin_file" ++ ++if test -n "$PLUGIN_FILE_FOR_TARGET"; then ++ PLUGIN_OPTION_FOR_TARGET="--plugin $PLUGIN_FILE_FOR_TARGET" ++else ++ COMPILER_FOR_TARGET="${CC_FOR_TARGET}" ++if test x${COMPILER_FOR_TARGET} = x"\$(CC)"; then ++ COMPILER_FOR_TARGET="$CC" ++fi ++saved_CC="$CC" ++CC="$COMPILER_FOR_TARGET" ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc for target" >&5 ++$as_echo_n "checking for gcc for target... " >&6; } ++if ${gcc_target_cv_working+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ gcc_target_cv_working=yes ++else ++ gcc_target_cv_working=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_target_cv_working" >&5 ++$as_echo "$gcc_target_cv_working" >&6; } ++CC="$saved_CC" ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 ++$as_echo_n "checking for -plugin option... " >&6; } ++plugin_option= ++if test $gcc_target_cv_working = yes; then ++ plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" ++ for plugin in $plugin_names; do ++ plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-prog-name $plugin` ++ if test x$plugin_so = x$plugin; then ++ plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` ++ fi ++ if test x$plugin_so != x$plugin; then ++ plugin_option="--plugin $plugin_so" ++ break ++ fi ++ done ++fi ++if test -n "$plugin_option"; then ++ PLUGIN_OPTION_FOR_TARGET="$plugin_option" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 ++$as_echo "$plugin_option" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++fi ++if test -n "$PLUGIN_OPTION_FOR_TARGET"; then ++ AR_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++ NM_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++ RANLIB_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++else ++ AR_PLUGIN_OPTION_FOR_TARGET= ++ NM_PLUGIN_OPTION_FOR_TARGET= ++ RANLIB_PLUGIN_OPTION_FOR_TARGET= ++fi ++ ++ ++ ++ + # When building target libraries, except in a Canadian cross, we use + # the same toolchain as the compiler we just built. + COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)' +diff --git a/configure.ac b/configure.ac +index 15dccb65114..49ac5d60514 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -24,6 +24,7 @@ m4_include(config/override.m4) + m4_include(config/proginstall.m4) + m4_include(config/elf.m4) + m4_include(config/ax_cxx_compile_stdcxx.m4) ++m4_include(config/clang-plugin.m4) + m4_include(config/gcc-plugin.m4) + m4_include([libtool.m4]) + m4_include([ltoptions.m4]) +@@ -4016,18 +4017,30 @@ AC_SUBST(GDCFLAGS) + GDCFLAGS=${GDCFLAGS-${CFLAGS}} + AC_SUBST(PKG_CONFIG_PATH) + +-GCC_PLUGIN_OPTION(PLUGIN_OPTION) ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong PLUGIN_OPTION with clang. ++CLANG_PLUGIN_FILE(PLUGIN_FILE) ++if test -n "$PLUGIN_FILE"; then ++ PLUGIN_OPTION="--plugin $PLUGIN_FILE" ++else ++ GCC_PLUGIN_OPTION(PLUGIN_OPTION) ++fi + AR_PLUGIN_OPTION= ++NM_PLUGIN_OPTION= + RANLIB_PLUGIN_OPTION= + if test -n "$PLUGIN_OPTION"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR_PLUGIN_OPTION="$PLUGIN_OPTION" + fi ++ if $NM --help 2>&1 | grep -q "\--plugin"; then ++ NM_PLUGIN_OPTION="$PLUGIN_OPTION" ++ fi + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" + fi + fi + AC_SUBST(AR_PLUGIN_OPTION) ++AC_SUBST(NM_PLUGIN_OPTION) + AC_SUBST(RANLIB_PLUGIN_OPTION) + + # Target tools. +@@ -4122,6 +4135,27 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} + RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} + NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} + ++# Try CLANG_PLUGIN_FILE_FOR_TARGET first since GCC_PLUGIN_OPTION_FOR_TARGET ++# may return the wrong PLUGIN_OPTION_FOR_TARGET with clang. ++CLANG_PLUGIN_FILE_FOR_TARGET(PLUGIN_FILE_FOR_TARGET) ++if test -n "$PLUGIN_FILE_FOR_TARGET"; then ++ PLUGIN_OPTION_FOR_TARGET="--plugin $PLUGIN_FILE_FOR_TARGET" ++else ++ GCC_PLUGIN_OPTION_FOR_TARGET(PLUGIN_OPTION_FOR_TARGET) ++fi ++if test -n "$PLUGIN_OPTION_FOR_TARGET"; then ++ AR_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++ NM_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++ RANLIB_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" ++else ++ AR_PLUGIN_OPTION_FOR_TARGET= ++ NM_PLUGIN_OPTION_FOR_TARGET= ++ RANLIB_PLUGIN_OPTION_FOR_TARGET= ++fi ++AC_SUBST(AR_PLUGIN_OPTION_FOR_TARGET) ++AC_SUBST(NM_PLUGIN_OPTION_FOR_TARGET) ++AC_SUBST(RANLIB_PLUGIN_OPTION_FOR_TARGET) ++ + # When building target libraries, except in a Canadian cross, we use + # the same toolchain as the compiler we just built. + COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)' +diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in +index 9a9b8a441dd..43d9bb54260 100644 +--- a/libbacktrace/Makefile.in ++++ b/libbacktrace/Makefile.in +@@ -171,7 +171,9 @@ TESTS = $(am__append_4) $(MAKETESTS) $(am__EXEEXT_17) + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/../config/cet.m4 \ ++ $(top_srcdir)/../config/clang-plugin.m4 \ + $(top_srcdir)/../config/enable.m4 \ ++ $(top_srcdir)/../config/gcc-plugin.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ +@@ -904,6 +906,7 @@ LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ + LIPO = @LIPO@ ++LLVM_CONFIG = @LLVM_CONFIG@ + LN_S = @LN_S@ + LTLIBOBJS = @LTLIBOBJS@ + MAINT = @MAINT@ +diff --git a/libbacktrace/aclocal.m4 b/libbacktrace/aclocal.m4 +index 528e6173930..df92f64c55b 100644 +--- a/libbacktrace/aclocal.m4 ++++ b/libbacktrace/aclocal.m4 +@@ -853,7 +853,9 @@ AC_SUBST([am__untar]) + ]) # _AM_PROG_TAR + + m4_include([../config/cet.m4]) ++m4_include([../config/clang-plugin.m4]) + m4_include([../config/enable.m4]) ++m4_include([../config/gcc-plugin.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) +diff --git a/libbacktrace/configure b/libbacktrace/configure +index f1b68d6731f..b956afe8c34 100755 +--- a/libbacktrace/configure ++++ b/libbacktrace/configure +@@ -691,6 +691,7 @@ LIPO + NMEDIT + DSYMUTIL + AR ++LLVM_CONFIG + OBJDUMP + LN_S + NM +@@ -6605,8 +6606,266 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + +-plugin_option= ++ ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong plugin_option with clang. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 ++$as_echo_n "checking for clang... " >&6; } ++if ${clang_cv_is_clang+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef __clang__ ++ yes ++#endif ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "yes" >/dev/null 2>&1; then : ++ clang_cv_is_clang=yes ++else ++ clang_cv_is_clang=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 ++$as_echo "$clang_cv_is_clang" >&6; } ++ plugin_file= ++ if test $clang_cv_is_clang = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 ++$as_echo_n "checking for clang plugin file... " >&6; } ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$LLVM_CONFIG"; then ++ ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG ++if test -n "$LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 ++$as_echo "$LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_LLVM_CONFIG"; then ++ ac_ct_LLVM_CONFIG=$LLVM_CONFIG ++ # Extract the first word of "llvm-config", so it can be a program name with args. ++set dummy llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_LLVM_CONFIG"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG ++if test -n "$ac_ct_LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 ++$as_echo "$ac_ct_LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_LLVM_CONFIG" = x; then ++ LLVM_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ LLVM_CONFIG=$ac_ct_LLVM_CONFIG ++ fi ++else ++ LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" ++fi ++ ++ if test "$?" != 0; then ++ as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 ++ fi ++ clang_lib_dir=`$LLVM_CONFIG --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ fi ++ done ++ if test -z $plugin_file; then ++ as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 ++ fi ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++ if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++ fi ++ plugin_option="--plugin $plugin_file" ++ touch conftest.c ++ ${AR} $plugin_option rc conftest.a conftest.c ++ if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_file= ++ fi ++ rm -f conftest.* ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 ++$as_echo "$plugin_file" >&6; } ++ fi ++ plugin_file="$plugin_file" ++ ++if test -n "$plugin_file"; then ++ plugin_option="--plugin $plugin_file" ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 ++$as_echo_n "checking for -plugin option... " >&6; } ++ + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" ++plugin_option= + for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then +@@ -6617,7 +6876,119 @@ for plugin in $plugin_names; do + break + fi + done ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS + ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++fi ++touch conftest.c ++${AR} $plugin_option rc conftest.a conftest.c ++if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_option= ++fi ++rm -f conftest.* ++if test -n "$plugin_option"; then ++ plugin_option="$plugin_option" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 ++$as_echo "$plugin_option" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. + set dummy ${ac_tool_prefix}ar; ac_word=$2 +@@ -6712,17 +7083,15 @@ fi + + test -z "$AR" && AR=ar + if test -n "$plugin_option"; then +- if $AR --help 2>&1 | grep -q "\--plugin"; then +- touch conftest.c +- $AR $plugin_option rc conftest.a conftest.c +- if test "$?" != 0; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} +- else ++ case "$AR" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +- rm -f conftest.* +- fi ++ ;; ++ esac + fi + test -z "$AR_FLAGS" && AR_FLAGS=cru + +@@ -6929,9 +7298,15 @@ fi + + test -z "$RANLIB" && RANLIB=: + if test -n "$plugin_option" && test "$RANLIB" != ":"; then +- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then +- RANLIB="$RANLIB $plugin_option" +- fi ++ case "$RANLIB" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then ++ RANLIB="$RANLIB $plugin_option" ++ fi ++ ;; ++ esac + fi + + +@@ -11635,7 +12010,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11638 "configure" ++#line 12013 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11741,7 +12116,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11744 "configure" ++#line 12119 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 +index 364fb6bc3b4..5151f5fee18 100644 +--- a/libiberty/aclocal.m4 ++++ b/libiberty/aclocal.m4 +@@ -14,6 +14,7 @@ + m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) + m4_include([../config/acx.m4]) + m4_include([../config/cet.m4]) ++m4_include([../config/clang-plugin.m4]) + m4_include([../config/enable.m4]) + m4_include([../config/gcc-plugin.m4]) + m4_include([../config/hwcaps.m4]) +diff --git a/libiberty/configure b/libiberty/configure +index 02fbaabe89e..8996b6ea5e1 100755 +--- a/libiberty/configure ++++ b/libiberty/configure +@@ -640,6 +640,9 @@ INSTALL_PROGRAM + OUTPUT_OPTION + NO_MINUS_C_MINUS_O + ac_libiberty_warn_cflags ++RANLIB_PLUGIN_OPTION ++AR_PLUGIN_OPTION ++LLVM_CONFIG + EGREP + GREP + CPP +@@ -650,8 +653,6 @@ CPPFLAGS + LDFLAGS + CFLAGS + CC +-RANLIB_PLUGIN_OPTION +-AR_PLUGIN_OPTION + RANLIB + AR + host_os +@@ -2947,144 +2948,6 @@ else + fi + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +-$as_echo_n "checking for -plugin option... " >&6; } +- +-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +-plugin_option= +-for plugin in $plugin_names; do +- plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` +- if test x$plugin_so = x$plugin; then +- plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` +- fi +- if test x$plugin_so != x$plugin; then +- plugin_option="--plugin $plugin_so" +- break +- fi +-done +-if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_AR+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- if test -n "$AR"; then +- ac_cv_prog_AR="$AR" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +-fi +-fi +-AR=$ac_cv_prog_AR +-if test -n "$AR"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +-$as_echo "$AR" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +-fi +-if test -z "$ac_cv_prog_AR"; then +- ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_ac_ct_AR+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- if test -n "$ac_ct_AR"; then +- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_AR="ar" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +-fi +-fi +-ac_ct_AR=$ac_cv_prog_ac_ct_AR +-if test -n "$ac_ct_AR"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +-$as_echo "$ac_ct_AR" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- if test "x$ac_ct_AR" = x; then +- AR="" +- else +- case $cross_compiling:$ac_tool_warned in +-yes:) +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +-ac_tool_warned=yes ;; +-esac +- AR=$ac_ct_AR +- fi +-else +- AR="$ac_cv_prog_AR" +-fi +- +-if test "${AR}" = "" ; then +- as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 +-fi +-touch conftest.c +-${AR} $plugin_option rc conftest.a conftest.c +-if test "$?" != 0; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} +- plugin_option= +-fi +-rm -f conftest.* +-if test -n "$plugin_option"; then +- PLUGIN_OPTION="$plugin_option" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +-$as_echo "$plugin_option" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +-if test -n "$PLUGIN_OPTION"; then +- if $AR --help 2>&1 | grep -q "\--plugin"; then +- AR_PLUGIN_OPTION="$PLUGIN_OPTION" +- +- fi +- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then +- RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" +- +- fi +-fi +- + # Add --enable-multilib to configure. + # Default to --enable-multilib + # Check whether --enable-multilib was given. +@@ -4616,6 +4479,411 @@ fi + + ac_c_preproc_warn_flag=yes + ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong PLUGIN_OPTION with clang. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 ++$as_echo_n "checking for clang... " >&6; } ++if ${clang_cv_is_clang+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef __clang__ ++ yes ++#endif ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "yes" >/dev/null 2>&1; then : ++ clang_cv_is_clang=yes ++else ++ clang_cv_is_clang=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 ++$as_echo "$clang_cv_is_clang" >&6; } ++ plugin_file= ++ if test $clang_cv_is_clang = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 ++$as_echo_n "checking for clang plugin file... " >&6; } ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$LLVM_CONFIG"; then ++ ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG ++if test -n "$LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 ++$as_echo "$LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_LLVM_CONFIG"; then ++ ac_ct_LLVM_CONFIG=$LLVM_CONFIG ++ # Extract the first word of "llvm-config", so it can be a program name with args. ++set dummy llvm-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_LLVM_CONFIG"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG ++if test -n "$ac_ct_LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 ++$as_echo "$ac_ct_LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_LLVM_CONFIG" = x; then ++ LLVM_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ LLVM_CONFIG=$ac_ct_LLVM_CONFIG ++ fi ++else ++ LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" ++fi ++ ++ if test "$?" != 0; then ++ as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 ++ fi ++ clang_lib_dir=`$LLVM_CONFIG --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ fi ++ done ++ if test -z $plugin_file; then ++ as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 ++ fi ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++ if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++ fi ++ plugin_option="--plugin $plugin_file" ++ touch conftest.c ++ ${AR} $plugin_option rc conftest.a conftest.c ++ if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_file= ++ fi ++ rm -f conftest.* ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 ++$as_echo "$plugin_file" >&6; } ++ fi ++ PLUGIN_FILE="$plugin_file" ++ ++if test -n "$PLUGIN_FILE"; then ++ PLUGIN_OPTION="--plugin $PLUGIN_FILE" ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 ++$as_echo_n "checking for -plugin option... " >&6; } ++ ++plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" ++plugin_option= ++for plugin in $plugin_names; do ++ plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` ++ if test x$plugin_so = x$plugin; then ++ plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` ++ fi ++ if test x$plugin_so != x$plugin; then ++ plugin_option="--plugin $plugin_so" ++ break ++ fi ++done ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++fi ++touch conftest.c ++${AR} $plugin_option rc conftest.a conftest.c ++if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_option= ++fi ++rm -f conftest.* ++if test -n "$plugin_option"; then ++ PLUGIN_OPTION="$plugin_option" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 ++$as_echo "$plugin_option" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++fi ++if test -n "$PLUGIN_OPTION"; then ++ case "$AR" in ++ *"$PLUGIN_OPTION"*) ++ ;; ++ *) ++ if $AR --help 2>&1 | grep -q "\--plugin"; then ++ AR_PLUGIN_OPTION="$PLUGIN_OPTION" ++ ++ fi ++ ;; ++ esac ++ case "$RANLIB" in ++ *"$PLUGIN_OPTION"*) ++ ;; ++ *) ++ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then ++ RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" ++ ++ fi ++ ;; ++ esac ++fi ++ + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +diff --git a/libiberty/configure.ac b/libiberty/configure.ac +index 3de5eca0df2..199fa192fe4 100644 +--- a/libiberty/configure.ac ++++ b/libiberty/configure.ac +@@ -114,18 +114,6 @@ dnl to call AC_CHECK_PROG. + AC_CHECK_TOOL(AR, ar) + AC_CHECK_TOOL(RANLIB, ranlib, :) + +-GCC_PLUGIN_OPTION(PLUGIN_OPTION) +-if test -n "$PLUGIN_OPTION"; then +- if $AR --help 2>&1 | grep -q "\--plugin"; then +- AR_PLUGIN_OPTION="$PLUGIN_OPTION" +- AC_SUBST(AR_PLUGIN_OPTION) +- fi +- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then +- RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" +- AC_SUBST(RANLIB_PLUGIN_OPTION) +- fi +-fi +- + dnl When switching to automake, replace the following with AM_ENABLE_MULTILIB. + # Add --enable-multilib to configure. + # Default to --enable-multilib +@@ -176,6 +164,37 @@ AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE + AC_PROG_CPP_WERROR + ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong PLUGIN_OPTION with clang. ++CLANG_PLUGIN_FILE(PLUGIN_FILE) ++if test -n "$PLUGIN_FILE"; then ++ PLUGIN_OPTION="--plugin $PLUGIN_FILE" ++else ++ GCC_PLUGIN_OPTION(PLUGIN_OPTION) ++fi ++if test -n "$PLUGIN_OPTION"; then ++ case "$AR" in ++ *"$PLUGIN_OPTION"*) ++ ;; ++ *) ++ if $AR --help 2>&1 | grep -q "\--plugin"; then ++ AR_PLUGIN_OPTION="$PLUGIN_OPTION" ++ AC_SUBST(AR_PLUGIN_OPTION) ++ fi ++ ;; ++ esac ++ case "$RANLIB" in ++ *"$PLUGIN_OPTION"*) ++ ;; ++ *) ++ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then ++ RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" ++ AC_SUBST(RANLIB_PLUGIN_OPTION) ++ fi ++ ;; ++ esac ++fi ++ + ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wc++-compat \ + -Wstrict-prototypes \ + -Wshadow=local], [ac_libiberty_warn_cflags]) +diff --git a/libtool.m4 b/libtool.m4 +index add2d4a1e23..0e639dc98b2 100644 +--- a/libtool.m4 ++++ b/libtool.m4 +@@ -1372,32 +1372,27 @@ need_locks="$enable_libtool_lock" + # _LT_CMD_OLD_ARCHIVE + # ------------------- + m4_defun([_LT_CMD_OLD_ARCHIVE], +-[plugin_option= +-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +-for plugin in $plugin_names; do +- plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` +- if test x$plugin_so = x$plugin; then +- plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` +- fi +- if test x$plugin_so != x$plugin; then +- plugin_option="--plugin $plugin_so" +- break +- fi +-done +- ++[ ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong plugin_option with clang. ++CLANG_PLUGIN_FILE(plugin_file) ++if test -n "$plugin_file"; then ++ plugin_option="--plugin $plugin_file" ++else ++ GCC_PLUGIN_OPTION(plugin_option) ++fi + AC_CHECK_TOOL(AR, ar, false) + test -z "$AR" && AR=ar + if test -n "$plugin_option"; then +- if $AR --help 2>&1 | grep -q "\--plugin"; then +- touch conftest.c +- $AR $plugin_option rc conftest.a conftest.c +- if test "$?" != 0; then +- AC_MSG_WARN([Failed: $AR $plugin_option rc]) +- else ++ case "$AR" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +- rm -f conftest.* +- fi ++ ;; ++ esac + fi + test -z "$AR_FLAGS" && AR_FLAGS=cru + _LT_DECL([], [AR], [1], [The archiver]) +@@ -1410,9 +1405,15 @@ _LT_DECL([], [STRIP], [1], [A symbol stripping program]) + AC_CHECK_TOOL(RANLIB, ranlib, :) + test -z "$RANLIB" && RANLIB=: + if test -n "$plugin_option" && test "$RANLIB" != ":"; then +- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then +- RANLIB="$RANLIB $plugin_option" +- fi ++ case "$RANLIB" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then ++ RANLIB="$RANLIB $plugin_option" ++ fi ++ ;; ++ esac + fi + _LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) +diff --git a/zlib/Makefile.in b/zlib/Makefile.in +index 80fe3b69116..23b5afe576d 100644 +--- a/zlib/Makefile.in ++++ b/zlib/Makefile.in +@@ -93,8 +93,10 @@ target_triplet = @target@ + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/../config/cet.m4 \ ++ $(top_srcdir)/../config/clang-plugin.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/enable.m4 \ ++ $(top_srcdir)/../config/gcc-plugin.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ +@@ -305,6 +307,7 @@ LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ + LIPO = @LIPO@ ++LLVM_CONFIG = @LLVM_CONFIG@ + LN_S = @LN_S@ + LTLIBOBJS = @LTLIBOBJS@ + MAINT = @MAINT@ +diff --git a/zlib/aclocal.m4 b/zlib/aclocal.m4 +index f3676e70476..b8f66c52326 100644 +--- a/zlib/aclocal.m4 ++++ b/zlib/aclocal.m4 +@@ -1168,8 +1168,10 @@ AC_SUBST([am__untar]) + ]) # _AM_PROG_TAR + + m4_include([../config/cet.m4]) ++m4_include([../config/clang-plugin.m4]) + m4_include([../config/depstand.m4]) + m4_include([../config/enable.m4]) ++m4_include([../config/gcc-plugin.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) +diff --git a/zlib/configure b/zlib/configure +index ac76e60ff33..9aae6355102 100755 +--- a/zlib/configure ++++ b/zlib/configure +@@ -643,7 +643,6 @@ toolexeclibdir + toolexecdir + ENABLE_DARWIN_AT_RPATH_FALSE + ENABLE_DARWIN_AT_RPATH_TRUE +-CPP + OTOOL64 + OTOOL + LIPO +@@ -651,6 +650,8 @@ NMEDIT + DSYMUTIL + RANLIB + AR ++LLVM_CONFIG ++CPP + OBJDUMP + LN_S + NM +@@ -1573,6 +1574,43 @@ fi + + } # ac_fn_c_try_compile + ++# ac_fn_c_try_cpp LINENO ++# ---------------------- ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } > conftest.i && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_cpp ++ + # ac_fn_c_try_link LINENO + # ----------------------- + # Try to link conftest.$ac_ext, and return whether this succeeded. +@@ -1650,43 +1688,6 @@ $as_echo "$ac_res" >&6; } + + } # ac_fn_c_check_header_compile + +-# ac_fn_c_try_cpp LINENO +-# ---------------------- +-# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +-ac_fn_c_try_cpp () +-{ +- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- if { { ac_try="$ac_cpp conftest.$ac_ext" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 +- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err +- ac_status=$? +- if test -s conftest.err; then +- grep -v '^ *+' conftest.err >conftest.er1 +- cat conftest.er1 >&5 +- mv -f conftest.er1 conftest.err +- fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } > conftest.i && { +- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || +- test ! -s conftest.err +- }; then : +- ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_retval=1 +-fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +- as_fn_set_status $ac_retval +- +-} # ac_fn_c_try_cpp +- + # ac_fn_c_try_run LINENO + # ---------------------- + # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +@@ -5523,29 +5524,190 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + +-plugin_option= +-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +-for plugin in $plugin_names; do +- plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` +- if test x$plugin_so = x$plugin; then +- plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` +- fi +- if test x$plugin_so != x$plugin; then +- plugin_option="--plugin $plugin_so" +- break +- fi ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++$as_echo_n "checking how to run the C preprocessor... " >&6; } ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++ if ${ac_cv_prog_CPP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Double quotes because CPP needs to be expanded ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" ++ do ++ ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ # <limits.h> exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ + done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ break ++fi + +-if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ done ++ ac_cv_prog_CPP=$CPP ++ ++fi ++ CPP=$ac_cv_prog_CPP ++else ++ ac_cv_prog_CPP=$CPP ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++$as_echo "$CPP" >&6; } ++ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ # <limits.h> exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++ ++# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the ++# wrong plugin_option with clang. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 ++$as_echo_n "checking for clang... " >&6; } ++if ${clang_cv_is_clang+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef __clang__ ++ yes ++#endif ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "yes" >/dev/null 2>&1; then : ++ clang_cv_is_clang=yes ++else ++ clang_cv_is_clang=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 ++$as_echo "$clang_cv_is_clang" >&6; } ++ plugin_file= ++ if test $clang_cv_is_clang = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 ++$as_echo_n "checking for clang plugin file... " >&6; } ++ plugin_names="LLVMgold.so" ++ for plugin in $plugin_names; do ++ plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` ++ if test x$plugin_file = x$plugin; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_AR+:} false; then : ++if ${ac_cv_prog_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 + else +- if test -n "$AR"; then +- ac_cv_prog_AR="$AR" # Let the user override the test. ++ if test -n "$LLVM_CONFIG"; then ++ ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH +@@ -5554,7 +5716,7 @@ do + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -5564,10 +5726,10 @@ IFS=$as_save_IFS + + fi + fi +-AR=$ac_cv_prog_AR +-if test -n "$AR"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +-$as_echo "$AR" >&6; } ++LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG ++if test -n "$LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 ++$as_echo "$LLVM_CONFIG" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } +@@ -5575,17 +5737,124 @@ fi + + + fi +-if test -z "$ac_cv_prog_AR"; then +- ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++if test -z "$ac_cv_prog_LLVM_CONFIG"; then ++ ac_ct_LLVM_CONFIG=$LLVM_CONFIG ++ # Extract the first word of "llvm-config", so it can be a program name with args. ++set dummy llvm-config; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_ac_ct_AR+:} false; then : ++if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 + else +- if test -n "$ac_ct_AR"; then +- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++ if test -n "$ac_ct_LLVM_CONFIG"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG ++if test -n "$ac_ct_LLVM_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 ++$as_echo "$ac_ct_LLVM_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_LLVM_CONFIG" = x; then ++ LLVM_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ LLVM_CONFIG=$ac_ct_LLVM_CONFIG ++ fi ++else ++ LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" ++fi ++ ++ if test "$?" != 0; then ++ as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 ++ fi ++ clang_lib_dir=`$LLVM_CONFIG --libdir` ++ if test -f $clang_lib_dir/$plugin; then ++ plugin_file=$clang_lib_dir/$plugin ++ fi ++ if test x$plugin_file != x$plugin; then ++ break; ++ fi ++ fi ++ done ++ if test -z $plugin_file; then ++ as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 ++ fi ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH +@@ -5614,7 +5883,7 @@ $as_echo "no" >&6; } + fi + + if test "x$ac_ct_AR" = x; then +- AR="false" ++ AR="" + else + case $cross_compiling:$ac_tool_warned in + yes:) +@@ -5628,19 +5897,257 @@ else + AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-if test -n "$plugin_option"; then +- if $AR --help 2>&1 | grep -q "\--plugin"; then ++ if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++ fi ++ plugin_option="--plugin $plugin_file" + touch conftest.c +- $AR $plugin_option rc conftest.a conftest.c ++ ${AR} $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 + $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} +- else +- AR="$AR $plugin_option" ++ plugin_file= + fi + rm -f conftest.* ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 ++$as_echo "$plugin_file" >&6; } ++ fi ++ plugin_file="$plugin_file" ++ ++if test -n "$plugin_file"; then ++ plugin_option="--plugin $plugin_file" ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 ++$as_echo_n "checking for -plugin option... " >&6; } ++ ++plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" ++plugin_option= ++for plugin in $plugin_names; do ++ plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` ++ if test x$plugin_so = x$plugin; then ++ plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` ++ fi ++ if test x$plugin_so != x$plugin; then ++ plugin_option="--plugin $plugin_so" ++ break ++ fi ++done ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR ++ fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++if test "${AR}" = "" ; then ++ as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 ++fi ++touch conftest.c ++${AR} $plugin_option rc conftest.a conftest.c ++if test "$?" != 0; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 ++$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} ++ plugin_option= ++fi ++rm -f conftest.* ++if test -n "$plugin_option"; then ++ plugin_option="$plugin_option" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 ++$as_echo "$plugin_option" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++fi ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AR=$ac_cv_prog_AR ++if test -n "$AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 ++$as_echo "$AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_AR"; then ++ ac_ct_AR=$AR ++ # Extract the first word of "ar", so it can be a program name with args. ++set dummy ar; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_AR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_AR"; then ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_AR="ar" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_AR=$ac_cv_prog_ac_ct_AR ++if test -n "$ac_ct_AR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 ++$as_echo "$ac_ct_AR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_AR" = x; then ++ AR="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ AR=$ac_ct_AR + fi ++else ++ AR="$ac_cv_prog_AR" ++fi ++ ++test -z "$AR" && AR=ar ++if test -n "$plugin_option"; then ++ case "$AR" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $AR --help 2>&1 | grep -q "\--plugin"; then ++ AR="$AR $plugin_option" ++ fi ++ ;; ++ esac + fi + test -z "$AR_FLAGS" && AR_FLAGS=cru + +@@ -5847,9 +6354,15 @@ fi + + test -z "$RANLIB" && RANLIB=: + if test -n "$plugin_option" && test "$RANLIB" != ":"; then +- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then +- RANLIB="$RANLIB $plugin_option" +- fi ++ case "$RANLIB" in ++ *"$plugin_option"*) ++ ;; ++ *) ++ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then ++ RANLIB="$RANLIB $plugin_option" ++ fi ++ ;; ++ esac + fi + + +@@ -7007,144 +7520,6 @@ $as_echo "$lt_cv_ld_force_load" >&6; } + ;; + esac + +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +-$as_echo_n "checking how to run the C preprocessor... " >&6; } +-# On Suns, sometimes $CPP names a directory. +-if test -n "$CPP" && test -d "$CPP"; then +- CPP= +-fi +-if test -z "$CPP"; then +- if ${ac_cv_prog_CPP+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- # Double quotes because CPP needs to be expanded +- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" +- do +- ac_preproc_ok=false +-for ac_c_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since +- # <limits.h> exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include <limits.h> +-#else +-# include <assert.h> +-#endif +- Syntax error +-_ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : +- +-else +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether nonexistent headers +- # can be detected and how. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include <ac_nonexistent.h> +-_ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : +- # Broken: success on invalid input. +-continue +-else +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : +- break +-fi +- +- done +- ac_cv_prog_CPP=$CPP +- +-fi +- CPP=$ac_cv_prog_CPP +-else +- ac_cv_prog_CPP=$CPP +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +-$as_echo "$CPP" >&6; } +-ac_preproc_ok=false +-for ac_c_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since +- # <limits.h> exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include <limits.h> +-#else +-# include <assert.h> +-#endif +- Syntax error +-_ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : +- +-else +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether nonexistent headers +- # can be detected and how. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include <ac_nonexistent.h> +-_ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : +- # Broken: success on invalid input. +-continue +-else +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : +- +-else +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details" "$LINENO" 5; } +-fi +- +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 + $as_echo_n "checking for ANSI C header files... " >&6; } + if ${ac_cv_header_stdc+:} false; then : +@@ -10853,7 +11228,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10856 "configure" ++#line 11231 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10959,7 +11334,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10962 "configure" ++#line 11337 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +-- +2.51.0 + diff --git a/16.0.0/gentoo/README.history b/16.0.0/gentoo/README.history index 3a58f30..65ab6ba 100644 --- a/16.0.0/gentoo/README.history +++ b/16.0.0/gentoo/README.history @@ -1,3 +1,8 @@ +15 ???? + + + 87_all_sync_toplevel-1.patch + + 88_all_sync_toplevel-2.patch + 14 7 September 2025 - 91_all_PR121699-mesa.patch
