303 Commits

Author SHA1 Message Date
Sam James
f5bee9f31b Sync top-level with GCC
This just brings in the following two changes:

commit 04df8fa9e73e612f978fff35a97841703b872f6c
Author:     Thomas Schwinge <tschwinge@baylibre.com>
AuthorDate: Tue Oct 21 09:46:32 2025 +0200
Commit:     Thomas Schwinge <tschwinge@baylibre.com>
CommitDate: Fri Oct 24 12:40:22 2025 +0200

    Simplify 'Makefile' dependencies for libatomic [PR81358]

    ...

commit e63cf4b130b86dd7dde1bf499d3d40faca10ea2e
Author:     Prathamesh Kulkarni <prathameshk@nvidia.com>
AuthorDate: Thu Oct 9 07:07:24 2025 +0000
Commit:     Prathamesh Kulkarni <prathameshk@nvidia.com>
CommitDate: Thu Oct 9 07:26:51 2025 +0000

    PR81358: Enable automatic linking of libatomic.

    ...

ChangeLog:

	* Makefile.def: Sync with GCC.
	* configure.ac: Ditto.
	* configure: Regenerate.
2025-11-03 09:53:04 +00:00
H.J. Lu
d114379fde Sync toplevel files from gcc
commit bab1b2488e2a01b311d584bbecbc6834194e30ed
Author: Nicolas Boulenguez <nicolas@debian.org>
Date:   Sun Jun 22 19:23:11 2025 +0200

    Ada: Introduce GNATMAKE_FOR_BUILD Makefile variable

    This gets rid of the hardcoded 'gnatmake' command used during the build.

commit 79091220da796a4b60561a7bf2e9e8f5e5276bc4
Author: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
Date:   Tue Jun 10 09:19:37 2025 +1000

    [AutoFDO] Fix profile bootstrap for x86_64

    This patch fixes profile bootstrap for x86_64 by special
    caseing cpu_type for x86_64 as it shares AUTO_PROFILE
    from i386.

commit fcb60292984fa7181ec91d7f81fd18549d1aaf39
Author: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
Date:   Thu May 29 08:47:19 2025 +1000

    [AUTOFDO] Fix autogen remake issue

    Fix autogen issue introduced by commit
    commit 86dc974cf30f926a014438a5fccdc9d41e26282b

commit 86dc974cf30f926a014438a5fccdc9d41e26282b
Author: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
Date:   Mon May 26 11:41:59 2025 +1000

    [AUTOFDO][AARCH64] Add support for profilebootstrap

    Add support for autoprofiledbootstrap in aarch64.
    This is similar to what is done for i386. Added
    gcc/config/aarch64/gcc-auto-profile for aarch64 profile
    creation.

    How to run:
    configure --with-build-config=bootstrap-lto
    make autoprofiledbootstrap

commit dff727b2c28c52e90e0bd61957d15f907494b245
Author: Stephanos Ioannidis <root@stephanos.io>
Date:   Wed May 21 17:28:36 2025 -0600

    [PATCH] configure: Always add pre-installed header directories to search path

    configure script was adding the target directory flags, including the
    '-B' flags for the executable prefix and the '-isystem' flags for the
    pre-installed header directories, to the target flags only for
    non-Canadian builds under the premise that the host binaries under the
    executable prefix will not be able to execute on the build system for
    Canadian builds.

    While that is true for the '-B' flags specifying the executable prefix,
    the '-isystem' flags specifying the pre-installed header directories are
    not affected by this and do not need special handling.

    This patch updates the configure script to always add the 'include' and
    'sys-include' pre-installed header directories to the target search
    path, in order to ensure that the availability of the pre-installed
    header directories in the search path is consistent across non-Canadian
    and Canadian builds.

    When '--with-headers' flag is specified, this effectively ensures that
    the libc headers, that are copied from the specified header directory to
    the sys-include directory, are used by libstdc++.

commit 6390fc86995fbd5239497cb9e1797a3af51d3936
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Tue Apr 22 13:47:17 2025 +0200

    cobol: Restrict COBOL to supported Linux arches [PR119217]

    The COBOL frontend is currently built on all x86_64 and aarch64 hosts
    although the code contains some Linux/glibc specifics that break the build
    e.g. on Solaris/amd64.

    Tested on Linux/x86_64 and Solaris/amd64.

commit 17ed44c96f6e5c0cc02d8cb29ff5943dd30ab3c1
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Mar 31 07:02:54 2025 +0100

    config, toplevel, Darwin: Pass -B instead of -L to C++ commands.

    Darwin from 10.11 needs embedded rpaths to find the correct libraries at
    runtime.  Recent increases in hardening have made it such that the dynamic
    loader will no longer fall back to using an installed libstdc++ when the
    (new) linked one is not found.  This means we fail configure tests (that
    should pass) for runtimes that use C++.

    We can resolve this by passing '-B' to the C++ command lines instead of '-L'
    (-B implies -L on Darwin, but also causes a corresponding embedded rpath).

commit dcb7009efc5358207d1b0612732a0608915a3ef7
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Mar 28 13:48:36 2025 +0100

    bootstrap/119513 - fix cobol bootstrap with --enable-generated-files-in-srcdir

    This adds gcc/cobol/parse.o to compare_exclusions and makes sure to
    ignore errors when copying generated files, like it's done when
    copying gengtype-lex.cc.

commit 0fb10aca02852b2e8d78a78c07aa2f62aec6a07e
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Tue Mar 25 16:20:58 2025 +0000

    toplevel, libcobol: Add dependency on libquadmath build [PR119244].

    For the configuration of libgcobol to be correct for targets that need
    to use libquadmath for 128b FP support, we must be able to find the
    quadmath library (or not, for targets that have the support in libc).

commit 70bc553e1b565d2e162894ea29a223b44e9133e3
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Mar 23 11:45:17 2025 +0000

    toplevel, Makefile: Add missing CXX_FOR_TARGET export [PR88319].

    Actually, the issue is not local to the libitm case, it currently affects
    any 'cxx=true' top-level configured target library.

    The issue is a missing export of CXX_FOR_TARGET.

