Commit Graph

788 Commits

Author SHA1 Message Date
Iain Sandoe
05048fc29f 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>

ChangeLog:

	* Makefile.def: Pass host_libs_picflag to host dependent library
	configures.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (host_libs_picflag): New configure variable set to
	'--with-pic' when building 'host_shared'.
2022-12-07 11:16:31 +00:00
Weimin Pan
3de627ffe4 sync libsframe toplevel from binutils-gdb
This pulls in the toplevel portion of this binutils-gdb commit:
   19e559f1c91bfaedbd2f91d85ee161f3f03fda3c libsframe: add the SFrame library

ChangeLog:
	* Makefile.def: Add libsframe as new module with its dependencies.
	* Makefile.in: Regenerated.
	* configure.ac: Add libsframe to host_libs.
	* configure: Regenerated.
2022-11-25 15:48:03 +00:00
Marek Polacek
04711f5189 Revert "configure: Implement --enable-host-pie"
This reverts commit 251c72a68a.
2022-11-22 21:10:31 -05:00
Marek Polacek
251c72a68a 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.

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.

I plan to add an option to link with -Wl,-z,now.

ChangeLog:

	* Makefile.def: Pass $(PICFLAG) to AM_CFLAGS for gmp, mpfr, mpc, and
	isl.
	* Makefile.in: Regenerate.
	* Makefile.tpl: Set PICFLAG.
	* 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/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.
2022-11-22 20:32:18 -05:00
Martin Liska
4e3dcf2076 Revert "sphinx: support Sphinx in build system"
This reverts commit 41a45cba00.
2022-11-14 09:35:06 +01:00
Martin Liska
45ab87d4f3 Revert "docs: fix links pointing to gcc.gnu.org/install"
This reverts commit 0b3d926d79.
2022-11-14 09:35:04 +01:00
Martin Liska
0b3d926d79 docs: fix links pointing to gcc.gnu.org/install
Use https://gcc.gnu.org/onlinedocs/install/ instead.

ChangeLog:

	* configure.ac: Use new install URL.
	* configure: Regenerate.

gcc/ChangeLog:

	* Makefile.in: Use new install URL.
	* doc/gcc/gcc-command-options/machine-dependent-options/avr-options.rst:
	Use intersphinx link.
	* doc/gcc/gcc-command-options/options-to-control-diagnostic-messages-formatting.rst:
	Use new URL.
	* doc/gccint/source-tree-structure-and-build-system.rst: Use
	intersphinx link.
	* doc/install/host-target-specific-installation-notes-for-gcc.rst: Likewise.
	* doc/install/installing-gcc.rst: Likewise.
2022-11-09 15:38:47 +01:00
Martin Liska
41a45cba00 sphinx: support Sphinx in build system
config/ChangeLog:

	* acx.m4: Do not wrap REPORT_BUGS_TO.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Support Sphinx based documentation.

gcc/ChangeLog:

	* Makefile.in: Support Sphinx based documentation.
	* configure: Regenerate.
	* configure.ac: Support Sphinx based documentation.
	* genhooks.cc (struct s_hook): Emit tm.rst.in file.

gcc/cp/ChangeLog:

	* Make-lang.in: Support Sphinx based documentation.

gcc/d/ChangeLog:

	* Make-lang.in: Support Sphinx based documentation.

gcc/fortran/ChangeLog:

	* Make-lang.in: Support Sphinx based documentation.

gcc/go/ChangeLog:

	* Make-lang.in: Support Sphinx based documentation.

libgomp/ChangeLog:

	* Makefile.in: Support Sphinx based documentation.

libiberty/ChangeLog:

	* Makefile.in: Support Sphinx based documentation.

libitm/ChangeLog:

	* Makefile.in: Support Sphinx based documentation.

libquadmath/ChangeLog:

	* Makefile.in: Support Sphinx based documentation.
2022-11-09 09:00:35 +01:00
Thomas Schwinge
e4cba49413 Remove support for Intel MIC offloading
... after its deprecation in GCC 12.

	* Makefile.def: Remove module 'liboffloadmic'.
	* Makefile.in: Regenerate.
	* configure.ac: Remove 'liboffloadmic' handling.
	* configure: Regenerate.
	contrib/
	* gcc-changelog/git_commit.py (default_changelog_locations):
	Remove 'liboffloadmic'.
	* gcc_update (files_and_dependencies): Remove 'liboffloadmic'
	files.
	* update-copyright.py (GCCCmdLine): Remove 'liboffloadmic'
	comment.
	gcc/
	* config.gcc [target *-intelmic-* | *-intelmicemul-*]: Remove.
	* config/i386/i386-options.cc (ix86_omp_device_kind_arch_isa)
	[ACCEL_COMPILER]: Remove.
	* config/i386/intelmic-mkoffload.cc: Remove.
	* config/i386/intelmic-offload.h: Likewise.
	* config/i386/t-intelmic: Likewise.
	* config/i386/t-omp-device: Likewise.
	* configure.ac [target *-intelmic-* | *-intelmicemul-*]: Remove.
	* configure: Regenerate.
	* doc/install.texi (--enable-offload-targets=[...]): Update.
	* doc/sourcebuild.texi: Remove 'liboffloadmic' documentation.
	include/
	* gomp-constants.h (GOMP_DEVICE_INTEL_MIC): Comment out.
	(GOMP_VERSION_INTEL_MIC): Remove.
	libgomp/
	* libgomp-plugin.h (OFFLOAD_TARGET_TYPE_INTEL_MIC): Remove.
	* libgomp.texi (OpenMP Context Selectors): Remove Intel MIC
	documentation.
	* plugin/configfrag.ac <enable_offload_targets>
	[*-intelmic-* | *-intelmicemul-*]: Remove.
	* configure: Regenerate.
	* testsuite/lib/libgomp.exp (libgomp_init): Remove 'liboffloadmic'
	handling.
	(offload_target_to_openacc_device_type)
	[$offload_target = *-intelmic*]: Remove.
	(check_effective_target_offload_device_intel_mic)
	(check_effective_target_offload_device_any_intel_mic): Remove.
	* testsuite/libgomp.c-c++-common/on_device_arch.h
	(device_arch_intel_mic, on_device_arch_intel_mic, any_device_arch)
	(any_device_arch_intel_mic): Remove.
	* testsuite/libgomp.c-c++-common/target-45.c: Remove
	'offload_device_any_intel_mic' XFAIL.
	* testsuite/libgomp.fortran/target10.f90: Likewise.
	liboffloadmic/
	* ChangeLog: Remove.
	* Makefile.am: Likewise.
	* Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* configure.ac: Likewise.
	* configure.tgt: Likewise.
	* doc/doxygen/config: Likewise.
	* doc/doxygen/header.tex: Likewise.
	* include/coi/common/COIEngine_common.h: Likewise.
	* include/coi/common/COIEvent_common.h: Likewise.
	* include/coi/common/COIMacros_common.h: Likewise.
	* include/coi/common/COIPerf_common.h: Likewise.
	* include/coi/common/COIResult_common.h: Likewise.
	* include/coi/common/COISysInfo_common.h: Likewise.
	* include/coi/common/COITypes_common.h: Likewise.
	* include/coi/sink/COIBuffer_sink.h: Likewise.
	* include/coi/sink/COIPipeline_sink.h: Likewise.
	* include/coi/sink/COIProcess_sink.h: Likewise.
	* include/coi/source/COIBuffer_source.h: Likewise.
	* include/coi/source/COIEngine_source.h: Likewise.
	* include/coi/source/COIEvent_source.h: Likewise.
	* include/coi/source/COIPipeline_source.h: Likewise.
	* include/coi/source/COIProcess_source.h: Likewise.
	* liboffloadmic_host.spec.in: Likewise.
	* liboffloadmic_target.spec.in: Likewise.
	* plugin/Makefile.am: Likewise.
	* plugin/Makefile.in: Likewise.
	* plugin/aclocal.m4: Likewise.
	* plugin/configure: Likewise.
	* plugin/configure.ac: Likewise.
	* plugin/libgomp-plugin-intelmic.cpp: Likewise.
	* plugin/offload_target_main.cpp: Likewise.
	* runtime/cean_util.cpp: Likewise.
	* runtime/cean_util.h: Likewise.
	* runtime/coi/coi_client.cpp: Likewise.
	* runtime/coi/coi_client.h: Likewise.
	* runtime/coi/coi_server.cpp: Likewise.
	* runtime/coi/coi_server.h: Likewise.
	* runtime/compiler_if_host.cpp: Likewise.
	* runtime/compiler_if_host.h: Likewise.
	* runtime/compiler_if_target.cpp: Likewise.
	* runtime/compiler_if_target.h: Likewise.
	* runtime/dv_util.cpp: Likewise.
	* runtime/dv_util.h: Likewise.
	* runtime/emulator/coi_common.h: Likewise.
	* runtime/emulator/coi_device.cpp: Likewise.
	* runtime/emulator/coi_device.h: Likewise.
	* runtime/emulator/coi_host.cpp: Likewise.
	* runtime/emulator/coi_host.h: Likewise.
	* runtime/emulator/coi_version_asm.h: Likewise.
	* runtime/emulator/coi_version_linker_script.map: Likewise.
	* runtime/liboffload_error.c: Likewise.
	* runtime/liboffload_error_codes.h: Likewise.
	* runtime/liboffload_msg.c: Likewise.
	* runtime/liboffload_msg.h: Likewise.
	* runtime/mic_lib.f90: Likewise.
	* runtime/offload.h: Likewise.
	* runtime/offload_common.cpp: Likewise.
	* runtime/offload_common.h: Likewise.
	* runtime/offload_engine.cpp: Likewise.
	* runtime/offload_engine.h: Likewise.
	* runtime/offload_env.cpp: Likewise.
	* runtime/offload_env.h: Likewise.
	* runtime/offload_host.cpp: Likewise.
	* runtime/offload_host.h: Likewise.
	* runtime/offload_iterator.h: Likewise.
	* runtime/offload_omp_host.cpp: Likewise.
	* runtime/offload_omp_target.cpp: Likewise.
	* runtime/offload_orsl.cpp: Likewise.
	* runtime/offload_orsl.h: Likewise.
	* runtime/offload_table.cpp: Likewise.
	* runtime/offload_table.h: Likewise.
	* runtime/offload_target.cpp: Likewise.
	* runtime/offload_target.h: Likewise.
	* runtime/offload_target_main.cpp: Likewise.
	* runtime/offload_timer.h: Likewise.
	* runtime/offload_timer_host.cpp: Likewise.
	* runtime/offload_timer_target.cpp: Likewise.
	* runtime/offload_trace.cpp: Likewise.
	* runtime/offload_trace.h: Likewise.
	* runtime/offload_util.cpp: Likewise.
	* runtime/offload_util.h: Likewise.
	* runtime/ofldbegin.cpp: Likewise.
	* runtime/ofldend.cpp: Likewise.
	* runtime/orsl-lite/include/orsl-lite.h: Likewise.
	* runtime/orsl-lite/lib/orsl-lite.c: Likewise.
	* runtime/orsl-lite/version.txt: Likewise.
