aboutsummaryrefslogtreecommitdiff
path: root/configure
AgeCommit message (Collapse)AuthorFilesLines
2025-06-23Ada: Introduce GNATMAKE_FOR_BUILD Makefile variableNicolas Boulenguez1-2/+6
This gets rid of the hardcoded 'gnatmake' command used during the build. / PR ada/120106 * Makefile.tpl: Add GNATMAKE_FOR_BUILD to {HOST,BASE_TARGET}_EXPORTS * Makefile.in: Regenerate. * configure.ac: Set the default and substitute the variable. * configure: Regenerate. gcc/ada/ PR ada/120106 * Make-generated.in: Use GNATMAKE_FOR_BUILD instead of gnatmake. * gcc-interface/Makefile.in: Likewise.
2025-06-10[AutoFDO] Fix profile bootstrap for x86_64Kugan Vivekanandarajah1-0/+4
This patch fixes profile bootstrap for x86_64 by special caseing cpu_type for x86_64 as it shares AUTO_PROFILE from i386. ChangeLog: * configure.ac: Special case cpu_type for x86_64. * configure: Regenerate. Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
2025-05-26[AUTOFDO][AARCH64] Add support for profilebootstrapKugan Vivekanandarajah1-0/+4
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 ChangeLog: * Makefile.def: AUTO_PROFILE based on cpu_type. * Makefile.in: Likewise. * configure: Regenerate. * configure.ac: Set autofdo_target. gcc/ChangeLog: * config/aarch64/gcc-auto-profile: New file. Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
2025-05-21[PATCH] configure: Always add pre-installed header directories to search pathStephanos Ioannidis1-6/+10
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++. * configure.ac: Always add pre-installed heades to search path. * configure: Regenerate.
2025-04-22cobol: Restrict COBOL to supported Linux arches [PR119217]Rainer Orth1-11/+8
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. 2025-03-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR cobol/119217 * configure.ac: Restrict cobol to aarch64-*-linux*, x86_64-*-linux*. Fix indentation. * configure: Regenerate.
2025-04-02config, toplevel, Darwin: Pass -B instead of -L to C++ commands.Iain Sandoe1-2/+98
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). ChangeLog: * configure: Regenerate. * configure.ac: Use -B instead of -L to specifiy the C++ runtime paths on Darwin. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-28bootstrap/119513 - fix cobol bootstrap with --enable-generated-files-in-srcdirRichard Biener1-0/+1
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. PR bootstrap/119513 * configure.ac (compare_exclusions): Add gcc/cobol/parse\$(objext). * configure: Regenerated. gcc/cobol/ * Make-lang.in (cobol.srcextra): Use cp instead of ln, ignore errors.
2025-03-14GCN, nvptx: Don't default-disable libstdc++ buildThomas Schwinge1-5/+11
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. PR target/92713 PR target/101544 * configure.ac [GCN, nvptx] (noconfigdirs): Don't add 'target-libstdc++-v3'. Add 'target-libgrust'. * configure: Regenerate. gcc/ * config/gcn/gcn.h (LIBSTDCXX): Don't set. * config/nvptx/nvptx.h (LIBSTDCXX): Likewise.
2025-03-11cobol: Fix up libgcobol configure [PR119216]Jakub Jelinek1-1/+1
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. 2025-03-11 Jakub Jelinek <jakub@redhat.com> PR cobol/119216 * configure.ac: Check for UNSUPPORTED set by libgcobol/configure.tgt rather than LIBGCOBOL_SUPPORTED. * configure: Regenerate. libgcobol/ * configure.tgt: On fully unsupported targets set UNSUPPORTED=1. * configure.ac: Add AC_CHECK_SIZEOF([void *]), source in configure.tgt and set BUILD_LIBGCOBOL also based on LIBGCOBOL_SUPPORTED. * Makefile.am (toolexeclib_LTLIBRARIES): Conditionalize on BUILD_LIBGCOBOL. (AM_CFLAGS): Rename to ... (AM_CXXFLAGS): ... this. (%.lo: %.cc): Use $(AM_CXXFLAGS) rather than $(AM_CFLAGS). * configure: Regenerate. * Makefile.in: Regenerate.
2025-03-11configure, Darwin: Require explicit selection of COBOL.Iain Sandoe1-2/+5
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. ChangeLog: * configure: Regenerate. * configure.ac: Do not build COBOL on Darwin by default, even for --enable-languages=all. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-11COBOL: config and build machineryJames K. Lowden1-0/+53
* Makefile.def: Add libgcobol module and cobol language. * Makefile.in: Regenerate. * configure.ac: Add libgcobol module and cobol language. * configure: Regenerate.
2025-02-19GCN, nvptx: Support '--enable-languages=all'Thomas Schwinge1-1/+38
..., 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. * configure.ac (unsupported_languages) [GCN, nvptx]: Add 'ada'. (noconfigdirs) [GCN, nvptx]: Add 'target-libobjc', 'target-libffi', 'target-libgo'. * configure: Regenerate.
2024-12-18Revert "PR81358: Enable automatic linking of libatomic."Prathamesh Kulkarni1-5/+0
This reverts commit e2f6ed54f75bbf8dd0292af90304890f06a9be17.
2024-12-18PR81358: Enable automatic linking of libatomic.Prathamesh Kulkarni1-0/+5
ChangeLog: PR driver/81358 * Makefile.def: Add dependencies so libatomic is built before target libraries are configured. * Makefile.tpl: Export TARGET_CONFIGDIRS. * configure.ac: Add libatomic to bootstrap_target_libs. * Makefile.in: Regenerate. * configure: Regenerate. gcc/ChangeLog: PR driver/81358 * common.opt: New option -flink-libatomic. * gcc.cc (LINK_LIBATOMIC_SPEC): New macro. * config/gnu-user.h (GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC): Use LINK_LIBATOMIC_SPEC. * doc/invoke.texi: Document -flink-libatomic. * configure.ac: Define TARGET_PROVIDES_LIBATOMIC. * configure: Regenerate. * config.in: Regenerate. libatomic/ChangeLog: PR driver/81358 * Makefile.am: Pass -fno-link-libatomic. New rule all. * configure.ac: Assert that CFLAGS is set and pass -fno-link-libatomic. * Makefile.in: Regenerate. * configure: Regenerate. Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com> Co-authored-by: Matthew Malcolmson <mmalcolmson@nvidia.com>
2024-11-29Rename "libdiagnostics" to "libgdiagnostics"David Malcolm1-16/+17
"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. ChangeLog: * configure.ac: Rename "libdiagnostics" to "libgdiagnostics". * configure: Regenerate. gcc/ChangeLog: * Makefile.in: Rename "libdiagnostics" to "libgdiagnostics". * configure.ac: Likewise. * configure: Regenerate. * doc/install.texi: Rename "libdiagnostics" to "libgdiagnostics". * doc/libdiagnostics/*: Rename to doc/libgdiagnostics, renaming "libdiagnostics" to "libgdiagnostics" throughout. * libdiagnostics++.h: Rename to... * libgdiagnostics++.h: ...this, renaming "libdiagnostics" to "libgdiagnostics" throughout. * libdiagnostics.cc: Rename to... * libgdiagnostics.cc: ...this, renaming "libdiagnostics" to "libgdiagnostics" throughout. * libdiagnostics.h: Rename to... * libgdiagnostics.h: ...this, renaming "libdiagnostics" to "libgdiagnostics" throughout. * libdiagnostics.map: Rename to... * libgdiagnostics.map: ...this, renaming "libdiagnostics" to "libgdiagnostics" throughout. * libsarifreplay.cc: Update for renaming of "libdiagnostics" to "libgdiagnostics". * libsarifreplay.h: Likewise. * sarif-replay.cc: Likewise. gcc/testsuite/ChangeLog: * libdiagnostics.dg/*: Rename to libgdiagnostics.dg, renaming "libdiagnostics" to "libgdiagnostics" throughout. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-11-25nios2: Remove all support for Nios II target.Sandra Loosemore1-3/+0
nios2 target support in GCC was deprecated in GCC 14 as the architecture has been EOL'ed by the vendor. This patch removes the entire port for GCC 15 There are still references to "nios2" in libffi and libgo. Since those libraries are imported into the gcc sources from master copies maintained by other projects, those will need to be addressed elsewhere. ChangeLog: * MAINTAINERS: Remove references to nios2. * configure.ac: Likewise. * configure: Regenerated. config/ChangeLog: * mt-nios2-elf: Deleted. contrib/ChangeLog: * config-list.mk: Remove references to Nios II. gcc/ChangeLog: * common/config/nios2/*: Delete entire directory. * config/nios2/*: Delete entire directory. * config.gcc: Remove references to nios2. * configure.ac: Likewise. * doc/extend.texi: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * regenerate-opt-urls.py: Likewise. * config.in: Regenerated. * configure: Regenerated. gcc/testsuite/ChangeLog: * g++.target/nios2/*: Delete entire directory. * gcc.target/nios2/*: Delete entire directory. * g++.dg/cpp0x/constexpr-rom.C: Remove refences to nios2. * g++.old-deja/g++.jason/thunk3.C: Likewise. * gcc.c-torture/execute/20101011-1.c: Likewise. * gcc.c-torture/execute/pr47237.c: Likewise. * gcc.dg/20020312-2.c: Likewise. * gcc.dg/20021029-1.c: Likewise. * gcc.dg/debug/btf/btf-datasec-1.c: Likewise. * gcc.dg/ifcvt-4.c: Likewise. * gcc.dg/stack-usage-1.c: Likewise. * gcc.dg/struct-by-value-1.c: Likewise. * gcc.dg/tree-ssa/reassoc-33.c: Likewise. * gcc.dg/tree-ssa/reassoc-34.c: Likewise. * gcc.dg/tree-ssa/reassoc-35.c: Likewise. * gcc.dg/tree-ssa/reassoc-36.c: Likewise. * lib/target-supports.exp: Likewise. libgcc/ChangeLog: * config/nios2/*: Delete entire directory. * config.host: Remove refences to nios2. * unwind-dw2-fde-dip.c: Likewise.
2024-11-22Sync top-level configure with binutilsSam James1-3/+18
This syncs us with binutils/gdb's toplevel configure as of 987db70acefd0b223a8df2240d4e5ca544cc0a91. There's not much notable here, just gprofng (which is in binutils) being disabled for musl and a new target which got added on that side too. The only part which may look interesting is the baseargs->bbaseargs change which goes back to Arsen's gettext work and a fixup which landed for that on the binutils side in 9c0aa4c53104b1c4333d55aeaf11b41053307929. * configure: Regenerate. * configure.ac: Sync with Binutils.
2024-11-18Add libdiagnostics (v4)David Malcolm1-0/+42
This patch adds a new libdiagnostics shared library available as part of the GCC build via --enable-libdiagnostics when configuring GCC. It combines the following patches from: https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668632.html [PATCH 1/8] libdiagnostics v4: header [PATCH 2/8] libdiagnostics v4: implementation [PATCH 3/8] libdiagnostics: add API docs [PATCH 4/8] libdiagnostics v4: add C++ wrapper API [PATCH 6/8] libdiagnostics v4: test suite ChangeLog: * configure.ac (--enable-libdiagnostics): New. * configure: Regenerate. gcc/ChangeLog: * configure.ac (check_languages): Add check-libdiagnostics. (--enable-libdiagnostics): New. * configure: Regenerate. * Makefile.in (enable_libdiagnostics): New. (lang_checks): If libdiagnostics is enabled, add check-libdiagnostics. (ALL_HOST_OBJS): If libdiagnostics is enabled, add $(libdiagnostics_OBJS). (start.encap): Add LIBDIAGNOSTICS. (libdiagnostics_OBJS): New. (LIBDIAGNOSTICS_VERSION_NUM): New, adapted from code in jit/Make-lang.in. (LIBDIAGNOSTICS_MINOR_NUM): Likewise. (LIBDIAGNOSTICS_RELEASE_NUM): Likewise. (LIBDIAGNOSTICS_FILENAME): Likewise. (LIBDIAGNOSTICS_IMPORT_LIB): Likewise. (libdiagnostics): Likewise. (LIBDIAGNOSTICS_AGE): Likewise. (LIBDIAGNOSTICS_BASENAME): Likewise. (LIBDIAGNOSTICS_SONAME): Likewise. (LIBDIAGNOSTICS_LINKER_NAME): Likewise. (LIBDIAGNOSTICS_COMMA): Likewise. (LIBDIAGNOSTICS_VERSION_SCRIPT_OPTION): Likewise. (LIBDIAGNOSTICS_SONAME_OPTION): Likewise. (LIBDIAGNOSTICS_SONAME_SYMLINK): Likewise. (LIBDIAGNOSTICS_LINKER_NAME_SYMLINK): Likewise. (LIBDIAGNOSTICS_FILENAME): Likewise. (libdiagnostics.serial): Likewise. (LIBDIAGNOSTICS_EXTRA_OPTS): Likewise. (install): If libdiagnostics is enabled, add install-libdiagnostics. (libdiagnostics.install-headers): New. (libdiagnostics.install-common): New, adapted from code in jit/Make-lang.in. (install-libdiagnostics): New. * diagnostic-format-text.h (diagnostic_text_output_format::get_location_text): Make public. * doc/install.texi (--enable-libdiagnostics): New. * doc/libdiagnostics/Makefile: New file. * doc/libdiagnostics/conf.py: New file. * doc/libdiagnostics/index.rst: New file. * doc/libdiagnostics/make.bat: New file. * doc/libdiagnostics/topics/diagnostic-manager.rst: New file. * doc/libdiagnostics/topics/diagnostics.rst: New file. * doc/libdiagnostics/topics/execution-paths.rst: New file. * doc/libdiagnostics/topics/fix-it-hints.rst: New file. * doc/libdiagnostics/topics/index.rst: New file. * doc/libdiagnostics/topics/logical-locations.rst: New file. * doc/libdiagnostics/topics/message-formatting.rst: New file. * doc/libdiagnostics/topics/metadata.rst: New file. * doc/libdiagnostics/topics/physical-locations.rst: New file. * doc/libdiagnostics/topics/retrofitting.rst: New file. * doc/libdiagnostics/topics/sarif.rst: New file. * doc/libdiagnostics/topics/text-output.rst: New file. * doc/libdiagnostics/topics/ux.rst: New file. * doc/libdiagnostics/tutorial/01-hello-world.rst: New file. * doc/libdiagnostics/tutorial/02-physical-locations.rst: New file. * doc/libdiagnostics/tutorial/03-logical-locations.rst: New file. * doc/libdiagnostics/tutorial/04-notes.rst: New file. * doc/libdiagnostics/tutorial/05-warnings.rst: New file. * doc/libdiagnostics/tutorial/06-fix-it-hints.rst: New file. * doc/libdiagnostics/tutorial/07-execution-paths.rst: New file. * doc/libdiagnostics/tutorial/index.rst: New file. * libdiagnostics++.h: New file. * libdiagnostics.cc: New file. * libdiagnostics.h: New file. * libdiagnostics.map: New file. gcc/testsuite/ChangeLog: * libdiagnostics.dg/libdiagnostics.exp: New, adapted from jit.exp. * libdiagnostics.dg/sarif.py: New. * libdiagnostics.dg/test-dump.c: New test. * libdiagnostics.dg/test-error-c.py: New test. * libdiagnostics.dg/test-error-with-note-c.py: New test. * libdiagnostics.dg/test-error-with-note.c: New test. * libdiagnostics.dg/test-error-with-note.cc: New test. * libdiagnostics.dg/test-error.c: New test. * libdiagnostics.dg/test-error.cc: New test. * libdiagnostics.dg/test-example-1.c: New test. * libdiagnostics.dg/test-fix-it-hint-c.py: New test. * libdiagnostics.dg/test-fix-it-hint.c: New test. * libdiagnostics.dg/test-fix-it-hint.cc: New test. * libdiagnostics.dg/test-helpers++.h: New test. * libdiagnostics.dg/test-helpers.h: New test. * libdiagnostics.dg/test-labelled-ranges.c: New test. * libdiagnostics.dg/test-labelled-ranges.cc: New test. * libdiagnostics.dg/test-labelled-ranges.py: New test. * libdiagnostics.dg/test-logical-location-c.py: New test. * libdiagnostics.dg/test-logical-location.c: New test. * libdiagnostics.dg/test-metadata-c.py: New test. * libdiagnostics.dg/test-metadata.c: New test. * libdiagnostics.dg/test-multiple-lines-c.py: New test. * libdiagnostics.dg/test-multiple-lines.c: New test. * libdiagnostics.dg/test-no-column-c.py: New test. * libdiagnostics.dg/test-no-column.c: New test. * libdiagnostics.dg/test-no-diagnostics-c.py: New test. * libdiagnostics.dg/test-no-diagnostics.c: New test. * libdiagnostics.dg/test-note-with-fix-it-hint-c.py: New test. * libdiagnostics.dg/test-note-with-fix-it-hint.c: New test. * libdiagnostics.dg/test-text-sink-options.c: New test. * libdiagnostics.dg/test-warning-c.py: New test. * libdiagnostics.dg/test-warning-with-path-c.py: New test. * libdiagnostics.dg/test-warning-with-path.c: New test. * libdiagnostics.dg/test-warning.c: New test. * libdiagnostics.dg/test-write-sarif-to-file-c.py: New test. * libdiagnostics.dg/test-write-sarif-to-file.c: New test. * libdiagnostics.dg/test-write-text-to-file.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-11-05Deprecate the ARM simulatorNick Clifton1-1/+8
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-05 Nick Clifton <nickc@redhat.com> * configure.ac: Add sim to noconfigdirs for ARM targets. * configure: Regenerate.
2024-10-28build: update bootstrap req to C++14Jason Merrill1-56/+776
We moved to a bootstrap requirement of C++11 in GCC 11, 8 years after support was stable in GCC 4.8. It is now 8 years since C++14 was the default mode in GCC 6 (and 9 years since support was complete in GCC 5), and we have a few bits of optional C++14 code in the compiler, so it seems a good time to update the bootstrap requirement again. The big benefit of the change is the greater constexpr power, but C++14 also added variable templates, generic lambdas, lambda init-capture, binary literals, and numeric literal digit separators. C++14 was feature-complete in GCC 5, and became the default in GCC 6. 5.4.0 bootstraps trunk correctly; trunk stage1 built with 5.3.0 breaks in eh_data_format_name due to PR69995. gcc/ChangeLog: * doc/install.texi (Prerequisites): Update to C++14. ChangeLog: * configure.ac: Update requirement to C++14. * configure: Regenerate.
2024-10-25toplevel: Error out if using --disable-libstdcxx with bootstrap [PR105474]Andrew Pinski1-0/+9
Bootstrapping and using --disable-libstdcxx will cause a build failure deep in compiling stage2 so instead error out early in the toplevel configure so it is more user friendly. Bootstrapped and tested on x86_64-linux-gnu. Also made sure --disable-libstdcxx without --disable-bootstrap failed. PR bootstrap/105474 ChangeLog: * configure: Regenerate. * configure.ac: Error out if libstdc++ is not enabled with bootstrapping. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-09-18[PATCH] configure: fix typosAndrew Kreimer1-1/+1
/ * configure.ac: Fix typos. * configure: Rebuilt.
2024-09-04rust: avoid clobbering LIBSMarc Poulhiès1-7/+8
Save LIBS around calls to AC_SEARCH_LIBS to avoid clobbering $LIBS. ChangeLog: * configure: Regenerate. * configure.ac: Save LIBS around calls to AC_SEARCH_LIBS. Signed-off-by: Marc Poulhiès <dkm@kataplop.net> Reviewed-by: Thomas Schwinge <tschwinge@baylibre.com> Tested-by: Thomas Schwinge <tschwinge@baylibre.com>
2024-06-20build: Fix missing variable quotes and typoCollin Funk1-4/+4
When dlopen and pthread_create are in libc the variable is set to "none required", therefore running configure will show the following errors: ./configure: line 8997: test: too many arguments ./configure: line 8999: test: too many arguments ./configure: line 9003: test: too many arguments ./configure: line 9005: test: =: unary operator expected ChangeLog: PR bootstrap/115453 * configure.ac: Quote variable result of AC_SEARCH_LIBS. Fix typo ac_cv_search_pthread_crate. * configure: Regenerate. Signed-off-by: Collin Funk <collin.funk1@gmail.com>
2024-06-20Revert "build: Fix missing variable quotes"YunQiang Su1-5/+5
This reverts commit c6a9ab8c920f297c4efd289182aef9fbc73f5906.
2024-06-20Revert "Build: Fix typo ac_cv_search_pthread_crate"YunQiang Su1-1/+1
This reverts commit 8088374a868aacab4dff208ec3e3fde790a1d9a3.
2024-06-19Build: Fix typo ac_cv_search_pthread_crateYunQiang Su1-1/+1
The correct variable name is ac_cv_search_pthread_create ChangeLog: PR bootstrap/115453 * configure.ac: Fix typo ac_cv_search_pthread_crate. * configure: Regnerate.
2024-06-19build: Fix missing variable quotesCollin Funk1-5/+5
When dlopen and pthread_create are in libc the variable is set to "none required", therefore running configure will show the following errors: ./configure: line 8997: test: too many arguments ./configure: line 8999: test: too many arguments ./configure: line 9003: test: too many arguments ./configure: line 9005: test: =: unary operator expected gcc/configure also has a similar problem on gcc_cv_as_mips_explicit_relocs: ./gcc/configure: line 30242: test: =: unary operator expected ChangeLog: * configure.ac: Quote variable result of AC_SEARCH_LIBS. * configure: Regenerate. gcc/ChangeLog: * configure.ac: Add missing quotation of variable gcc_cv_as_mips_explicit_relocs. * configure: Regenerate. Signed-off-by: Collin Funk <collin.funk1@gmail.com>
2024-06-11rust: Do not link with libdl and libpthread unconditionallyArthur Cohen1-0/+154
ChangeLog: * Makefile.tpl: Add CRAB1_LIBS variable. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Check if -ldl and -lpthread are needed, and if so, add them to CRAB1_LIBS. gcc/rust/ChangeLog: * Make-lang.in: Remove overazealous LIBS = -ldl -lpthread line, link crab1 against CRAB1_LIBS.
2024-04-16build: Use of cargo not yet supported here in Canadian cross configurationsThomas Schwinge1-0/+13
..., until <https://github.com/Rust-GCC/gccrs/issues/2898> "'cargo' should build for the host system" is resolved. Follow-up to commit 3e1e73fc99584440e5967577f2049573eeaf4596 "build: Check for cargo when building rust language". * configure.ac (have_cargo): Force to "no" in Canadian cross configurations * configure: Regenerate.
2024-04-16build: Don't check for host-prefixed 'cargo' programThomas Schwinge1-57/+7
Follow-up to commit 3e1e73fc99584440e5967577f2049573eeaf4596 "build: Check for cargo when building rust language": On 2024-04-15T13:14:42+0200, I wrote: > I now wonder: instead of 'AC_CHECK_TOOL', shouldn't this use > 'AC_CHECK_PROG'? (We always want plain 'cargo', not host-prefixed > 'aarch64-linux-gnu-cargo' etc., right?) I'll look into changing this. * configure: Regenerate. config/ * acx.m4 (ACX_PROG_CARGO): Use 'AC_CHECK_PROGS'.
2024-04-15build: Check for cargo when building rust languagePierre-Emmanuel Patry1-0/+117
Prevent rust language from building when cargo is missing. config/ChangeLog: * acx.m4: Add a macro to check for rust components. ChangeLog: * configure: Regenerate. * configure.ac: Emit an error message when cargo is missing. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-02-23LoongArch: Don't falsely claim gold supported in toplevel configureXi Ruoyao1-1/+1
The gold linker has never been ported to LoongArch (and it seems unlikely to be ported in the future as the new architectures are focusing on lld and/or mold for fast linkers). ChangeLog: * configure.ac (ENABLE_GOLD): Remove loongarch*-*-* from target list. * configure: Regenerate.
2023-12-14build: Add libgrust as compilation modulesPierre-Emmanuel Patry1-1/+13
Define the libgrust directory as a host compilation module as well as for targets. Disable target libgrust if we're not building target libstdc++. ChangeLog: * Makefile.def: Add libgrust as host & target module. * configure.ac: Add libgrust to host tools list. Add libgrust to noconfigdirs if we're not building target libstdc++. * Makefile.in: Regenerate. * configure: Regenerate. gcc/rust/ChangeLog: * config-lang.in: Add libgrust as a target module for the rust language. Co-authored-by: Thomas Schwinge <thomas@codesourcery.com> Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2023-11-14*: add modern gettextArsen Arsenović1-11/+33
This patch updates gettext.m4 and related .m4 files and adds gettext-runtime as a gmp/mpfr/... style host library, allowing newer libintl to be used. This patch /does not/ add build-time tools required for internationalizing (msgfmt et al), instead, it just updates the runtime library. The result should be a distribution that acts exactly the same when a copy of gettext is present, and disables internationalization otherwise. There should be no changes in behavior when gettext is included in-tree. When gettext is not included in tree, nor available on the system, the programs will be built without localization. ChangeLog: PR bootstrap/12596 * .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. config/ChangeLog: * intlmacosx.m4: Import from gettext-0.22 (serial 8). * gettext.m4: Sync with gettext-0.22 (serial 77). * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Load gettext's uninstalled-config.sh, or call AM_GNU_GETTEXT if missing. * iconv.m4: Sync with gettext-0.22 (serial 26). contrib/ChangeLog: * prerequisites.sha512: Add gettext. * prerequisites.md5: Add gettext. * download_prerequisites: Add gettext. gcc/ChangeLog: * configure: Regenerate. * aclocal.m4: Regenerate. * Makefile.in (LIBDEPS): Remove (potential) ./ prefix from LIBINTL_DEP. * doc/install.texi: Document new (notable) flags added by the optional gettext tree and by AM_GNU_GETTEXT. Document libintl/libc with gettext dependency. libcpp/ChangeLog: * configure: Regenerate. * aclocal.m4: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate.
2023-10-22Config,Darwin: Allow for configuring Darwin to use embedded runpath.Iain Sandoe1-0/+14
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). ChangeLog: * configure: Regenerate. * configure.ac: Do not add default runpaths to GCC exes when we are building -static-libstdc++/-static-libgcc (the default). * libtool.m4: Add 'enable-darwin-at-runpath'. Act on the enable flag to alter Darwin libraries to use @rpath names. gcc/ChangeLog: * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * config/darwin.h: Handle Darwin rpaths. * config/darwin.opt: Handle Darwin rpaths. * Makefile.in: Handle Darwin rpaths. gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Handle Darwin rpaths. gcc/jit/ChangeLog: * Make-lang.in: Handle Darwin rpaths. libatomic/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libbacktrace/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. libgcc/ChangeLog: * config/t-slibgcc-darwin: Generate libgcc_s with an @rpath name. * config.host: Handle Darwin rpaths. libgfortran/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libgm2/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libm2cor/Makefile.am: Handle Darwin rpaths. * libm2cor/Makefile.in: Regenerate. * libm2iso/Makefile.am: Handle Darwin rpaths. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.am: Handle Darwin rpaths. * libm2log/Makefile.in: Regenerate. * libm2min/Makefile.am: Handle Darwin rpaths. * libm2min/Makefile.in: Regenerate. * libm2pim/Makefile.am: Handle Darwin rpaths. * libm2pim/Makefile.in: Regenerate. libgomp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libitm/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libobjc/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libdruntime/Makefile.am: Handle Darwin rpaths. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libquadmath/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libsanitizer/ChangeLog: * asan/Makefile.am: Handle Darwin rpaths. * asan/Makefile.in: Regenerate. * configure: Regenerate. * hwasan/Makefile.am: Handle Darwin rpaths. * hwasan/Makefile.in: Regenerate. * lsan/Makefile.am: Handle Darwin rpaths. * lsan/Makefile.in: Regenerate. * tsan/Makefile.am: Handle Darwin rpaths. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.am: Handle Darwin rpaths. * ubsan/Makefile.in: Regenerate. libssp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libstdc++-v3/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libvtv/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. lto-plugin/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. zlib/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths.
2023-09-15LoongArch: Reimplement multilib build option handling.Yang Yujie1-0/+6
Library build options from --with-multilib-list used to be processed with *self_spec, which missed the driver's initial canonicalization. This caused limitations on CFLAGS override and the use of driver-only options like -m[no]-lsx. The problem is solved by promoting the injection rules of --with-multilib-list options to the first element of DRIVER_SELF_SPECS, to make them execute before the canonialization. The library-build options are also hard-coded in the driver and can be used conveniently by the builders of other non-gcc libraries via the use of -fmultiflags. Bootstrapped and tested on loongarch64-linux-gnu. ChangeLog: * config-ml.in: Remove unneeded loongarch clause. * configure.ac: Register custom makefile fragments mt-loongarch-* for loongarch targets. * configure: Regenerate. config/ChangeLog: * mt-loongarch-mlib: New file. Pass -fmultiflags when building target libraries (FLAGS_FOR_TARGET). * mt-loongarch-elf: New file. * mt-loongarch-gnu: New file. gcc/ChangeLog: * config.gcc: Pass the default ABI via TM_MULTILIB_CONFIG. * config/loongarch/loongarch-driver.h: Invoke MLIB_SELF_SPECS before the driver canonicalization routines. * config/loongarch/loongarch.h: Move definitions of CC1_SPEC etc. to loongarch-driver.h * config/loongarch/t-linux: Move multilib-related definitions to t-multilib. * config/loongarch/t-multilib: New file. Inject library build options obtained from --with-multilib-list. * config/loongarch/t-loongarch: Same.
2023-08-07Add support for the haiku operating systemAlexander von Gluck IV1-1/+1
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. ChangeLog: * configure: Regenerate. * configure.ac: Add Haiku to list of ELF OSes * libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgm2/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate. zlib/ChangeLog: * configure: Regenerate.
2023-08-07configure: reinstate 32b PA-RISC HP-UX target in toplevelArsen Arsenović1-0/+10
The Binutils still support this target. ChangeLog: * configure.ac: Reinstate 32b PA-RISC HP-UX targets * configure: Regenerate.
2023-08-07Pass PKG_CONFIG_PATH down from top-level MakefileSimon Marchi1-0/+2
[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. Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf 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.
2023-08-07Disable year 2038 support on 32-bit hosts by defaultLuis Machado1-0/+22
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? ChangeLog: * configure.ac: Disable year2038 by default on 32-bit hosts. * configure: Regenerate.
2023-08-07gprofng: a new GNU profilerVladimir Mezentsev1-0/+18
ChangeLog: * Makefile.def: Add gprofng module. * configure.ac: Add --enable-gprofng option. * Makefile.in: Regenerate. * configure: Regenerate. include/ChangeLog: * collectorAPI.h: New file. * libcollector.h: New file. * libfcollector.h: New file.
2023-08-07add --enable-default-compressed-debug-sections-algorithm configure optionMartin Liska1-0/+13
ChangeLog: * configure.ac: Add --enable-default-compressed-debug-sections-algorithm. * configure: Regenerate.
2023-08-07binutils, gdb: support zstd compressed debug sectionsFangrui Song1-0/+10
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 ... ``` config/ChangeLog: * zstd.m4: New file. ChangeLog: * configure: Regenerate. * configure.ac: Add --with-zstd.
2023-08-07toplevel: Recover tilegx/tilepro targetsArsen Arsenović1-1/+4
These are still supported in Binutils. ChangeLog: * configure: Regenerate. * configure.ac: Recover tilegx/tilepro targets.
2023-08-07GCC: Check if AR works with --plugin and rcH.J. Lu1-0/+103
AR from older binutils doesn't work with --plugin and rc: [hjl@gnu-cfl-2 bin]$ touch foo.c [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c [hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c ./ar: no operation specified [hjl@gnu-cfl-2 bin]$ ./ar --version GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112 Copyright (C) 2018 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. [hjl@gnu-cfl-2 bin]$ Check if AR works with --plugin and rc before passing --plugin to AR and RANLIB. ChangeLog: * configure: Regenerated. * libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with --plugin and rc before enabling --plugin. config/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with --plugin and rc before enabling --plugin. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgm2/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libiberty/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate. zlib/ChangeLog: * configure: Regenerate.
2023-08-07Sync with binutils: GCC: Pass --plugin to AR and RANLIBH.J. Lu1-0/+39
Sync with binutils for building binutils with LTO: 50ad1254d50 GCC: Pass --plugin to AR and RANLIB Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. ChangeLog: * 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/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New. libiberty/ChangeLog: * Makefile.in (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. (configure_deps): Depend on ../config/gcc-plugin.m4. * configure.ac: AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * aclocal.m4: Regenerated. * configure: Likewise. zlib/ChangeLog: * configure: Regenerated. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgm2/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate.
2023-07-31Use substituted GDCFLAGSAndreas Schwab1-0/+1
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}. * configure: Regenerate. * Makefile.in (GDCFLAGS): Substitute @GDCFLAGS@.
2023-06-25configure, Darwin: Ensure overrides to host-pie are passed to gcc configure.Iain Sandoe1-12/+36
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> ChangeLog: * Makefile.def: Pass the enable-host-pie value to GCC configure. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Adjust the logic for shared and PIE host flags to ensure that PIE is passed for hosts that require it.
2023-06-15configure: Implement --enable-host-pieMarek Polacek1-2/+47
[ This is my third attempt to add this configure option. The first version was approved but it came too late in the development cycle. The second version was also approved, but I had to revert it: <https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607082.html>. I've fixed the problem (by moving $(PICFLAG) from INTERNAL_CFLAGS to ALL_COMPILERFLAGS). Another change is that since r13-4536 I no longer need to touch Makefile.def, so this patch is simplified. ] 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. It is similar to the option --enable-host-shared, except that --e-h-s won't add -shared to the linker flags whereas --e-h-p will add -pie. It is different from --enable-default-pie because that option just adds an implicit -fPIE/-pie when the compiler is invoked, but the compiler itself isn't PIE. Since r12-5768-gfe7c3ecf, PCH works well with PIE, so there are no PCH regressions. When building the compiler, the build process may use various in-tree libraries; these need to be built with -fPIE so that it's possible to use them when building a PIE. For instance, when --with-included-gettext is in effect, intl object files must be compiled with -fPIE. Similarly, when building in-tree gmp, isl, mpfr and mpc, they must be compiled with -fPIE. With this patch and --enable-host-pie used to configure gcc: $ file gcc/cc1{,plus,obj,gm2} gcc/f951 gcc/lto1 gcc/cpp gcc/go1 gcc/rust1 gcc/gnat1 gcc/cc1: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=98e22cde129d304aa6f33e61b1c39e144aeb135e, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/cc1plus: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=859d1ea37e43dfe50c18fd4e3dd9a34bb1db8f77, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/cc1obj: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1964f8ecee6163182bc26134e2ac1f324816e434, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/cc1gm2: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a396672c7ff913d21855829202e7b02ecf42ff4c, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/f951: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=59c523db893186547ac75c7a71f48be0a461c06b, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/lto1: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=084a7b77df7be2d63c2d4c655b5bbc3fcdb6038d, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/cpp: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=3503bf8390d219a10d6653b8560aa21158132168, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/go1: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=988cc673af4fba5dcb482f4b34957b99050a68c5, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/rust1: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b6a5d3d514446c4dcdee0707f086ab9b274a8a3c, for GNU/Linux 3.2.0, with debug_info, not stripped gcc/gnat1: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb11ccdc2c366fe3fe0980476bcd8ca19b67f9dc, for GNU/Linux 3.2.0, with debug_info, not stripped I plan to add an option to link with -Wl,-z,now. Bootstrapped on x86_64-pc-linux-gnu with --with-included-gettext --enable-host-pie as well as without --enable-host-pie. Also tested on a Debian system where the system gcc was configured with --enable-default-pie. Co-Authored by: Iain Sandoe <iain@sandoe.co.uk> ChangeLog: * configure.ac (--enable-host-pie): New check. Set PICFLAG after this check. * configure: Regenerate. c++tools/ChangeLog: * Makefile.in: Rename PIEFLAG to PICFLAG. Set LD_PICFLAG. Use it. Use pic/libiberty.a if PICFLAG is set. * configure.ac (--enable-default-pie): Set PICFLAG instead of PIEFLAG. (--enable-host-pie): New check. * configure: Regenerate. fixincludes/ChangeLog: * Makefile.in: Set and use PICFLAG and LD_PICFLAG. Use the "pic" build of libiberty if PICFLAG is set. * configure.ac: * configure: Regenerate. gcc/ChangeLog: * Makefile.in: Set LD_PICFLAG. Use it. Set enable_host_pie. Remove NO_PIE_CFLAGS and NO_PIE_FLAG. Pass LD_PICFLAG to ALL_LINKERFLAGS. Use the "pic" build of libiberty if --enable-host-pie. * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG and LD_PICFLAG after this check. * configure: Regenerate. * doc/install.texi: Document --enable-host-pie. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in (ALL_ADAFLAGS): Remove NO_PIE_CFLAGS. Add PICFLAG. Use PICFLAG when building ada/b_gnat1.o and ada/b_gnatb.o. * gcc-interface/Makefile.in: Use pic/libiberty.a if PICFLAG is set. Remove NO_PIE_FLAG. gcc/m2/ChangeLog: * Make-lang.in: New var, GM2_PICFLAGS. Use it. gcc/d/ChangeLog: * Make-lang.in: Remove NO_PIE_CFLAGS. intl/ChangeLog: * Makefile.in: Use @PICFLAG@ in COMPILE as well. * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG after this check. * configure: Regenerate. libcody/ChangeLog: * Makefile.in: Pass LD_PICFLAG to LDFLAGS. * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG and LD_PICFLAG after this check. * configure: Regenerate. libcpp/ChangeLog: * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG after this check. * configure: Regenerate. libdecnumber/ChangeLog: * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG after this check. * configure: Regenerate. libiberty/ChangeLog: * configure.ac: Also set shared when enable_host_pie. * configure: Regenerate. zlib/ChangeLog: * configure.ac (--enable-host-shared): Don't set PICFLAG here. (--enable-host-pie): New check. Set PICFLAG after this check. * configure: Regenerate.