commit c650b557cb01f97bebb894aa68e5e74c2147c395
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Mon Jul 11 22:36:39 2022 +0200

    GCN, nvptx: Don't default-disable libstdc++ build

    In addition to making libstdc++ itself available, this, via enabling
    'build-gcc/*/libstdc++-v3/scripts/testsuite_flags', in particular also makes
    the standard C++ headers available to 'make check-gcc-c++'.  With that, there
    are a lot of FAIL/UNRESOLVED -> PASS progressions, where we previously ran
    into, for example:

        FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C  (test for errors, line 6)
        FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C (test for excess errors)
        Excess errors:
        [...]/gcc/testsuite/g++.dg/coroutines/coro.h:132:10: fatal error: cstdlib: No such file or directory

    Similarly, there are a lot of FAIL/UNRESOLVED -> UNSUPPORTED "progressions" due
    to 'sorry, unimplemented: exception handling not supported'.

    The 'make check-target-libstdc++-v3' results don't look too bad, either.

    This also reverts Subversion r221362
    (Git commit d94fae044da071381b73a2ee8afa874b14fa3820) "No libstdc++ for nvptx",
    and commit 2f4f3c0e9345805160ecacd6de527b519a8c9206 "No libstdc++ for GCN".

    With libstdc++ now available, libgrust gets enabled, which we in turn again
    have to disable, for 'sorry, unimplemented: exception handling not supported'
    reasons.

commit 09c2a0ab94e1e731433eb2687ad16a9c79617e14
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 11 14:34:01 2025 +0100

    cobol: Fix up libgcobol configure [PR119216]

    Sorry, seems I've screwed up the earlier libgcobol/configure.tgt change.
    Looking in more detail, the way e.g. libsanitizer/configure.tgt works is
    that it is sourced twice, once at toplevel and there it just sets
    UNSUPPORTED=1 for fully unsupported triplets, and then inside of
    libsanitizer/configure where it decides to include or not include the
    various sublibraries depending on the *_SUPPORTED flags.

    So, the following patch attempts to do the same for libgcobol as well.

    The BIULD_LIBGCOBOL automake conditional was unused, this patch guards it
    on LIBGCOBOL_SUPPORTED as well and guards with it
    toolexeclib_LTLIBRARIES  = libgcobol.la

    Also, AM_CFLAGS has been changed to AM_CXXFLAGS as there are just C++
    sources in the library.

commit 6a3f9f30d93c376a8a5e98be888da14923b85e63
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Tue Mar 11 09:56:18 2025 +0000

    configure, Darwin: Require explicit selection of COBOL.

    By defult, Darwin does not have sufficient tools to build COBOL
    so we do not want to include it in --enable-languages=all since
    this will break regular testing of all supported languages.

    However, we do want to be able to build it on demand (where the
    build system has sufficiently new tools) and so do not want to
    disable it permanently.

commit 45c281deb7a2e24a21f2f68a2a3652e30f27f953
Author: James K. Lowden <jklowden@symas.com>
Date:   Mon Mar 10 16:04:49 2025 +0100

    COBOL: config and build machinery

commit ab35fc0d897011c6de075e000d1e0388e6359d4e
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date:   Wed Feb 19 09:30:45 2025 +0100

    GCN, nvptx: Support '--enable-languages=all'

    ..., where "support" means that the build doesn't fail, but it doesn't mean
    that all target libraries get built and we get pretty test results for the
    additional languages.

commit bc3597635a708cd91d742c91c6050829cfb4062a
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Nov 29 18:13:22 2024 -0500

    Rename "libdiagnostics" to "libgdiagnostics"

    "libdiagnostics" clashes with an existing soname in Debian, as
    per:
      https://gcc.gnu.org/pipermail/gcc/2024-November/245175.html

    Rename it to "libgdiagnostics" for uniqueness.

    I am being deliberately vague about what the "g" stands for:
    it could be "gnu", "gcc", or "gpl-licensed" as the reader desires.

commit fc59a3995cb46c190c0efb0431ad204e399975c4
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed May 3 18:43:10 2023 +0200

    gccrs: Fix bootstrap build

    This commit fixes bootstrapping for future additions to libgrust/

commit 7a6906c8d80e437a97c780370a8fec4e00561c7b
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Jun 12 10:51:49 2023 +0200

    gccrs: Fix missing build dependency

    Fix the missing dependency between the gcc and libgrust.

	* Makefile.def: Synced from gcc.
	* Makefile.tpl: Likewise.
	* configure.ac: Likewise.
	* Makefile.in: Regenerated.
	* configure: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-10-02 07:42:18 +08:00
H.J. Lu
77c74294bf 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.

	PR binutils/33483
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* Makefile.tpl (AR_FOR_TARGET): Add @AR_PLUGIN_OPTION_FOR_TARGET@.
	(NM_FOR_TARGET): Add @NM_PLUGIN_OPTION_FOR_TARGET@.
	(RANLIB_FOR_TARGET): Add @RANLIB_PLUGIN_OPTION_FOR_TARGET@.
	* configure.ac: Use CLANG_PLUGIN_FILE_FOR_TARGET and
	GCC_PLUGIN_OPTION_FOR_TARGET to set AR_PLUGIN_OPTION_FOR_TARGET,
	NM_PLUGIN_OPTION_FOR_TARGET and RANLIB_PLUGIN_OPTION_FOR_TARGET.
	AC_SUBST AR_PLUGIN_OPTION_FOR_TARGET, NM_PLUGIN_OPTION_FOR_TARGET
	and RANLIB_PLUGIN_OPTION_FOR_TARGET.

config/

	PR binutils/33483
	* clang-plugin.m4 (CLANG_PLUGIN_FILE_FOR_TARGET): New.
	* gcc-plugin.m4 (GCC_PLUGIN_OPTION_FOR_TARGET): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-09-27 11:34:45 +08:00
H.J. Lu
10deea6e2f 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.

	PR binutils/33470
	* Makefile.in: Regenerated.
	* Makefile.tpl (NM): Add @NM_PLUGIN_OPTION@.
	* configure: Regenerated.
	* configure.ac: Include config/clang-plugin.m4.
	Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION to set
	PLUGIN_OPTION.  Set and subst NM_PLUGIN_OPTION.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Use CLANG_PLUGIN_FILE and
	GCC_PLUGIN_OPTION.

config/

	PR binutils/33470
	* clang-plugin.m4: New file.

libbacktrace/

	PR binutils/33470
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.

libiberty/

	PR binutils/33470
	* aclocal.m4: Regenerated.
	* configure: Likewise.
	* configure.ac: Move GCC_PLUGIN_OPTION after GCC_NO_EXECUTABLES.
	Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION to set
	PLUGIN_OPTION.  Don't add the redundant --plugin option.

zlib/

	PR binutils/33470
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-09-25 12:30:13 +08:00
Rainer Orth
1fcb94ed75 Remove remnants of Solaris/PowerPC support
When removing Solaris/PowerPC support, I missed a couple of references.
This patch removes them.