2022-11-04 10:51:01 +01:00
Дилян Палаузов
36ba985145 Don't build readline/libreadline.a, when --with-system-readline is supplied
https://sourceware.org/bugzilla/show_bug.cgi?id=18632

The bundled libreadline is always built, even if the system is
./configure'd --with-system-readline and the build libreadline.a is not
used.

Proposed patch:

Fix ./configure.ac not to proceed readline/, when --with-system-
readline is provided

	* configure.ac: Don't configure readline if --with-system-readline is
	used.
	* configure: Re-generate.
2022-10-21 08:51:16 +02:00
Olivier Hainque
9b8ffbb8a0 Arrange to --disable-shared by default for VxWorks
This change makes sure that shared libraries for VxWorks are
only built on explicit request, when configured with --enable-shared.

As the support to build shared libs gets in very incrementally,
this provides us with a robust way to guard the relevant pieces
and reduce the risks of accidentally breaking a platform not yet
ready for it.

2022-09-30  Olivier Hainque  <hainque@adacore.com>

	* configure.ac (*vxworks*): If enable_shared is not
	set, set to "no" and add --disable-shared to target and
	host_configargs.
	* configure: Regenerate.
2022-09-30 10:43:13 +00:00
Tom de Vries
04bb15e48e [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 a08bdb159bb ("[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-09-07  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-09-07 13:19:05 +02:00
Martin Liska
dc832fb39f 32-bit PA-RISC with HP-UX: remove deprecated ports
ChangeLog:

	* configure: Regenerate.
	* configure.ac: Delete hpux9 and hpux10.

config/ChangeLog:

	* mh-pa-hpux10: Removed.

contrib/ChangeLog:

	* config-list.mk: Remove deprecated ports.

contrib/header-tools/ChangeLog:

	* README: Remove deprecated ports.
	* reduce-headers: Likewise.

gcc/ChangeLog:

	* config.build: Remove deprecated ports.
	* config.gcc: Likewise.
	* config.host: Likewise.
	* configure.ac: Likewise.
	* configure: Regenerate.
	* config/pa/pa-hpux10.h: Removed.
	* config/pa/pa-hpux10.opt: Removed.
	* config/pa/t-dce-thr: Removed.

gnattools/ChangeLog:

	* configure.ac: Remove deprecated ports.
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
	* crossconfig.m4: Remove deprecated ports.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/lambda/lambda-conv.C: Remove useless test.
	* gcc.c-torture/execute/ieee/hugeval.x: Likewise.
	* gcc.dg/torture/pr47917.c: Likewise.
	* lib/target-supports.exp: Likewise.

libgcc/ChangeLog:

	* config.host: Remove hppa.

libitm/ChangeLog:

	* configure: Regenerate.

fixincludes/ChangeLog:

	* configure: Regenerate.
2022-08-31 22:14:34 +02:00
Sergei Trofimovich
9d2d38a468 Makefile.def: drop remnants of unused libelf
Use of libelf was removed from gcc in r0-104274-g48215350c24d52 ("re PR
lto/46273 (Failed to bootstrap)") around 2010, before gcc-4.6.0.

This change removes unused references to libelf from top-level configure
and Makefile.

/
	* Makefile.def: Drop libelf module and gcc-configure dependency
	on it.
	* Makefile.in: Regenerate with 'autogen Makefile.def'.
	* Makefile.tpl (HOST_EXPORTS): Drop unused LIBELFLIBS and
	LIBELFINC.
	* configure: Regenrate.
	* configure.ac (host_libs): Drop unused libelf.
2022-08-18 09:37:09 +01:00
Roger Sayle
71f068a9b3 Update configure to check for a recent gnat Ada compiler.
GCC fails to bootstrap when configured with --enable-languages=all on
machines that have older versions of GNAT installed as the system Ada
compiler.  In configure, it's not sufficient to check whether gnat is
available, but whether a sufficiently recent version of GNAT is
installed.  This patch tweaks config/acx.m4 so that conftest.adb also
contains a reference to System.CRTL.int64 as required by the current
version of gcc/ada/osint.adb.  This fixes the build when the system
Ada is GNAT v4.8.5 (on Redhat 7) by disabling ada, but continues to
work fine when the system Ada is GNAT v11.3.1.

2022-08-01  Roger Sayle  <roger@nextmovesoftware.com>
	    Arnaud Charlet  <charlet@adacore.com>

config/ChangeLog
	* acx.m4 (AC_PROG_GNAT): Update conftest.adb to include
	features required of the host gnat compiler.

ChangeLog
	* configure: Regenerate.
2022-08-01 11:40:50 +01:00
Tom de Vries
153689603f [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 78e49486944 ("[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 10:52:23 +02:00
Iain Sandoe
1edfc8f2d3 configure, Darwin: Correct a pasto in host-shared processing.
We do, of course, mean $host not $target in this case.  Corrected thus.

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

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Correct use of $host.
2022-06-26 15:50:42 +01:00
Jeff Law
fc259b522c Remove long deprecated tilegx and tilepro ports
/
	* MAINTAINERS: Remove tilegx and tilepro entries.
	* configure.ac: Remove tilegx and tilepro stanzas.
	* configure: Rebuilt.

contrib/
	* config-list.mk: Remove tilegx and tilepro entries.
	* gcc_update: Remove tilegx and tilepro entries.

gcc/
	* common/config/tilegx/tilegx-common.cc: Removed.
	* common/config/tilepro/tilepro-common.cc: Removed.
	* config.gcc: Remove tilegx and tilepro entries.
	* config/tilegx/constraints.md: Removed.
	* config/tilegx/feedback.h: Removed.
	* config/tilegx/linux.h: Removed.
	* config/tilegx/mul-tables.cc: Removed.
	* config/tilegx/predicates.md: Removed.
	* config/tilegx/sync.md: Removed.
	* config/tilegx/t-tilegx: Removed.
	* config/tilegx/tilegx-builtins.h: Removed.
	* config/tilegx/tilegx-c.cc: Removed.
	* config/tilegx/tilegx-generic.md: Removed.
	* config/tilegx/tilegx-modes.def: Removed.
	* config/tilegx/tilegx-multiply.h: Removed.
	* config/tilegx/tilegx-opts.h: Removed.
	* config/tilegx/tilegx-protos.h: Removed.
	* config/tilegx/tilegx.cc: Removed.
	* config/tilegx/tilegx.h: Removed.
	* config/tilegx/tilegx.md: Removed.
	* config/tilegx/tilegx.opt: Removed.
	* config/tilepro/constraints.md: Removed.
	* config/tilepro/feedback.h: Removed.
	* config/tilepro/gen-mul-tables.cc: Removed.
	* config/tilepro/linux.h: Removed.
	* config/tilepro/mul-tables.cc: Removed.
	* config/tilepro/predicates.md: Removed.
	* config/tilepro/t-tilepro: Removed.
	* config/tilepro/tilepro-builtins.h: Removed.
	* config/tilepro/tilepro-c.cc: Removed.
	* config/tilepro/tilepro-generic.md: Removed.
	* config/tilepro/tilepro-modes.def: Removed.
	* config/tilepro/tilepro-multiply.h: Removed.
	* config/tilepro/tilepro-protos.h: Removed.
	* config/tilepro/tilepro.cc: Removed.
	* config/tilepro/tilepro.h: Removed.
	* config/tilepro/tilepro.md: Removed.
	* config/tilepro/tilepro.opt: Removed.
	* configure.ac: Remove tilegx and tilepro entries.
	* configure: Rebuilt.
	* doc/extend.texi: Remove tilegx and tilepro entries.
	* doc/install.texi: Remove tilegx and tilepro entries.
	* doc/invoke.texi: Remove tilegx and tilepro entries.
	* doc/md.texi: Remove tilegx and tilepro entries.

gcc/testsuite/
	* gcc.dg/lower-subreg-1.c: Remove tilegx and tilepro entries.
	* gcc.misc-tests/linkage.exp: Remove tilegx and
	tilepro entries.

libgcc/
	* config.host: Removed tilegx and tilepro entries.
	* config/tilegx/sfp-machine.h: Removed.
	* config/tilegx/sfp-machine32.h: Removed.
	* config/tilegx/sfp-machine64.h: Removed.
	* config/tilegx/t-crtstuff: Removed.
	* config/tilegx/t-softfp: Removed.
	* config/tilegx/t-tilegx: Removed.
	* config/tilepro/atomic.c: Removed.
	* config/tilepro/atomic.h: Removed.
	* config/tilepro/linux-unwind.h: Removed.
	* config/tilepro/sfp-machine.h: Removed.
	* config/tilepro/softdivide.c: Removed.
	* config/tilepro/softmpy.S: Removed.
	* config/tilepro/t-crtstuff: Removed.
	* config/tilepro/t-tilepro: Removed.
2022-06-25 13:55:21 -04:00
chenglulu
c6c0594ef8 LoongArch Port: Regenerate configure
2022-03-29  Chenghua Xu  <xuchenghua@loongson.cn>
	    Lulu Cheng  <chenglulu@loongson.cn>

ChangeLog:

	* configure.ac: Add LoongArch tuples.
	* configure: Regenerate.

config/ChangeLog:

	* picflag.m4: Default add build option '-fpic' for LoongArch.
2022-03-29 17:43:32 +08:00
Tom Tromey
88252529f0 Remove --with-gmp-dir and --with-mpfr-dir
The top-level configure options --with-gmp-dir and --with-mpfr-dir
were obsoleted and marked as "REMOVED" back in 2006.  I think that's
long enough ago for everyone to have updated their scripts, so this
patch removes them entirely.  While doing this, I also found one other
leftover that wasn't removed by the earlier patch.  This is also
removed here.

2022-03-28  Tom Tromey  <tromey@adacore.com>

	* configure.ac: Remove --with-mpfr-dir and --with-gmp-dir.
	* configure: Rebuild.
2022-03-28 14:18:57 -06:00
Jonathan Wakely
67a1cb2ad1 top-level: Fix comment about --enable-libstdcxx in configure
The custom option for enabling/disabling libstdc++ is not spelled the
same as the directory name:

AC_ARG_ENABLE(libstdcxx,
AS_HELP_STRING([--disable-libstdcxx],
  [do not build libstdc++-v3 directory])

The comment referring to it later use the wrong name.

ChangeLog:

	* configure.ac: Fix incorrect option in comment.
	* configure: Regenerate.
2022-03-14 13:08:02 +00:00
Iain Buclaw
7c6ae994fb config: Add check whether D compiler works (PR103528)
As well as checking for the existence of a GDC compiler, also validate
that it has also been built with libphobos, otherwise warn or fail with
the message that GDC is required to build d.

config/ChangeLog:

	PR d/103528
	* acx.m4 (ACX_PROG_GDC): Add check whether D compiler works.

ChangeLog:

	* configure: Regenerate.
2021-12-21 21:29:35 +01:00
H.J. Lu
ab18659afc Revert "Sync with binutils: GCC: Pass --plugin to AR and RANLIB"
This reverts commit bf8cdd3511.
2021-12-15 20:45:58 -08:00
H.J. Lu
4a5e71f234 Sync with binutils: Support the PGO build for binutils+gdb
Sync with binutils for building binutils with LTO:

1dbde357be3 Add missing changes to Makefile.tpl
af019bfde9b 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.

	BZ 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-12-15 14:20:49 -08:00
H.J. Lu
bf8cdd3511 Sync with binutils: GCC: Pass --plugin to AR and RANLIB
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/

	* 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.
	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	RANLIB_PLUGIN_OPTION.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

zlib/

	* configure: Regenerated.
2021-12-15 14:18:10 -08:00
Pekka Seppänen
c841dc0a4d Adjust CPP_FOR_BUILD
Hi.

CPP/CPPFLAGS were changed by commit 84401ce5fb.  That commit uses CPP as a default for CPP_FOR_BUILD.  Unless CPP is defined, GNU make defaults CPP as `$(CC) -E'.  Given the context, this is now incorrect, since CC_FOR_BUILD should be used.

Fixes PR103011.

-- Pekka

gcc/Changelog:

	* configure: Regenerate.
	* configure.ac: For CPP_FOR_BUILD use $(CC_FOR_BUILD) -E instead of
	$(CPP).
2021-12-02 15:59:37 -05:00
Iain Buclaw
5fee5ec362 d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
The D front-end is now itself written in D, in order to build GDC, you
will need a working GDC compiler (GCC version 9.1 or later).

GCC changes:

    - Add support for bootstrapping the D front-end.

These add the required components in order to have a D front-end written
in D itself.  Because the compiler front-end only depends on the core
runtime modules, only libdruntime is built for the bootstrap stages.

D front-end changes:

    - Import dmd v2.098.0-beta.1.

Druntime changes:

    - Import druntime v2.098.0-beta.1.

Phobos changes:

    - Import phobos v2.098.0-beta.1.

The jump from v2.076.1 to v2.098.0 covers nearly 4 years worth of
development on the D programming language and run-time libraries.

ChangeLog:

	* Makefile.def: Add bootstrap to libbacktrace, libphobos, zlib, and
	libatomic.
	* Makefile.in: Regenerate.
	* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Fix command for GDC.
	(STAGE1_CONFIGURE_FLAGS): Add --with-libphobos-druntime-only if
	target-libphobos-bootstrap.
	(STAGE2_CONFIGURE_FLAGS): Likewise.
	* configure: Regenerate.
	* configure.ac: Add support for bootstrapping D front-end.

config/ChangeLog:

	* acx.m4 (ACX_PROG_GDC): New m4 function.

gcc/ChangeLog:

	* Makefile.in (GDC): New variable.
	(GDCFLAGS): New variable.
	* configure: Regenerate.
	* configure.ac: Add call to ACX_PROG_GDC.  Substitute GDCFLAGS.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd b8384668f.
	* Make-lang.in (d-warn): Use strict warnings.
	(DMD_WARN_CXXFLAGS): Remove.
	(DMD_COMPILE): Remove.
	(CHECKING_DFLAGS): Define.
	(WARN_DFLAGS): Define.
	(ALL_DFLAGS): Define.
	(DCOMPILE.base): Define.
	(DCOMPILE): Define.
	(DPOSTCOMPILE): Define.
	(DLINKER): Define.
	(DLLINKER): Define.
	(D_FRONTEND_OBJS): Add new dmd front-end objects.
	(D_GENERATED_SRCS): Remove.
	(D_GENERATED_OBJS): Remove.
	(D_ALL_OBJS): Remove D_GENERATED_OBJS.
	(d21$(exeext)): Build using DLLINKER and -static-libphobos.
	(d.tags): Remove dmd/*.c and dmd/root/*.c.
	(d.mostlyclean): Remove D_GENERATED_SRCS, d/idgen$(build_exeext),
	d/impcnvgen$(build_exeext).
	(D_INCLUDES): Include $(srcdir)/d/dmd/res.
	(CFLAGS-d/id.o): Remove.
	(CFLAGS-d/impcnvtab.o): Remove.
	(d/%.o): Build using DCOMPILE and DPOSTCOMPILE.  Update dependencies
	from d/dmd/%.c to d/dmd/%.d.
	(d/idgen$(build_exeext)): Remove.
	(d/impcnvgen$(build_exeext)): Remove.
	(d/id.c): Remove.
	(d/id.h): Remove.
	(d/impcnvtab.c): Remove.
	(d/%.dmdgen.o): Remove.
	(D_SYSTEM_H): Remove.
	(d/idgen.dmdgen.o): Remove.
	(d/impcnvgen.dmdgen.o): Remove.
	* config-lang.in (boot_language): New variable.
	* d-attribs.cc: Include dmd/expression.h.
	* d-builtins.cc: Include d-frontend.h.
	(build_frontend_type): Update for new front-end interface.
	(d_eval_constant_expression): Likewise.
	(d_build_builtins_module): Likewise.
	(maybe_set_builtin_1): Likewise.
	(d_build_d_type_nodes): Likewise.
	* d-codegen.cc (d_decl_context): Likewise.
	(declaration_reference_p): Likewise.
	(declaration_type): Likewise.
	(parameter_reference_p): Likewise.
	(parameter_type): Likewise.
	(get_array_length): Likewise.
	(build_delegate_cst): Likewise.
	(build_typeof_null_value): Likewise.
	(identity_compare_p): Likewise.
	(lower_struct_comparison): Likewise.
	(build_filename_from_loc): Likewise.
	(build_assert_call): Remove LIBCALL_SWITCH_ERROR.
	(build_bounds_index_condition): Call LIBCALL_ARRAYBOUNDS_INDEXP on
	bounds error.
	(build_bounds_slice_condition): Call LIBCALL_ARRAYBOUNDS_SLICEP on
	bounds error.
	(array_bounds_check): Update for new front-end interface.
	(checkaction_trap_p): Handle CHECKACTION_context.
	(get_function_type): Update for new front-end interface.
	(d_build_call): Likewise.
	* d-compiler.cc: Remove include of dmd/scope.h.
	(Compiler::genCmain): Remove.
	(Compiler::paintAsType): Update for new front-end interface.
	(Compiler::onParseModule): Likewise.
	* d-convert.cc (convert_expr): Remove call to LIBCALL_ARRAYCAST.
	(convert_for_rvalue): Update for new front-end interface.
	(convert_for_assignment): Likewise.
	(convert_for_condition): Likewise.
	(d_array_convert): Likewise.
	* d-diagnostic.cc (error): Remove.
	(errorSupplemental): Remove.
	(warning): Remove.
	(warningSupplemental): Remove.
	(deprecation): Remove.
	(deprecationSupplemental): Remove.
	(message): Remove.
	(vtip): New.
	* d-frontend.cc (global): Remove.
	(Global::_init): Remove.
	(Global::startGagging): Remove.
	(Global::endGagging): Remove.
	(Global::increaseErrorCount): Remove.
	(Loc::Loc): Remove.
	(Loc::toChars): Remove.
	(Loc::equals): Remove.
	(isBuiltin): Update for new front-end interface.
	(eval_builtin): Likewise.
	(getTypeInfoType): Likewise.
	(inlineCopy): Remove.
	* d-incpath.cc: Include d-frontend.h.
	(add_globalpaths): Call d_gc_malloc to allocate Strings.
	(add_filepaths): Likewise.
	* d-lang.cc: Include dmd/id.h, dmd/root/file.h, d-frontend.h.  Remove
	include of dmd/mars.h, id.h.
	(entrypoint_module): Remove.
	(entrypoint_root_module): Remove.
	(deps_write_string): Update for new front-end interface.
	(deps_write): Likewise.
	(d_init_options): Call rt_init.  Remove setting global params that are
	default initialized by the front-end.
	(d_handle_option): Handle OPT_fcheckaction_, OPT_fdump_c___spec_,
	OPT_fdump_c___spec_verbose, OPT_fextern_std_, OPT_fpreview,
	OPT_revert, OPT_fsave_mixins_, and OPT_ftransition.
	(d_post_options): Propagate dip1021 and dip1000 preview flags to
	dip25, and flag_diagnostics_show_caret to printErrorContext.
	(d_add_entrypoint_module): Remove.
	(d_parse_file): Update for new front-end interface.
	(d_type_promotes_to): Likewise.
	(d_types_compatible_p): Likewise.
	* d-longdouble.cc (CTFloat::zero): Remove.
	(CTFloat::one): Remove.
	(CTFloat::minusone): Remove.
	(CTFloat::half): Remove.
	* d-system.h (POSIX): Remove.
	(realpath): Remove.
	(isalpha): Remove.
	(isalnum): Remove.
	(isdigit): Remove.
	(islower): Remove.
	(isprint): Remove.
	(isspace): Remove.
	(isupper): Remove.
	(isxdigit): Remove.
	(tolower): Remove.
	(_mkdir): Remove.
	(INT32_MAX): Remove.
	(INT32_MIN): Remove.
	(INT64_MIN): Remove.
	(UINT32_MAX): Remove.
	(UINT64_MAX): Remove.
	* d-target.cc: Include calls.h.
	(target): Remove.
	(define_float_constants): Remove initialization of snan.
	(Target::_init): Update for new front-end interface.
	(Target::isVectorTypeSupported): Likewise.
	(Target::isVectorOpSupported): Remove cases for unordered operators.
	(TargetCPP::typeMangle): Update for new front-end interface.
	(TargetCPP::parameterType): Likewise.
	(Target::systemLinkage): Likewise.
	(Target::isReturnOnStack): Likewise.
	(Target::isCalleeDestroyingArgs): Define.
	(Target::preferPassByRef): Define.
	* d-tree.h (d_add_entrypoint_module): Remove.
	* decl.cc (gcc_attribute_p): Update for new front-end interface.
	(apply_pragma_crt): Define.
	(DeclVisitor::visit(PragmaDeclaration *)): Handle pragmas
	crt_constructor and crt_destructor.
	(DeclVisitor::visit(TemplateDeclaration *)): Update for new front-end
	interface.
	(DeclVisitor::visit): Likewise.
	(DeclVisitor::finish_vtable): Likewise.
	(get_symbol_decl): Error if template has more than one nesting
	context.  Update for new front-end interface.
	(make_thunk): Update for new front-end interface.
	(get_vtable_decl): Likewise.
	* expr.cc (ExprVisitor::visit): Likewise.
	(build_return_dtor): Likewise.
	* imports.cc (ImportVisitor::visit): Likewise.
	* intrinsics.cc: Include dmd/expression.h.  Remove include of
	dmd/mangle.h.
	(maybe_set_intrinsic): Update for new front-end interface.
	* intrinsics.def (INTRINSIC_ROL): Update intrinsic signature.
	(INTRINSIC_ROR): Likewise.
	(INTRINSIC_ROR_TIARG): Likewise.
	(INTRINSIC_TOPREC): Likewise.
	(INTRINSIC_TOPRECL): Likewise.
	(INTRINSIC_TAN): Update intrinsic module and signature.
	(INTRINSIC_ISNAN): Likewise.
	(INTRINSIC_ISFINITE): Likewise.
	(INTRINSIC_COPYSIGN): Define intrinsic.
	(INTRINSIC_COPYSIGNI): Define intrinsic.
	(INTRINSIC_EXP): Update intrinsic module.
	(INTRINSIC_EXPM1): Likewise.
	(INTRINSIC_EXP2): Likewise.
	(INTRINSIC_LOG): Likewise.
	(INTRINSIC_LOG2): Likewise.
	(INTRINSIC_LOG10): Likewise.
	(INTRINSIC_POW): Likewise.
	(INTRINSIC_ROUND): Likewise.
	(INTRINSIC_FLOORF): Likewise.
	(INTRINSIC_FLOOR): Likewise.
	(INTRINSIC_FLOORL): Likewise.
	(INTRINSIC_CEILF): Likewise.
	(INTRINSIC_CEIL): Likewise.
	(INTRINSIC_CEILL): Likewise.
	(INTRINSIC_TRUNC): Likewise.
	(INTRINSIC_FMIN): Likewise.
	(INTRINSIC_FMAX): Likewise.
	(INTRINSIC_FMA): Likewise.
	(INTRINSIC_VA_ARG): Update intrinsic signature.
	(INTRINSIC_VASTART): Likewise.
	* lang.opt (fcheck=): Add alternate aliases for contract switches.
	(fcheckaction=): New option.
	(check_action): New Enum and EnumValue entries.
	(fdump-c++-spec-verbose): New option.
	(fdump-c++-spec=): New option.
	(fextern-std=): New option.
	(extern_stdcpp): New Enum and EnumValue entries
	(fpreview=): New options.
	(frevert=): New options.
	(fsave-mixins): New option.
	(ftransition=): Update options.
	* modules.cc (get_internal_fn): Replace Prot with Visibility.
	(build_internal_fn): Likewise.
	(build_dso_cdtor_fn): Likewise.
	(build_module_tree): Remove check for __entrypoint module.
	* runtime.def (P5): Define.
	(ARRAYBOUNDS_SLICEP): Define.
	(ARRAYBOUNDS_INDEXP): Define.
	(NEWTHROW): Define.
	(ADCMP2): Remove.
	(ARRAYCAST): Remove.
	(SWITCH_STRING): Remove.
	(SWITCH_USTRING): Remove.
	(SWITCH_DSTRING): Remove.
	(SWITCH_ERROR): Remove.
	* toir.cc (IRVisitor::visit): Update for new front-end interface.
	(IRVisitor::check_previous_goto): Remove checks for case and default
	statements.
	(IRVisitor::visit(SwitchStatement *)): Remove handling of string
	switch conditions.
	* typeinfo.cc: Include d-frontend.h.
	(get_typeinfo_kind): Update for new front-end interface.
	(make_frontend_typeinfo): Likewise.
	(TypeInfoVisitor::visit): Likewise.
	(builtin_typeinfo_p): Likewise.
	(get_typeinfo_decl): Likewise.
	(build_typeinfo): Likewise.
	* types.cc (valist_array_p): Likewise.
	(make_array_type): Likewise.
	(merge_aggregate_types): Likewise.
	(TypeVisitor::visit(TypeBasic *)): Likewise.
	(TypeVisitor::visit(TypeFunction *)): Likewise.
	(TypeVisitor::visit(TypeStruct *)): Update comment.
	* verstr.h: Removed.
	* d-frontend.h: New file.

gcc/po/ChangeLog:

	* EXCLUDES: Remove d/dmd sources from list.

gcc/testsuite/ChangeLog:

	* gdc.dg/Wcastresult2.d: Update test.
	* gdc.dg/asm1.d: Likewise.
	* gdc.dg/asm2.d: Likewise.
	* gdc.dg/asm3.d: Likewise.
	* gdc.dg/gdc282.d: Likewise.
	* gdc.dg/imports/gdc170.d: Likewise.
	* gdc.dg/intrinsics.d: Likewise.
	* gdc.dg/pr101672.d: Likewise.
	* gdc.dg/pr90650a.d: Likewise.
	* gdc.dg/pr90650b.d: Likewise.
	* gdc.dg/pr94777a.d: Likewise.
	* gdc.dg/pr95250.d: Likewise.
	* gdc.dg/pr96869.d: Likewise.
	* gdc.dg/pr98277.d: Likewise.
	* gdc.dg/pr98457.d: Likewise.
	* gdc.dg/simd1.d: Likewise.
	* gdc.dg/simd2a.d: Likewise.
	* gdc.dg/simd2b.d: Likewise.
	* gdc.dg/simd2c.d: Likewise.
	* gdc.dg/simd2d.d: Likewise.
	* gdc.dg/simd2e.d: Likewise.
	* gdc.dg/simd2f.d: Likewise.
	* gdc.dg/simd2g.d: Likewise.
	* gdc.dg/simd2h.d: Likewise.
	* gdc.dg/simd2i.d: Likewise.
	* gdc.dg/simd2j.d: Likewise.
	* gdc.dg/simd7951.d: Likewise.
	* gdc.dg/torture/gdc309.d: Likewise.
	* gdc.dg/torture/pr94424.d: Likewise.
	* gdc.dg/torture/pr94777b.d: Likewise.
	* lib/gdc-utils.exp (gdc-convert-args): Handle new compiler options.
	(gdc-convert-test): Handle CXXFLAGS, EXTRA_OBJC_SOURCES, and ARG_SETS
	test directives.
	(gdc-do-test): Only import modules in the test run directory.
	* gdc.dg/pr94777c.d: New test.
	* gdc.dg/pr96156b.d: New test.
	* gdc.dg/pr96157c.d: New test.
	* gdc.dg/simd_ctfe.d: New test.
	* gdc.dg/torture/simd17344.d: New test.
	* gdc.dg/torture/simd20052.d: New test.
	* gdc.dg/torture/simd6.d: New test.
	* gdc.dg/torture/simd7.d: New test.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e6caaab9.
	* libdruntime/Makefile.am (D_EXTRA_FLAGS): Build libdruntime with
	-fpreview=dip1000, -fpreview=fieldwise, and -fpreview=dtorfields.
	(ALL_DRUNTIME_SOURCES): Add DRUNTIME_DSOURCES_STDCXX.
	(DRUNTIME_DSOURCES): Update list of C binding modules.
	(DRUNTIME_DSOURCES_STDCXX): Likewise.
	(DRUNTIME_DSOURCES_LINUX): Likewise.
	(DRUNTIME_DSOURCES_OPENBSD): Likewise.
	(DRUNTIME_DISOURCES): Remove __entrypoint.di.
	* libdruntime/Makefile.in: Regenerated.
	* libdruntime/__entrypoint.di: Removed.
	* libdruntime/gcc/deh.d (_d_isbaseof): Update signature.
	(_d_createTrace): Likewise.
	(__gdc_begin_catch): Remove reference to the exception.
	(_d_throw): Increment reference count of thrown object before unwind.
	(__gdc_personality): Chain exceptions with  Throwable.chainTogether.
	* libdruntime/gcc/emutls.d: Update imports.
	* libdruntime/gcc/sections/elf.d: Update imports.
	(DSO.moduleGroup): Update signature.
	* libdruntime/gcc/sections/macho.d: Update imports.
	(DSO.moduleGroup): Update signature.
	* libdruntime/gcc/sections/pecoff.d: Update imports.
	(DSO.moduleGroup): Update signature.
	* src/MERGE: Merge upstream phobos 5ab9ad256.
	* src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=dip1000 and
	-fpreview=dtorfields flags.
	(PHOBOS_DSOURCES): Update list of std modules.
	* src/Makefile.in: Regenerate.
	* testsuite/lib/libphobos.exp (libphobos-dg-test): Handle assembly
	compile types.
	(dg-test): Override.
	(additional_prunes): Define.
	(libphobos-dg-prune): Filter any additional_prunes set by tests.
	* testsuite/libphobos.aa/test_aa.d: Update test.
	* testsuite/libphobos.druntime/druntime.exp (version_flags): Add
	-fversion=CoreUnittest.
	* testsuite/libphobos.druntime_shared/druntime_shared.exp
	(version_flags): Add -fversion=CoreUnittest -fversion=Shared.
	* testsuite/libphobos.exceptions/unknown_gc.d: Update test.
	* testsuite/libphobos.hash/test_hash.d: Update test.
	* testsuite/libphobos.phobos/phobos.exp (version_flags): Add
	-fversion=StdUnittest
	* testsuite/libphobos.phobos_shared/phobos_shared.exp (version_flags):
	Likewise.
	* testsuite/libphobos.shared/host.c: Update test.
	* testsuite/libphobos.shared/load.d: Update test.
	* testsuite/libphobos.shared/load_13414.d: Update test.
	* testsuite/libphobos.thread/fiber_guard_page.d: Update test.
	* testsuite/libphobos.thread/tlsgc_sections.d: Update test.
	* testsuite/testsuite_flags.in: Add -fpreview=dip1000 to --gdcflags.
	* testsuite/libphobos.shared/link_mod_collision.d: Removed.
	* testsuite/libphobos.shared/load_mod_collision.d: Removed.
	* testsuite/libphobos.betterc/betterc.exp: New test.
	* testsuite/libphobos.config/config.exp: New test.
	* testsuite/libphobos.gc/gc.exp: New test.
	* testsuite/libphobos.imports/imports.exp: New test.
	* testsuite/libphobos.lifetime/lifetime.exp: New test.
	* testsuite/libphobos.unittest/unittest.exp: New test.
2021-11-30 16:53:28 +01:00
Iain Sandoe
a1d2b16202 configure, Darwin: Set appropriate defaults for host-shared.
Darwin x86_64 and aarch64 platforms are PIC (shared) by default,
and user-space code must be built in this mode.  The patch
ensures that this is set correctly and applies a default when
--enable-host-shared is not set.

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

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Ensure that PIC (shared) defaults are set
	correctly for Darwin.
2021-11-16 19:44:51 +00:00
Richard Purdie
84401ce5fb [PATCH 1/5] Makefile.in: Ensure build CPP/CPPFLAGS is used for build targets
During cross compiling, CPP is being set to the target compiler even for
build targets. As an example, when building a cross compiler targetting
mingw, the config.log for libiberty in
build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log
shows:

configure:3786: checking how to run the C preprocessor
configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=[sysroot]/x86_64-nativesdk-mingw32-pokysdk-mingw32
configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=[sysroot]/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
configure:3876: $? = 0

This is libiberty being built for the build environment, not the target one
(i.e. in build-x86_64-linux). As such it should be using the build environment's
gcc and not the target one. In the mingw case the system headers are quite
different leading to build failures related to not being able to include a
process.h file for pem-unix.c.

Further analysis shows the same issue occuring for CPPFLAGS too.

Fix this by adding support for CPP_FOR_BUILD and CPPFLAGS_FOR_BUILD which
for example, avoids mixing the mingw headers for host binaries on linux
systems.

2021-10-27 Richard Purdie <richard.purdie@linuxfoundation.org>

ChangeLog:

	* Makefile.tpl: Add CPP_FOR_BUILD and CPPFLAGS_FOR_BUILD support
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add CPP_FOR_BUILD and CPPFLAGS_FOR_BUILD support

gcc/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Use CPPFLAGS_FOR_BUILD for GMPINC

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-28 10:42:49 -04:00
Andrew Burgess
dc614a838e 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 09:43:36 +01:00
Iain Sandoe
54258e22b0 Darwin, config: Revise host config fragment.
There were two uses for the Darwin host config fragment:

The first is to arrange for targets that support mdynamic-no-pic
to be built with that enabled (since it makes a significant
difference to the compiler performance).  We can be more specific
in the application of this, since it only applies to 32b hosts
plus powerpc64-darwin9.

The second was to work around a tool bug where -fno-PIE was not
propagated to the link stage.  This second use is redundant,
since the buggy toolchain cannot bootstrap current GCC sources
anyway.

This makes the host fragment more specific and reduces the number
of toolchains for which it is included which reduces clutter in
configure lines.

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

config/ChangeLog:

	* mh-darwin: Make this specific to handling the
	mdynamic-no-pic case.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Adjust cases for which it is necessary to
	include the Darwin host config fragment.
2021-07-09 17:35:57 +01:00
Iain Sandoe
3b5e8ee4f1 Darwin, configury : Allow for specification and detection of dsymutil.
In order to enable DWARF versions > 2 we need a sufficiently modern
version of dsymutil (in addition to the assembler / linker).  This
allows the user to configure a different path from the installed one.

In addition, there are several sources of dsymutil so we differentiate
these in order to be get accurate version information.

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

gcc/ChangeLog:

	* configure.ac: Handle --with-dsymutil in the same way as we
	do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
	Extract the type and version for the dsymutil configured or
	found by the default searches.
	* config.in: Regenerated.
	* configure: Regenerated.
	* collect2.c (do_dsymutil): Handle locating dsymutil in the
	same way as for the assembler and  linker.
	* config/darwin.h (DSYMUTIL): Delete.
	* gcc.c: Report a configured dsymutil correctly.
	* exec-tool.in: Allow for dsymutil.

ChangeLog:

	* Makefile.def: Add dsymutil defs.
	* Makefile.in: Regenerated.
	* Makefile.tpl: Add dsymutil to flags.
	* configure: Regenerated.
	* configure.ac: Add dsymutil to target and build recipes.
2021-07-05 20:40:45 +01:00
Mike Frysinger
f14c9bd4dc sim: leverage gnulib
We use getline, so leverage gnulib to provide fallback implementation.

ChangeLog:

	* configure.ac: Add gnulib to configdirs for sim.
	* configure: Regenerate.
2021-05-29 10:59:54 -04:00
Martin Liska
814d86ddce Remove libhsail-rt.
ChangeLog:

	* Makefile.def: Remove libhsail-rt.
	* Makefile.in: Likewise.
	* configure.ac: Likewise.
	* configure: Regenerate.
	* libhsail-rt/ChangeLog: Removed.
	* libhsail-rt/Makefile.am: Removed.
	* libhsail-rt/Makefile.in: Removed.
	* libhsail-rt/README: Removed.
	* libhsail-rt/aclocal.m4: Removed.
	* libhsail-rt/configure: Removed.
	* libhsail-rt/configure.ac: Removed.
	* libhsail-rt/configure.tgt: Removed.
	* libhsail-rt/include/internal/fibers.h: Removed.
	* libhsail-rt/include/internal/phsa-queue-interface.h: Removed.
	* libhsail-rt/include/internal/phsa-rt.h: Removed.
	* libhsail-rt/include/internal/workitems.h: Removed.
	* libhsail-rt/rt/arithmetic.c: Removed.
	* libhsail-rt/rt/atomics.c: Removed.
	* libhsail-rt/rt/bitstring.c: Removed.
	* libhsail-rt/rt/fbarrier.c: Removed.
	* libhsail-rt/rt/fibers.c: Removed.
	* libhsail-rt/rt/fp16.c: Removed.
	* libhsail-rt/rt/misc.c: Removed.
	* libhsail-rt/rt/multimedia.c: Removed.
	* libhsail-rt/rt/queue.c: Removed.
	* libhsail-rt/rt/sat_arithmetic.c: Removed.
	* libhsail-rt/rt/segment.c: Removed.
	* libhsail-rt/rt/workitems.c: Removed.
	* libhsail-rt/target-config.h.in: Removed.

contrib/ChangeLog:

	* gcc_update: Remove libhsail-rt folder.
	* update-copyright.py: Likewise.
2021-05-11 15:13:30 +02:00
Nick Clifton
9174343256 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:39:04 +01:00
Tobias Burnus
fe5bfa6704 offload-defaulted: Config option to silently ignore uninstalled offload compilers
If configured with --enable-offload-defaulted, configured but not installed
offload compilers and libgomp plugins are silently ignored.  Useful for
distribution compilers where those are in separate optional packages.

2021-04-28  Jakub Jelinek  <jakub@redhat.com>
	    Tobias Burnus  <tobias@codesourcery.com>

ChangeLog:

	* configure.ac (--enable-offload-defaulted): New.
	* configure: Regenerate.

gcc/ChangeLog:

	* configure.ac (OFFLOAD_DEFAULTED): AC_DEFINE if offload-defaulted.
	* gcc.c (process_command): New variable.
	(driver::maybe_putenv_OFFLOAD_TARGETS): If OFFLOAD_DEFAULTED,
	set it if -foffload is defaulted.
	* lto-wrapper.c (OFFLOAD_TARGET_DEFAULT_ENV): Define.
	(compile_offload_image): If OFFLOAD_DEFAULTED and
	OFFLOAD_TARGET_DEFAULT is in the environment, don't fail
	if corresponding mkoffload can't be found.
	(compile_images_for_offload_targets): Likewise.  Free and clear
	offload_names if no valid offload is found.
	* config.in: Regenerate.
	* configure: Regenerate.

libgomp/ChangeLog:

	* configure.ac (OFFLOAD_DEFAULTED): AC_DEFINE if offload-defaulted.
	* target.c (gomp_load_plugin_for_device): If set and if a plugin
	can't be dlopened, silently assume it has no devices.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
2021-04-28 18:46:47 +02:00
Nathan Sidwell
2efd8b1ffd Add C++tools
These are the toplevel directory changes to add c++tools

ChangeLog:

	* Makefile.def
	* Makefile.in
	* Makefile.tpl
	* configure
	* configure.ac
2020-12-15 07:42:59 -08:00
Nathan Sidwell
362303298a Add libcody
In order to separate compiler from build system, C++ Modules, as
implemented in GCC introduces a communication channel between those
two entities.  This is implemented by libcody.  It is anticipated that
other implementations will also implement this protocol, or use
libcody to provide it.

	* Makefile.def: Add libcody.
	* configure.ac: Add libcody.
	* Makefile.in: Regenerated.
	* configure: Regenerated.
	gcc/
	* Makefile.in (CODYINC, CODYLIB, CODYLIB_H): New. Use them.
	libcody/
	* configure.ac: New.
	* CMakeLists.txt: New.
	* CODING.md: New.
	* CONTRIB.md: New.
	* LICENSE: New.
	* LICENSE.gcc: New.
	* Makefile.in: New.
	* Makesub.in: New.
	* README.md: New.
	* buffer.cc: New.
	* build-aux/config.guess: New.
	* build-aux/config.sub: New.
	* build-aux/install-sh: New.
	* client.cc: New.
	* cmake/libcody-config-ix.cmake
	* cody.hh: New.
	* config.h.in: New.
	* config.m4: New.
	* configure: New.
	* configure.ac: New.
	* dox.cfg.in: New.
	* fatal.cc: New.
	* gdbinit.in: New.
	* internal.hh: New.
	* netclient.cc: New.
	* netserver.cc: New.
	* packet.cc: New.
	* resolver.cc: New.
	* server.cc: New.
	* tests/01-serialize/connect.cc: New.
	* tests/01-serialize/decoder.cc: New.
	* tests/01-serialize/encoder.cc: New.
	* tests/02-comms/client-1.cc: New.
	* tests/02-comms/pivot-1.cc: New.
	* tests/02-comms/server-1.cc: New.
	* tests/Makesub.in: New.
	* tests/jouster: New.
2020-12-15 07:09:59 -08:00
Iain Buclaw
2fdf75cb70 configure: Support building D front-end on *-*-darwin*
The bootstrap has been confirmed to be succeeding, there's no need to
set it as an unsupported language.

ChangeLog:

	PR d/87788
	* configure.ac: Don't disable D for *-*-darwin*.
	* configure: Regenerate.
2020-11-29 22:09:42 +01:00
Matthew Malcomson
170e618ef5 libsanitizer: Add option to bootstrap using HWASAN
This is an analogous option to --bootstrap-asan to configure.  It allows
bootstrapping GCC using HWASAN.

For the same reasons as for ASAN we have to avoid using the HWASAN
sanitizer when compiling libiberty and the lto-plugin.

Also add a function to query whether -fsanitize=hwaddress has been
passed.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add --bootstrap-hwasan option.

config/ChangeLog:

	* bootstrap-hwasan.mk: New file.

gcc/ChangeLog:

	* doc/install.texi: Document new option.

libiberty/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Avoid using sanitizer.

lto-plugin/ChangeLog:

	* Makefile.am: Avoid using sanitizer.
	* Makefile.in: Regenerate.
2020-11-25 16:35:37 +00:00
Tobias Burnus
c0d0a722da configure: Fix in-tree building of GMP on BSD [PR97302]
ChangeLog:
	PR target/97302
	* configure.ac: Only set with_gmp to /usr/local
	if not building in tree.
	* configure: Regenerate.
2020-10-06 11:49:34 +02:00
Tobias Burnus
7ffcf5d611 configure: Also check C++11 (flags) for ${build} compiler not only for ${host}
config/ChangeLog:

	PR bootstrap/96612
	* ax_cxx_compile_stdcxx.m4: Add fourth argument to check also
	the CXX_FOR_BUILD compiler.

ChangeLog:

	PR bootstrap/96612
	* configure.ac: Run AX_CXX_COMPILE_STDCXX also for ${build} compiler,
	if not the same as ${host}.
	* configure: Regenerate.
2020-08-20 21:59:00 +02:00
Jason Merrill
ffac959725 bootstrap: Fix --disable-bootstrap with older g++.
Previously I had AX_CXX_COMPILE_STDCXX in the gcc directory configure, which
added -std=c++11 to CXX if needed, but then CXX is overridden from the
toplevel directory, so it didn't have the desired effect.  Fixed by moving
the check to the toplevel.  Currently it is only used when building GCC
without bootstrapping; other packages that share the toplevel directory
can adjust the condition if they also want to require C++11 support.

/ChangeLog:

	* configure.ac: Check AX_CXX_COMPILE_STDCXX if not bootstrapping.
	* configure: Regenerate.

gcc/ChangeLog:

	* aclocal.m4: Remove ax_cxx_compile_stdcxx.m4.
	* configure.ac: Remove AX_CXX_COMPILE_STDCXX.
	* configure: Regenerate.
2020-06-08 16:42:35 -04:00
Nicolás Bértolo
c83027f32d jit: port libgccjit to Windows
2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

/ChangeLog:
	* configure.ac: Don't require --enable-host-shared when building
	for Mingw.
	* configure: Regenerate.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/ChangeLog:
	* Makefile.in: don't look for libiberty in the "pic" subdirectory
	when building for Mingw. Add dependency on xgcc with the proper
	extension.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/c/ChangeLog:
	* Make-lang.in: Remove extra slash.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/jit/ChangeLog:
	* Make-lang.in: Remove extra slash. Build libgccjit.dll and its
	import library in Windows.
	* config-lang.in: Update comment about --enable-host-shared.
	* jit-w32.h: New file.
	* jit-w32.c: New file.
	(print_last_error): New function that prints the error
	string corresponding to GetLastError().
	(get_TOKEN_USER_current_user): Helper function used for getting
	the SID belonging to the current user.
	(create_directory_for_current_user): Helper function to create
	a directory with permissions such that only the current user can
	access it.
	(win_mkdtemp): Create a temporary directory using Windows APIs.
	* jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
	FreeLibrary and GetProcAddress instead of libdl.
	* jit-result.h, jit-result.c: Introduce result::handle_t to
	abstract over the types used for dynamic library handles.
	* jit-tempdir.c: Do not use mkdtemp() in Windows, use
	win_mkdtemp().
2020-05-28 14:43:58 -04:00
Jason Merrill
5329b59a2e bootstrap: Update requirement to C++11.
There was general agreement last November that we would move to allowing
C++11 features to be used in GCC 11; this patch implements that direction.

ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* configure.ac: Update bootstrap dialect to -std=c++11.

config/ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* ax_cxx_compile_stdcxx.m4: Import from autoconf archive with
	an adjustment to try the default mode.

gcc/ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* aclocal.m4: Add ax_cxx_compile_stdcxx.m4.
	* configure.ac: Use AX_CXX_COMPILE_STDCXX(11).
2020-05-18 14:29:18 -04:00
Thomas Schwinge
afa3d80e86 [gcn] Don't default to building target-libstdc++-v3 [PR92713]
... which hasn't been ported/fails to build when using newlib (with GCC commit
b73f69020f sources, and newlib commit
6d79e0a58866548f435527798fbd4a6849d05bc7, tag: newlib-3.3.0 sources):

    In file included from [...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libstdc++-v3/include/csetjmp:42,
                     from [...]/source-gcc/libstdc++-v3/include/precompiled/stdc++.h:42:
    [...]/source-gcc/newlib/libc/include/setjmp.h:15:6: error: variable or field 'longjmp' declared void
       15 | void longjmp (jmp_buf __jmpb, int __retval)
          |      ^~~~~~~
    [...]
    Makefile:1824: recipe for target 'amdgcn-amdhsa/bits/stdc++.h.gch/O2ggnu++0x.gch' failed
    make[3]: *** [amdgcn-amdhsa/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1

	PR target/92713
	* configure.ac ["${ENABLE_LIBSTDCXX}" = "default" && amdgcn*-*-*]
	(noconfigdirs): Add 'target-libstdc++-v3'.
	* configure: Regenerate.
2020-04-29 09:28:01 +02:00
Stephen Casner
e6cbe9654d Since the pdp11-aout target does not support gdb, gdbserver or gprof these should be excluded in configure.
PR 25830
	* configure.ac (noconfigdirs): Exclude gdb & gprof for pdp11.
	* configure: Rebuild.
2020-04-21 10:44:32 +01:00
Tom Tromey
f9d09df0f3 Merge top-level configury changes from gdb
We recently rearranged the gdb source tree to move a common library
and gdbserver to the top-level.  This made the build more uniform and
also a bit faster (due to sharing of built objects).

This patch re-syncs these changes the top-level configury back to gcc.

ChangeLog:
	* configure: Rebuild.
	* Makefile.in: Rebuild.
	* Makefile.def (gdbsupport, gdbserver): New host modules.
	(configure-gdb): Depend on all-gdbsupport.
	(all-gdb): Depend on all-gdbsupport, all-libctf.
	* configure.ac (host_tools): Add gdbserver.
	Conditionally build gdbserver and gdbsupport.
2020-04-09 06:52:55 -06:00
Tobias Burnus
29b1533acd configure - build libgomp by default for amdgcn
* configure.ac: Build libgomp by default for amdgcn.
        * configure: Regenerate.
2020-03-09 17:00:39 +01:00
Matthias Klose
4f94386981 configure.ac: Factor out common cases for compare_exclusions.
2019-12-11  Matthias Klose  <doko@ubuntu.com>

        * configure.ac: Factor out common cases for compare_exclusions.
        * configure: Regenerate.

From-SVN: r279250
2019-12-11 20:59:35 +00:00