Tested with crosses to ppc-unknown-linux-gnu and powerpc-ibm-aix7.

2025-09-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac <powerpcle-*-solaris*>: Remove.
	* configure: Regenerate.

	bfd:
	* config.bfd <powerpcle-*-solaris2*>: Remove.

	gas:
	* configure.tgt <ppc-*-solaris*>: Remove.
2025-09-18 16:17:14 +02:00
Sandra Loosemore
e7a16d9fd6 nios2: Remove binutils support for Nios II target.
The Nios II architecture has been EOL'ed by the vendor.  This patch
removes all binutils, bfd, gas, binutils, and opcodes support for this
target with the exception of the readelf utility.  (The ELF EM_*
number remains valid and the relocation definitions from the Nios II
ABI will never change in future, so retaining the readelf support
seems consistent with its purpose as a utility that tries to parse the
headers in any ELF file provided as an argument regardless of target.)
2024-11-26 19:13:07 +00:00
Sam James
987db70ace Sync toplevel configure with GCC
This syncs us with GCC as of r15-5590-gf34422e06c38eb.

Some changes will need to be propagated to the GCC side (so I've kept those
and not clobbered them) which I will handle shortly.

Approved-By: Tom Tromey <tom@tromey.com>
2024-11-22 19:05:34 +00:00
Nick Clifton
aec7815b4b Deprecate the ARM simulator.
The ARM simulator is no longer able to simulator modern ARM cores, so it
    is being deprecated.  Once this change has been active for a while - and
    assuming that no problems have been found - the ARm simulator codebase
    will be removed.
2024-11-07 14:53:26 +00:00
Vladimir Mezentsev
e0c182c3ac Fix 32303 ./configure --help: replace --enable-gprofng with --disable-gprofng
ChangeLog
2024-10-31  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR 32303
	* configure.ac: Replace --enable-gprofng with --disable-gprofng
	* configure: Rebuild.
2024-11-01 16:32:33 -07:00
Vladimir Mezentsev
abb27dd124 Disable gprofng build for *musl*
I disable gprofng until gprofng is ported to musl.

gprofng/ChangeLog
2024-08-22  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

	PR gprofng/30779
	PR gprofng/29593
	PR gprofng/29477
	* configure.ac: Disable gprofng build for *musl*.
	* configure: Rebuild.
2024-08-26 13:48:29 -07:00
Yixuan Chen
762c38d552 RISC-V:[gprofng] Minimal support gprofng for riscv.
ChangeLog: Add target riscv to --enable-gprofng.

2024-07-04  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * configure: Add riscv.
        * configure.ac: Add riscv.

gprofng/ChangeLog: Minimal support gprofng for riscv.

2024-07-04  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * gprofng/common/core_pcbe.c (core_pcbe_init): Add RISC-V vendor conditon.
        (defined): Add riscv.
        * gprofng/common/cpuid.c (defined): Add risc-v hwprobe.
        * gprofng/common/gp-defs.h (TOK_A_RISCV): Add riscv.
        (defined): Add riscv.
        (ARCH_RISCV): Add riscv.
        * gprofng/common/hwc_cpus.h: Add RISC-V vendor.
        * gprofng/common/hwcfuncs.h (HW_INTERVAL_TYPE): Remove useless defination.
        * gprofng/configure: Add riscv.
        * gprofng/configure.ac: Add riscv.
        * gprofng/libcollector/hwprofile.h (ARCH): Add RISC-V register.
        (CONTEXT_PC): Add RISC-V register.
        (CONTEXT_FP): Add RISC-V register.
        (CONTEXT_SP): Add RISC-V register.
        (SETFUNCTIONCONTEXT):
        * gprofng/libcollector/libcol_util.c (__collector_util_init): Fix libc open condition.
        * gprofng/libcollector/libcol_util.h (ARCH): Add RISC-V.
        * gprofng/libcollector/unwind.c (ARCH): Add RISC-V register.
        (GET_PC): Add RISC-V register.
        (GET_SP): Add RISC-V register.
        (GET_FP): Add RISC-V register.
        (FILL_CONTEXT):
        * gprofng/src/DbeSession.cc (ARCH): Add RISC-V.
        * gprofng/src/Disasm.cc (Disasm::disasm_open): Add RISC-V.
        * gprofng/src/Experiment.cc (Experiment::ExperimentHandler::startElement): Add RISC-V.
        * gprofng/src/checks.cc (ARCH): Add RISC-V.
        * gprofng/src/collctrl.cc (defined): Set risc-v cpu frequency to 1000MHz as default for now, will fix when I find a better method to get cpu frequency.
        (read_cpuinfo): Add "mvendorid" condition according to risc-v /proc/cpuinfo file content.
        * gprofng/src/dbe_types.h (enum Platform_t): Add RISC-V.
2024-07-10 15:16:03 -07:00
Matthieu Longo
28ea7ae220 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
2024-06-10 08:25:55 +09:30
Matthieu Longo
2949648166 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
2024-06-10 08:25:55 +09:30
Thiago Jung Bauermann
9c0aa4c531 Fix disabling of year 2038 support on 32-bit hosts by default
Commit e5f2f7d901 ("Disable year 2038 support on 32-bit hosts by
default") fixed a mismatch between 64-bit time_t in GDB and system headers
and 32-bit time_t in BFD.

However, since commit 862776f26a ("Finalized intl-update patches")
gnulib's year 2038 support has been accidentally re-enabled — causing
problems for 32-bit hosts again.  The commit split baseargs into
{h,b}baseargs, but this hasn't been done for the code that handles
--disable-year2038.

This patch restores the intended behaviour.  With this change, the number
of unexpected core files goes from 18 to 4.

Tested on armv8l-linux-gnueabihf.

Approved-By: Luis Machado <luis.machado@arm.com>
2024-02-05 15:28:05 -03:00
Nick Clifton
2967219a21 Sync top level configure and makefiles
This update brings in the following commits from the gcc mainline:

commit b7e5a29602143b53267efcd9c8d5ecc78cd5a62f
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Jan 9 06:25:26 2024 -0700

    Pass GUILE down to subdirectories

    When I enable cgen rebuilding in the binutils-gdb tree, the default is
    to run cgen using 'guile'.  However, on my host, guile is guile 2.2,
    which doesn't work for me -- I have to use guile3.0.

    This patch arranges to pass "GUILE" down to subdirectories, so I can
    use 'make GUILE=guile3.0'.

commit 725fb3595622a4ad8cd078a42fab1c395cbf90cb
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Oct 25 13:06:48 2023 +0200

    build: Add libgrust as compilation modules

    Define the libgrust directory as a host compilation module as well as
    for targets. Disable target libgrust if we're not building target
    libstdc++.

commit 56ca59a03150cf44cea340f58967c990ed6bf43c
Author: Lewis Hyatt <lhyatt@gmail.com>
Date:   Thu Nov 16 11:18:37 2023 -0500

    Makefile.tpl: Avoid race condition in generating site.exp from the top level

    A command like "make -j 2 check-gcc-c check-gcc-c++" run in the top level of
    a fresh build directory does not work reliably. That will spawn two
    independent make processes inside the "gcc" directory, and each of those
    will attempt to create site.exp if it doesn't exist and will interfere with
    each other, producing often a corrupted or empty site.exp. Resolve that by
    making these targets depend on a new phony target which makes sure site.exp
    is created first before starting the recursive makes.

commit 6a6d3817afa02bbcd2388c8e005da6faf88932f1
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Mar 28 14:48:17 2021 +0100

    Config,Darwin: Allow for configuring Darwin to use embedded runpath.

    Recent Darwin versions place contraints on the use of run paths
    specified in environment variables.  This breaks some assumptions
    in the GCC build.

    This change allows the user to configure a Darwin build to use
    '@rpath/libraryname.dylib' in library names and then to add an
    embedded runpath to executables (and libraries with dependents).

    The embedded runpath is added by default unless the user adds
    '-nodefaultrpaths' to the link line.

    For an installed compiler, it means that any executable built with
    that compiler will reference the runtimes installed with the
    compiler (equivalent to hard-coding the library path into the name
    of the library).

    During build-time configurations  any "-B" entries will be added to
    the runpath thus the newly-built libraries will be found by exes.

    Since the install name is set in libtool, that decision needs to be
    available here (but might also cause dependent ones in Makefiles,
    so we need to export a conditional).

    This facility is not available for Darwin 8 or earlier, however the
    existing environment variable runpath does work there.

    We default this on for systems where the external DYLD_LIBRARY_PATH
    does not work and off for Darwin 8 or earlier.  For systems that can
    use either method, if the value is unset, we use the default (which
    is currently DYLD_LIBRARY_PATH).

commit 2551e10038a70901f30b2168e6e3af4536748f3c
Author: Sergei Trofimovich <siarheit@google.com>
Date:   Mon Oct 2 12:08:17 2023 +0100

    Makefile.tpl: disable -Werror for feedback stage [PR111663]

    Without the change profiled bootstrap fails for various warnings on
    master branch as:

        $ ../gcc/configure
        $ make profiledbootstrap
        ...
        gcc/genmodes.cc: In function ‘int main(int, char**)’:
        gcc/genmodes.cc:2152:1: error: ‘gcc/build/genmodes.gcda’ profile count data file not found [-Werror=missing-profile]
        ...
        gcc/gengtype-parse.cc: In function ‘void parse_error(const char*, ...)’:
        gcc/gengtype-parse.cc:142:21: error: ‘%s’ directive argument is null [-Werror=format-overflow=]

    The change removes -Werror just like autofeedback does today.

commit d1bff1ba4d470f6723be83c0e3c4d5083e51877a
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Jun 1 23:07:37 2023 +0200

    Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951]

    ..., where we need to use it (separate commits) for build-tree testing, similar
    to 'gcc/Makefile.in:site.exp':

        # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation.
        # They are passed first to allow individual tests to override them.
            @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp

            PR testsuite/109951
            * Makefile.tpl (BASE_TARGET_EXPORTS): Add
            'SYSROOT_CFLAGS_FOR_TARGET'.
            * Makefile.in: Regenerate.
2024-01-10 12:03:03 +00:00
Arsen Arsenovi?
862776f26a Finalized intl-update patches
* intl: Remove directory.  Replaced with out-of-tree GNU gettext.
  * .gitignore: Add '/gettext*'.
  * configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag.  Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing.
  * configure: Regenerate.
  * Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext.
  * Makefile.in: Regenerate.
  * src-release.sh: Remove references to the intl/ directory.
2023-11-15 12:53:04 +00:00
Paul Iannetta
6e712424f5 kvx: New port. 2023-08-16 14:22:54 +01:00
Andreas Schwab
19824f6fab Use substituted GDCFLAGS
Use the substituted value for GCDFLAGS instead of hardcoding $(CFLAGS) so
that the subdir configure scripts use the configured value.

	* configure.ac (GDCFLAGS): Set default from ${CFLAGS}.
2023-08-12 10:25:06 +09:30
Arsen Arsenović
5006459c39 toplevel: reconcile few divergences with GCC
* configure.ac: Reorder include.
	<is_elf calculation>: Re-add haiku to ELF target list.
2023-08-12 10:24:43 +09:30
Martin Liska
83e8a1eff6 32-bit PA-RISC with HP-UX: remove deprecated ports
* configure.ac: Drop GCC configury for hpux10
	* configure: Likewise.
config/
	* mh-pa-hpux10: Drop.
2023-08-12 10:23:55 +09:30
Gaius Mulley
917f20be83 Merge modula-2 front end onto gcc.
This commit merges the devel/modula2 into master.
The libraries reside in libgm2, the compiler in gcc/m2
and the testsuite in gcc/testsuite/gm2.

	* configure.ac (target_libraries): Add target-libgm2.
	Add NCN_STRICT_CHECK_TARGET_TOOLS entry for gm2.
	Add GCC_TARGET_TOOL entry for gm2.  (compare_exclusions)
	add gcc/m2/gm2-compiler/M2Version,
	gcc/m2/gm2-compiler-boot/SYSTEM and gcc/m2/gm2version.
	* Makefile.def (target_modules): Add libgm2.  (flags_to_pass)
	Add GM2_FOR_TARGET, GM2FLAGS_FOR_TARGET.  (dependencies) Add
	all-target-libgm2 and on=all-target-libatomic.  (languages)
	Add entry for language=m2 with gcc-check-target=check-m2
	and lib-check-target=check-target-libgm2.
	* Makefile.tpl (BUILD_EXPORTS): Add definition for GM2
	and GM2FLAGS.  (HOST_EXPORTS) Add definition for GM2.
	(BASE_TARGET_EXPORTS) Add definition for GM2.
	(GM2_FOR_BUILD) Defined.  (GM2FLAGS) Defined.
	(GM2_FOR_TARGET) Defined.  (GM2FLAGS_FOR_TARGET) Defined.
	(EXTRA_HOST_FLAGS) Defined.  (POSTSTAGE1_FLAGS_TO_PASS)
	Add GM2 and GM2_FOR_BUILD.  (EXTRA_TARGET_FLAGS) Add
	GM2 and GM2FLAGS.  (EXTRA_GCC_FLAGS) Add GM2_FOR_TARGET.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-08-12 09:58:23 +09:30
Thomas Schwinge
ddb5be247e Remove support for Intel MIC offloading
... after its deprecation in GCC 12.

	* Makefile.def: Remove module 'liboffloadmic'.
	* configure.ac: Remove 'liboffloadmic' handling.
2023-08-12 09:58:23 +09:30
Iain Sandoe
ed0a861b07 configure, Darwin: Ensure overrides to host-pie are passed to gcc configure.
The latest versions of Darwin on the Aarch64 platform mandate PIE executables.
On x86_64 it remains optional, but produces tool warnings after Darwin20, so
we default to PIE executables there too.

All (non-PowerPC) 64b Darwin platforms mandate PIC code and therefore force
host_shared on (we issue a diagnostic if the user tries to configure them
non-shared).

However, this also means we cannot test the host_shared setting independently
of the host_pie setting so that the logic for setting PICFLAG must be amended
for Darwin.

For Darwin versions required to have PIE executables, in the event that the
user tries to configure these as --disable-host-pie, we issue a warning and
override the setting.  These versions must also switch host_pie on even if it
is not given in the configure line.  To cater for this we pass the current
value of host_pie, as determined by top-level configure, to the GCC configure.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

	* Makefile.def: Pass the enable-host-pie value to GCC configure.
	* configure.ac: Adjust the logic for shared and PIE host flags to
	ensure that PIE is passed for hosts that require it.
2023-08-12 09:58:23 +09:30
Peter Foley
d0aa61ca5c configure: Only create serdep.tmp if needed
There's no reason to create this file if none of the serial configure
options are passed.

	* configure.ac: Only create serdep.tmp if needed
2023-08-12 09:58:23 +09:30
Marek Polacek
60b42421e9 configure: Implement --enable-host-pie
This patch implements the --enable-host-pie configure option which
makes the compiler executables PIE.  This can be used to enhance
protection against ROP attacks, and can be viewed as part of a wider
trend to harden binaries.

Co-Authored by: Iain Sandoe  <iain@sandoe.co.uk>

	* configure.ac (--enable-host-pie): New check.  Set PICFLAG after this
	check.

intl/
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.

libdecnumber/
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.

zlib/
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
2023-08-12 09:58:23 +09:30
Iain Sandoe
947edb094e configure: When host-shared, pass --with-pic to in-tree lib configs.
If we are building PIC/PIE host executables, and we are building dependent
libs (e.g. GMP) in-tree those libs need to be configured to generate PIC code.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

	* Makefile.def: Pass host_libs_picflag to host dependent library
	configures.
	* configure.ac (host_libs_picflag): New configure variable set to
	'--with-pic' when building 'host_shared'.
2023-08-12 09:58:23 +09:30
Sam James
b5c37946cc Revert "2.41 Release sources"
This reverts commit 675b9d612c.

See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
2023-08-02 12:06:23 +01:00
Nick Clifton
675b9d612c 2.41 Release sources 2023-08-02 09:23:36 +01:00
Clément Chigot
5fb0e30857 configure: remove dependencies on gmp and mpfr when gdb is disabled
Since 9911806278, the configure checks
about GMP and MPFR for gdb builds have been moved to the toplevel
configure.
However, it doesn't take into account the --disable-gdb option. Meaning
that a build without gdb will require these libraries even if not
needed.

ChangeLog:

	* configure.ac: Skip GMP and MPFR when --disable-gdb is
	provided.
	* configure: Regenerate.
2023-01-06 09:32:07 +01:00
Andrew Pinski
9911806278 Use toplevel configure for GMP and MPFR for gdb
This patch uses the toplevel configure parts for GMP/MPFR for
gdb. The only thing is that gdb now requires MPFR for building.
Before it was a recommended but not required library.
Also this allows building of GMP and MPFR with the toplevel
directory just like how it is done for GCC.
We now error out in the toplevel configure of the version
of GMP and MPFR that is wrong.

OK after GDB 13 branches? Build gdb 3 ways:
with GMP and MPFR in the toplevel (static library used at that point for both)
With only MPFR in the toplevel (GMP distro library used and MPFR built from source)
With neither GMP and MPFR in the toplevel (distro libraries used)

Changes from v1:
* Updated gdb/README and gdb/doc/gdb.texinfo.
* Regenerated using unmodified autoconf-2.69

Thanks,
Andrew Pinski

ChangeLog:
	* Makefile.def: Add configure-gdb dependencies
	on all-gmp and all-mpfr.
	* configure.ac: Split out MPC checking from MPFR.
	Require GMP and MPFR if the gdb directory exist.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

gdb/ChangeLog:

	PR bug/28500
	* configure.ac: Remove AC_LIB_HAVE_LINKFLAGS
	for gmp and mpfr.
	Use GMPLIBS and GMPINC which is provided by the
	toplevel configure.
	* Makefile.in (LIBGMP, LIBMPFR): Remove.
	(GMPLIBS, GMPINC): Add definition.
	(INTERNAL_CFLAGS_BASE): Add GMPINC.
	(CLIBS): Exchange LIBMPFR and LIBGMP
	for GMPLIBS.
	* target-float.c: Make the code conditional on
	HAVE_LIBMPFR unconditional.
	* top.c: Remove code checking HAVE_LIBMPFR.
	* configure: Regenerate.
	* config.in: Regenerate.
	* README: Update GMP/MPFR section of the config
	options.
	* doc/gdb.texinfo: Likewise.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28500
2022-12-21 16:49:23 +00:00
Weimin Pan
19e559f1c9 libsframe: add the SFrame library
libsframe is a library that allows you to:
- decode a .sframe section
- probe and inspect a .sframe section
- encode (and eventually write) a .sframe section.

This library is currently being used by the linker, readelf, objdump.
This library will also be used by the SFrame unwinder which is still
to be upstream'd.

The file include/sframe-api.h defines the user-facing APIs for decoding,
encoding and probing .sframe sections. A set of error codes together
with their error message strings are also defined.

Endian flipping is performed automatically at read and write time, if
cross-endianness is detected.

ChangeLog:

	* Makefile.def: Add libsframe as new module with its
	dependencies.
	* Makefile.in: Regenerated.
	* binutils/Makefile.am: Add libsframe.
	* binutils/Makefile.in: Regenerated.
	* configure: Regenerated
	* configure.ac: Add libsframe to host_libs.
	* libsframe/Makefile.am: New file.
	* libsframe/Makefile.in: New file.
	* libsframe/aclocal.m4: New file.
	* libsframe/config.h.in: New file.
	* libsframe/configure: New file.
	* libsframe/configure.ac: New file.
	* libsframe/sframe-error.c: New file.
	* libsframe/sframe-impl.h: New file.
	* libsframe/sframe.c: New file.

include/ChangeLog:

	* sframe-api.h: New file.

testsuite/ChangeLog:

	* libsframe/testsuite/Makefile.am: New file.
	* libsframe/testsuite/Makefile.in: Regenerated.
	* libsframe/testsuite/libsframe.decode/Makefile.am: New
	  file.
	* libsframe/testsuite/libsframe.decode/Makefile.in:
	  Regenerated.
	* libsframe/testsuite/libsframe.decode/decode.exp: New file.
	* libsframe/testsuite/libsframe.encode/Makefile.am:
	  Likewise.
	* libsframe/testsuite/libsframe.encode/Makefile.in:
	  Regenerated.
	* libsframe/testsuite/libsframe.encode/encode.exp: New file.
	* libsframe/testsuite/libsframe.encode/encode-1.c: Likewise.
	* libsframe/testsuite/libsframe.decode/be-flipping.c: Likewise.
	* libsframe/testsuite/libsframe.decode/frecnt-1.c: Likewise.
	* libsframe/testsuite/libsframe.decode/frecnt-2.c: Likewise.
	* libsframe/testsuite/libsframe.decode/DATA-BE: New file.
	* libsframe/testsuite/libsframe.decode/DATA1: Likewise.
	* libsframe/testsuite/libsframe.decode/DATA2: Likewise.
2022-11-15 15:24:29 -08:00
Дилян Палаузов
1c232ab030 Reapply "Don't build readline/libreadline.a, when --with-system-readline is supplied"
Commit 228cf97dd3 ("Merge configure.ac from gcc project") undid the
change originally done in commit 69961a84c9 ("Don't build
readline/libreadline.a, when --with-system-readline is supplied").
Re-apply it.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=18632
2022-10-20 17:05:04 +02:00
Simon Marchi
9e65489ac2 Re-apply "Pass PKG_CONFIG_PATH down from top-level Makefile"
Commit 228cf97dd3 ("Merge configure.ac from gcc project") undid the
change originally done in de83289ef3 ("Pass PKG_CONFIG_PATH down from
top-level Makefile").  Re-apply it.

Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf
2022-10-11 23:09:32 -04:00
Martin Liska
b0c295e1b8 add --enable-default-compressed-debug-sections-algorithm configure option
ChangeLog:

	* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
	* configure: Regenerate.

gas/ChangeLog:

	* NEWS: Document the new option.
	* as.c (flag_compress_debug): Set default algorithm based
	on the configure option.
	* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
	* configure: Regenerate.
	* config.in: Likewise.

ld/ChangeLog:

	* NEWS: Document the new option.
	* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
	* configure: Regenerate.
	* config.in: Likewise.
	* ldmain.c: Set default algorithm based
	on the configure option.
2022-10-11 14:15:04 +02:00
Alan Modra
228cf97dd3 Merge configure.ac from gcc project
To merge with gcc's copy of configure.ac we need to revert changes to
configure.ac in the following gcc commits:
dc832fb39fc0 2022-08-25
fc259b522c0f 2022-06-25
Then reapply configure.ac changes in binutils from these binutils
commits:
50ad1254d5 2021-01-09
bb368aad29 2022-03-11
e5f2f7d901 2022-07-26
2cac01e3ff 2022-09-26
Plus copy over gcc's config/ax_cxx_compile_stdcxx.m4, then regenerate
configure.
2022-10-10 11:14:21 +10:30
Fangrui Song
2cac01e3ff binutils, gdb: support zstd compressed debug sections
PR29397 PR29563: Add new configure option --with-zstd which defaults to
auto.  If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support
zstd compressed debug sections for most tools.

* bfd: for addr2line, objdump --dwarf, gdb, etc
* gas: support --compress-debug-sections=zstd
* ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
* objcopy: support ELFCOMPRESS_ZSTD input for
  --decompress-debug-sections and --compress-debug-sections=zstd
* gdb: support ELFCOMPRESS_ZSTD input.  The bfd change references zstd
  symbols, so gdb has to link against -lzstd in this patch.

If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error.  We
can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this
is too heavyweight, so don't do it for now.

```
% ld/ld-new a.o
ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...

% ld/ld-new a.o --compress-debug-sections=zstd
ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support

% binutils/objcopy --compress-debug-sections=zstd a.o b.o
binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support

% binutils/objcopy b.o --decompress-debug-sections
binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...
```
2022-09-26 19:50:13 -07:00
Tsukasa OI
e472ec9fad configure: Pass CPPFLAGS_FOR_BUILD to subdirs
Because CPPFLAGS_FOR_BUILD is used in some subdirectories (through
bfd/warning.m4), not AC_SUBSTing the variable causes minor issues.

Fortunately, it didn't cause severe errors but error messages related to
@CPPFLAGS_FOR_BUILD@ (not AC_SUBSTed CPPFLAGS_FOR_BUILD variable passed
to subdirectories through Makefile) remain in config.log.

To avoid invalid invocation of preprocessor for build environment, we
need to set proper CPPFLAGS_FOR_BUILD (may be empty) and pass it to
subdirectories that need it.  This is what this commit does.

ChangeLog:

	* configure.ac: Pass CPPFLAGS_FOR_BUILD to subdirectories.
	* configure: Regenerate.
2022-09-21 06:14:16 +00:00
Luis Machado
e5f2f7d901 Disable year 2038 support on 32-bit hosts by default
With a recent import of gnulib, code has been pulled that tests and enables
64-bit time_t by default on 32-bit hosts that support it.

Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
doesn't do these checks.

As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
have a mismatch between gdb's notion of time_t and bfd's notion of time_t.

This will lead to mismatches in the struct stat size, leading to memory
corruption and crashes.

This patch disables the year 2038 check for now, which makes things work
reliably again.

I'd consider this a temporary fix until we have proper bfd checks for the year
2038, if it makes sense.  64-bit hosts seems to be more common these days, so
I'm not sure how important it is to have this support enabled and how soon
we want to enable it.

Thoughts?
2022-08-10 11:17:53 +01:00
Tom de Vries
95127faf50 [gdb/build] Fix build breaker with --enable-shared
When building gdb with --enable-shared, I run into:
...
ld: build/zlib/libz.a(libz_a-inffast.o): relocation R_X86_64_32S against \
  `.rodata' can not be used when making a shared object; recompile with -fPIC
ld: build/zlib/libz.a(libz_a-inflate.o): warning: relocation against \
  `inflateResetKeep' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[3]: *** [libbfd.la] Error 1
...

This is a regression since commit a08bdb159b ("[gdb/build] Fix gdbserver
build with -fsanitize=thread").

The problem is that a single case statement in configure is shared to handle
special requirements for both the host libiberty and host zlib, which has the
effect that only one is handled.

Fix this by handling libiberty and zlib each in its own case statement.

Build on x86_64-linux, with and without --enable-shared.

ChangeLog:

2022-06-27  Tom de Vries  <tdevries@suse.de>

	* configure.ac: Set extra_host_libiberty_configure_flags and
	extra_host_zlib_configure_flags in separate case statements.
	* configure: Regenerate.
2022-06-27 15:36:19 +02:00
Tom de Vries
a08bdb159b [gdb/build] Fix gdbserver build with -fsanitize=thread
[ Copied from gcc commit 153689603fd ("[gdb/build] Fix gdbserver build with
-fsanitize=thread"). ]

When building gdbserver with -fsanitize=thread (added to CFLAGS/CXXFLAGS) we
run into:
...
ld: ../libiberty/libiberty.a(safe-ctype.o): warning: relocation against \
  `__tsan_init' in read-only section `.text'
ld: ../libiberty/libiberty.a(safe-ctype.o): relocation R_X86_64_PC32 \
  against symbol `__tsan_init' can not be used when making a shared object; \
  recompile with -fPIC
ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libinproctrace.so] Error 1
...
which looks similar to what is described in commit 78e4948694 ("[gdb/build]
Fix gdbserver build with -fsanitize=address").

The gdbserver component builds a shared library libinproctrace.so, which uses
libiberty and therefore requires the pic variant.  The gdbserver Makefile is
setup to use this variant, if available, but it's not there.

Fix this by listing gdbserver in the toplevel configure alongside libcc1, as a
component that needs the libiberty pic variant, setting:
...
extra_host_libiberty_configure_flags=--enable-shared
...

Tested on x86_64-linux.

ChangeLog:

2022-06-27  Tom de Vries  <tdevries@suse.de>

	* configure.ac: Build libiberty pic variant for gdbserver.
	* configure: Regenerate.
2022-06-27 12:47:26 +02:00
Simon Marchi
de83289ef3 Pass PKG_CONFIG_PATH down from top-level Makefile
[Sending to binutils, gdb-patches and gcc-patches, since it touches the
top-level Makefile/configure]

I have my debuginfod library installed in a non-standard location
(/opt/debuginfod), which requires me to set
PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config.  If I just set it during
configure:

    $ PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config ./configure --with-debuginfod
    $ make

or

    $ ./configure --with-debuginfod PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config
    $ make

Then PKG_CONFIG_PATH is only present (and ignored) during the top-level
configure.  When running make (which runs gdb's and binutils'
configure), PKG_CONFIG_PATH is not set, which results in their configure
script not finding the library:

    checking for libdebuginfod >= 0.179... no
    configure: error: "--with-debuginfod was given, but libdebuginfod is missing or unusable."

Change the top-level configure/Makefile system to capture the value
passed when configuring the top-level and pass it down to
subdirectories (similar to CFLAGS, LDFLAGS, etc).

I don't know much about the top-level build system, so I really don't
know if I did this correctly.  The changes are:

 - Use AC_SUBST(PKG_CONFIG_PATH) in configure.ac, so that
   @PKG_CONFIG_PATH@ gets replaced with the actual PKG_CONFIG_PATH value
   in config files (i.e. Makefile)
 - Add a PKG_CONFIG_PATH Makefile variable in Makefile.tpl, initialized
   to @PKG_CONFIG_PATH@
 - Add PKG_CONFIG_PATH to HOST_EXPORTS in Makefile.tpl, which are the
   variables set when running the sub-configures

I initially added PKG_CONFIG_PATH to flags_to_pass, in Makefile.def, but
I don't think it's needed.  AFAIU, this defines the flags to pass down
when calling "make" in subdirectories.  We only need PKG_CONFIG_PATH to
be passed down during configure.  After that, it's captured in
gdb/config.status, so even if a "make" causes a re-configure later
(because gdb/configure has changed, for example), the PKG_CONFIG_PATH
value will be remembered.

ChangeLog:

	* configure.ac: Add AC_SUBST(PKG_CONFIG_PATH).
	* configure: Re-generate.
	* Makefile.tpl (HOST_EXPORTS): Pass PKG_CONFIG_PATH.
	(PKG_CONFIG_PATH): New.
	* Makefile.in: Re-generate.

Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf
2022-04-08 10:56:41 -04:00
Vladimir Mezentsev
bb368aad29 gprofng: a new GNU profiler
top-level
	* Makefile.def: Add gprofng module.
	* configure.ac: Add --enable-gprofng option.
	* src-release.sh: Add gprofng.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* gprofng: New directory.

binutils
	* MAINTAINERS: Add gprofng maintainer.
	* README-how-to-make-a-release: Add gprofng.

include.
	* collectorAPI.h: New file.
	* libcollector.h: New file.
	* libfcollector.h: New file.
2022-03-11 08:58:31 +00:00
Andrew Burgess
d33228c946 top-level configure: setup target_configdirs based on repository
The top-level configure script is shared between the gcc repository
and the binutils-gdb repository.

The target_configdirs variable in the configure.ac script, defines
sub-directories that contain components that should be built for the
target using the target tools.

Some components, e.g. zlib, are built as both host and target
libraries.

This causes problems for binutils-gdb.  If we run 'make all' in the
binutils-gdb repository we end up trying to build a target version of
the zlib library, which requires the target compiler be available.
Often the target compiler isn't immediately available, and so the
build fails.

The problem with zlib impacted a previous attempt to synchronise the
top-level configure scripts from gcc to binutils-gdb, see this thread:

  https://sourceware.org/pipermail/binutils/2019-May/107094.html

And I'm in the process of importing libbacktrace in to binutils-gdb,
which is also a host and target library, and triggers the same issues.

I believe that for binutils-gdb, at least at the moment, there are no
target libraries that we need to build.

In the configure script we build three lists of things we want to
build, $configdirs, $build_configdirs, and $target_configdirs, we also
build two lists of things we don't want to build, $skipdirs and
$noconfigdirs.  We then remove anything that is in the lists of things
not to build, from the list of things that should be built.

My proposal is to add everything in target_configdirs into skipdirs,
if the source tree doesn't contain a gcc/ sub-directory.  The result
is that for binutils-gdb no target tools or libraries will be built,
while for the gcc repository, nothing should change.

If a user builds a unified source tree, then the target tools and
libraries should still be built as the gcc/ directory will be present.

I've tested a build of gcc on x86-64, and the same set of target
libraries still seem to get built.  On binutils-gdb this change
resolves the issues with 'make all'.

ChangeLog:

	* configure: Regenerate.
	* configure.ac (skipdirs): Add the contents of target_configdirs if
	we are not building gcc.
2021-09-28 12:21:21 +01:00
Alexander von Gluck IV
d85e70a35b Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time. 2021-09-02 12:19:14 +01:00
Mike Frysinger
5c9e84c2d8 sim: leverage gnulib
We use getline, so leverage gnulib to provide fallback implementation.
2021-05-29 11:56:43 -04:00
Nick Clifton
a8d6316b67 Replace AC_PROG_CC with AC_PROG_CC_C99 in top level configure file.
2021-05-04  Nick Clifton  <nickc@redhat.com>

	* configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
	* configure: Regenerate.
2021-05-04 13:40:34 +01:00
Alan Modra
a57d17732e Remove arm-symbianelf
* configure.ac: Delete arm*-*-symbianelf* entry.
	* configure: Regenerate.
bfd/
	* config.bfd (arm*-*-symbianelf*): Move from obsolete to removed.
	* configure.ac: Delete symbian entries.
	* elf-bfd.h (enum elf_target_os): Delete is_symbian.
	* elf32-arm.c: Remove symbian support.  Formatting.
	* targets.c: Delete symbian entries.
	* configure: Regenerate.
binutils/
	* testsuite/lib/binutils-common.exp (supports_gnu_osabi): Remove
	symbianelf.
gas/
	* Makefile.am (TARG_ENV_HFILES): Remove config/te-symbian.h.
	* config/tc-arm.c (elf32_arm_target_format): Remove TE_SYMBIAN
	support.
	* config/te-symbian.h: Delete.
	* configure.tgt: Remove arm-*-symbianelf*.
	* testsuite/gas/arm/arch4t-eabi.d: Don't mention symbianelf in
	target selection.
	* testsuite/gas/arm/arch4t.d: Likewise.
	* testsuite/gas/arm/got_prel.d: Likewise.
	* testsuite/gas/arm/mapdir.d: Likewise.
	* testsuite/gas/arm/mapmisc.d: Likewise.
	* testsuite/gas/arm/mapsecs.d: Likewise.
	* testsuite/gas/arm/mapshort-eabi.d: Likewise.
	* testsuite/gas/arm/thumb-eabi.d: Likewise.
	* testsuite/gas/arm/thumb.d: Likewise.
	* testsuite/gas/arm/thumbrel.d: Likewise.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
ld/
	* Makefile.am (ALL_EMULATION_SOURCES): Remove earmsymbian.c.
	Don't include symbian dep file.
	* configure.tgt: Remove arm*-*-symbianelf* entry.
	* emulparams/armsymbian.sh: Delete.
	* ld.texi: Don't mention symbian.
	* scripttempl/armbpabi.sc: Delete.
	* testsuite/ld-arm/symbian-seg1.d: Delete.
	* testsuite/ld-arm/symbian-seg1.s: Delete.
	* testsuite/ld-arm/arm-elf.exp: Don't run symbian-seg1.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
2021-02-09 23:36:16 +10:30
H.J. Lu
44124a4683 binuitils: Check if AR is usable for LTO build
Check if AR is usable for LTO build with --enable-pgo-build=lto:

checking for -plugin option... ar: no operation specified
Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
no
configure: error: AR with --plugin and rc is required for LTO build

instead of build failure later.

	PR binutils/26766
	* configure.ac:
	* configure: Regenerated.
2021-01-11 16:37:13 -08:00
H.J. Lu
af019bfde9 Support the PGO build for binutils+gdb
Add the --enable-pgo-build[=lto] configure option.  When binutils+gdb
is not built together with GCC, --enable-pgo-build enables the PGO build:

1. First build with -fprofile-generate.
2. Use "make maybe-check-*" to generate profiling data and pass -i to make
to ignore errors when generating profiling data.
3. Use "make clean" to remove the previous build.
4. Rebuild with -fprofile-use.

With --enable-pgo-build=lto, -flto=jobserver -ffat-lto-objects are used
together with -fprofile-generate and -fprofile-use.  Add '+' to the command
line for recursive make to support -flto=jobserver -ffat-lto-objects.

NB: --enable-pgo-build=lto enables the PGO build with LTO while
--enable-lto enables LTO support in toolchain.

	PR binutils/26766
	* Makefile.tpl (BUILD_CFLAGS): New.
	(CFLAGS): Append $(BUILD_CFLAGS).
	(CXXFLAGS): Likewise.
	(PGO_BUILD_GEN_FLAGS_TO_PASS): New.
	(PGO_BUILD_TRAINING_CFLAGS): Likewise.
	(PGO_BUILD_TRAINING_CXXFLAGS): Likewise.
	(PGO_BUILD_TRAINING_FLAGS_TO_PASS): Likewise.
	(PGO_BUILD_TRAINING_MFLAGS): Likewise.
	(PGO_BUILD_USE_FLAGS_TO_PASS): Likewise.
	(PGO-TRAINING-TARGETS): Likewise.
	(PGO_BUILD_TRAINING): Likewise.
	(all): Add '+' to the command line for recursive make.  Support
	the PGO build.
	* configure.ac: Add --enable-pgo-build[=lto].
	AC_SUBST PGO_BUILD_GEN_CFLAGS, PGO_BUILD_USE_CFLAGS and
	PGO_BUILD_LTO_CFLAGS.  Enable the PGO build in Makefile.
	* Makefile.in: Regenerated.
	* configure: Likewise.
2021-01-09 06:51:51 -08:00
H.J. Lu
50ad1254d5 GCC: Pass --plugin to AR and RANLIB
Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	* configure.ac: Include config/gcc-plugin.m4.
	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
	RANLIB if possible.
	* Makefile.in: Regenerated.
	* configure: Likewise.

config/

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/

	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	(configure_deps): Depend on ../config/gcc-plugin.m4.
	* aclocal.m4: Include ../config/gcc-plugin.m4.
	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	RANLIB_PLUGIN_OPTION.
	* configure: Regenerated.

zlib/

	* configure: Regenerated.
2021-01-09 06:51:51 -08:00