Commit Graph

51 Commits

Author SHA1 Message Date
Iain Sandoe 532fae74c3 libphobos, testsuite: Add prune clauses for two Darwin cases.
Depending on the permutation of CPU, OS version and shared/non-
shared library inclusion, we get can get two warnings from the
external tools (ld64, dsymutil) which are not actually GCC issues
but relate to the external tools.  These are alrrady pruned in
the main testsuite, this adds them to the library.

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

libphobos/ChangeLog:

	* testsuite/lib/libphobos.exp: Prune warnings from external
	tool bugs.
2021-11-19 19:51:27 +00:00
Iain Buclaw 6eae7549b8 libphobos: Add Thread/Fiber support code for Darwin (PR98058)
libphobos/ChangeLog:

	PR d/98058
	* configure: Regenerate.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add
	core/sys/darwin/config.d
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/config/powerpc/switchcontext.S: Implement
	fiber_switchContext for __MACH__.
	* libdruntime/config/x86/switchcontext.S: Likewise.
	* libdruntime/core/sys/darwin/config.d: New file.
	* libdruntime/core/thread/fiber.d (Fiber.getThis): Mark noinline.
	(UnsafeFiberMigration): Define for OSX/X86 and OSX/X86_64.
	* libdruntime/core/thread/osthread.d (callWithStackShell): Add inline
	assembler implementation for X86, X86_64, PPC, and PPC64.
	* libdruntime/core/thread/threadbase.d (ThreadBase.getThis): Mark
	noinline.
	* libdruntime/gcc/deh.d (FuncTable): Remove definition.
	* m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING): Check for right
	bracket symbol on darwin* targets.
	* testsuite/libphobos.thread/fiber_guard_page.d: Update test to
	support ucontext-based Fibers.
2021-04-19 19:27:27 +02:00
Iain Buclaw d118ec221d libphobos: Build runtime library with -ffunction-sections -fdata-sections
Tests for `-ffunction-sections -fdata-sections' and sets SECTION_FLAGS
accordingly.  If there is no warning when using it, take advantage of
the smaller executables that can be had with `--gc-sections'.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Call DRUNTIME_SECTION_FLAGS.
	* libdruntime/Makefile.am: Add SECTION_FLAGS to AM_DFLAGS.
	* libdruntime/Makefile.in: Regenerate.
	* m4/druntime.m4 (DRUNTIME_SECTION_FLAGS): New macro.
	* src/Makefile.am: Add SECTION_FLAGS to AM_DFLAGS.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2021-04-10 15:02:07 +02:00
Iain Buclaw 385ee099ee libphobos: Explicitly use -static-libphobos in druntime and phobos tests
Linking to libphobos statically is the default in the driver, however
this may change in future.  Be explicit that the static libphobos is
what's being tested.

libphobos/ChangeLog:

	* testsuite/libphobos.druntime/druntime.exp: Compile all tests with
	-static-libphobos.
	* testsuite/libphobos.phobos/phobos.exp: Likewise.
2021-04-10 15:02:06 +02:00
Iain Buclaw 2b77874831 libphobos: Remove is-effective-target static from druntime and phobos tests
This test isn't compiling with `-static', it's there to verify that the
libphobos is functional when linked in statically.

libphobos/ChangeLog:

	* testsuite/libphobos.druntime/druntime.exp: Remove
	is-effective-target static.
	* testsuite/libphobos.phobos/phobos.exp: Likewise.
2021-04-10 15:02:06 +02:00
Iain Buclaw 38258326dc libphobos: Re-add -fno-moduleinfo flag to dg-runtest [PR99812]
libphobos/ChangeLog:

	PR d/99812
	* testsuite/libphobos.druntime_shared/druntime_shared.exp: Re-add
	-fno-moduleinfo flag to dg-runtest.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
2021-04-10 15:02:06 +02:00
Iain Buclaw 5a0aa603b2 d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a
D front-end changes:

 - Explicit package visibility attribute is now always applied to
   introducing scopes.

 - Added `__traits(totype, string)' to convert mangled type string to an
   existing type.

 - Printf-like and scanf-like functions are now detected by prefixing
   them with `pragma(printf)' for printf-like functions or
   `pragma(scanf)' for scanf-like functions.

 - Added `__c_wchar_t', `__c_complex_float', `__c_complex_double', and
   `__c_complex_real' types for interfacing with C and C++.

 - Template alias parameters can now be instantiated with basic types,
   such as `int` or `void function()`.

 - Mixins can now be used as types in the form `mixin(string) var'.

 - Mixin expressions can take an argument list, same as `pragma(msg)'.

 - Implement DIP1034, add `typeof(*null)' types to represent `noreturn'.

 - `pragma(msg)' can print expressions of type `void'.

 - It is now an error to use private variables selectively imported from
   other modules.  Due to a bug, some imported private members were
   visible from other modules, violating the specification.

 - Added new syntax to declare an alias to a function type using the
   `alias' syntax based on the assignment operator.

 - Function literals can now return a value by reference.

Phobos changes:

 - Synchronize C bindings with the latest port fixes in upstream druntime.

 - Added alias for a `noreturn' type in object.d

 - Make use of the new `pragma(printf)' and `pragma(scanf)' pragmas, fix
   all code that got flagged as being incorrect.

 - Fixed code that relied on bugs in the D import package system.

Reviewed-on: https://github.com/dlang/dmd/pull/12339
	     https://github.com/dlang/druntime/pull/3422
	     https://github.com/dlang/phobos/pull/7932

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 3b808e838.
	* Make-lang.in (D_FRONTEND_OBJS): Add d/chkformat.o.
	* d-codegen.cc (build_struct_literal): Handle special enums.
	* d-convert.cc (convert_expr): Handle noreturn type.
	(convert_for_condition): Likewise.
	* d-target.cc (Target::_init): Set type for wchar_t.
	(TargetCPP::derivedClassOffset): New method.
	(Target::libraryObjectMonitors): New method.
	* decl.cc (get_symbol_decl): Set TREE_THIS_VOLATILE for functions of
	type noreturn.
	* toir.cc (IRVisitor::visit (ReturnStatement *)): Handle returning
	noreturn types.
	* types.cc (TypeVisitor::visit (TypeNoreturn *)): New method.
	(TypeVisitor::visit (TypeEnum *)): Handle special enums.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 483bc129.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add
	core/sys/darwin/fcntl.d.
	(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/unistd.d.
	(DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/stdc/malloc.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos f89dc217a.
	* src/Makefile.am (PHOBOS_DSOURCES): Add std/regex/internal/tests2.d.
	* src/Makefile.in: Regenerate.
	* testsuite/libphobos.exceptions/chain.d: Fix format arguments.
	* testsuite/libphobos.exceptions/line_trace.d: Likewise.
2021-04-04 01:26:20 +02:00
Iain Buclaw fdfcb5353c libphobos: Build all modules with -fversion=Shared when configured with --enable-shared
The libgdruntime_convenience library was built with `-fversion=Shared',
but the libphobos part wasn't when creating the static library.

As there are no issues compiling in Shared code into the static library,
to avoid mismatches the flag is now always present when --enable-shared
is turned on.  Libtool's compiler PIC D flag is now the combination of
compiler PIC and D Shared flags, and AM_DFLAGS passes `-prefer-pic' to
libtool unless --enable-shared is turned off.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Substitute enable_shared, enable_static, and
	phobos_lt_pic_flag.
	* libdruntime/Makefile.am (AM_DFLAGS): Replace
	  phobos_compiler_pic_flag with phobos_lt_pic_flags, and
	  phobos_compiler_shared_flag.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am (AM_DFLAGS): Replace phobos_compiler_pic_flag
	  with phobos_lt_pic_flag, and phobos_compiler_shared_flag.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/libphobos.druntime_shared/druntime_shared.exp: Remove
	-fversion=Shared and -fno-moduleinfo from default extra test flags.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
	* testsuite/testsuite_flags.in: Add phobos_compiler_shared_flag to
	--gdcflags.
2021-03-26 16:14:32 +01:00
Iain Buclaw c1d56e6a73 d: Merge upstream dmd 46133f761, druntime 0fd4364c
D front-end changes:

 - Backported built-in function handling from upstream.

 - Added new intrinsic `byteswap(ushort)`.

Druntime changes:

 - Update intrinsic modules core.bitop, core.checkedint, core.simd,
   core.vararg, and core.volatile.

 - Backport platform-specific fixes for runtime modules core.cpuid,
   core.internal.traits, and rt.lifetime.

 - Backport openbsd fixes for core.stdc.stdio.

 - Backport solaris fixes for core.sys.posix.locale, and
   core.thread.osthread (PR98910).

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 46133f761.
	* d-builtins.cc (d_build_builtins_module): Set builtins as BUILTINgcc.
	(maybe_set_builtin_1): Likewise.
	* d-frontend.cc (eval_builtin): Adjust condition for early return.
	* intrinsics.cc (maybe_set_intrinsic): Set intrinsics as BUILTINgcc.
	(maybe_expand_intrinsic): Add case for INTRINSIC_BSWAP16.
	* intrinsics.def (INTRINSIC_BT): Update signature.
	(INTRINSIC_BT64): Likewise.
	(INTRINSIC_BSWAP16): New intrinsic.
	(INTRINSIC_VLOAD8): Update module.
	(INTRINSIC_VLOAD16): Likewise.
	(INTRINSIC_VLOAD32): Likewise.
	(INTRINSIC_VLOAD64): Likewise.
	(INTRINSIC_VSTORE8): Likewise.
	(INTRINSIC_VSTORE16): Likewise.
	(INTRINSIC_VSTORE32): Likewise.
	(INTRINSIC_VSTORE64): Likewise.
	(INTRINSIC_ADDS): Update signature.
	(INTRINSIC_ADDSL): Likewise.
	(INTRINSIC_ADDU): Likewise.
	(INTRINSIC_ADDUL): Likewise.
	(INTRINSIC_SUBS): Likewise.
	(INTRINSIC_SUBSL): Likewise.
	(INTRINSIC_SUBU): Likewise.
	(INTRINSIC_SUBUL): Likewise.
	(INTRINSIC_MULS): Likewise.
	(INTRINSIC_MULSL): Likewise.
	(INTRINSIC_MULU): Likewise.
	(INTRINSIC_MULUI): Likewise.
	(INTRINSIC_MULUL): Likewise.
	(INTRINSIC_NEGS): Likewise.
	(INTRINSIC_NEGSL): Likewise.

libphobos/ChangeLog:

	PR d/98910
	* libdruntime/MERGE: Merge upstream druntime 0fd4364c.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add core/volatile.d.
	* libdruntime/Makefile.in: Regenerate.
	* testsuite/libphobos.allocations/tls_gc_integration.d: Update test.

gcc/testsuite/ChangeLog:

	* gdc.dg/intrinsics.d: Update test.
2021-02-04 23:04:48 +01:00
Iain Buclaw 92dd3e71f9 libphobos: Synchronize libdruntime bindings with upstream druntime
Reviewed-on: https://github.com/dlang/druntime/pull/3348

gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::visit (TypeInfoDeclaration *)): Don't
	layout m_arg1 and m_arg2 fields.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* libdruntime/MERGE: Merge upstream druntime e4aae28e.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Refresh module list.
	(DRUNTIME_DSOURCES_BIONIC): Add core/sys/bionic/err.d.
	(DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/err.d,
	core/sys/darwin/ifaddrs.d, core/sys/darwin/mach/nlist.d,
	core/sys/darwin/mach/stab.d, and core/sys/darwin/sys/attr.d.
	(DRUNTIME_DSOURCES_DRAGONFLYBSD): Add core/sys/dragonflybsd/err.d.
	(DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/err.d.
	(DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/err.d.
	(DRUNTIME_DSOURCES_NETBSD): Add core/sys/netbsd/err.d.
	(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/err.d.
	(DRUNTIME_DSOURCES_POSIX): Add core/sys/posix/locale.d,
	core/sys/posix/stdc/time.d, core/sys/posix/string.d, and
	core/sys/posix/strings.d.
	(DRUNTIME_DSOURCES_SOLARIS): Add core/sys/solaris/err.d.
	(DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/sdkddkver.d,
	and core/sys/windows/stdc/time.d
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/gcc/sections/elf_shared.d (sizeofTLS): New function.
	* testsuite/libphobos.thread/fiber_guard_page.d: Use
	__traits(getMember) to get internal fields.
2021-01-30 16:50:57 +01:00
Iain Buclaw 5a36cae275 d: Merge upstream dmd 609c3ce2d, phobos 3dd5df686
D front-end changes:

 - Contracts for pre- and postconditions are now implicitly "this"
   const, so that state can no longer be altered in these functions.

 - Inside a constructor scope, assigning to aggregate declaration
   members is done by considering the first assignment as initialization
   and subsequent assignments as modifications of the constructed
   object.  For const/immutable fields the initialization is accepted in
   the constructor but subsequent modifications are not.  However this
   rule did not apply when inside a constructor scope there is a call to
   a different constructor.  This been changed so it is now an error
   when there's a double initialization of immutable fields inside a
   constructor.

Phobos changes:

 - Don't run unit-tests for unsupported clocks in std.datetime.  The
   phobos and phobos_shared tests now add -fversion=Linux_Pre_2639 if
   required.

 - Deprecate public extern(C) bindings for getline and getdelim in
   std.stdio.  The correct module for bindings is core.sys.posix.stdio.

Reviewed-on: https://github.com/dlang/dmd/pull/12153
	     https://github.com/dlang/phobos/pull/7768

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 609c3ce2d.
	* d-compiler.cc (Compiler::loadModule): Rename to ...
	(Compiler::onParseModule): ... this.
	(Compiler::onImport): New function.
	* d-lang.cc (d_parse_file): Remove call to Compiler::loadModule.

libphobos/ChangeLog:

	* src/MERGE: Merge upstream phobos 3dd5df686.
	* testsuite/libphobos.phobos/phobos.exp: Add compiler flag
	-fversion=Linux_Pre_2639 if target is linux_pre_2639.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
2021-01-26 09:54:57 +01:00
Jakub Jelinek 99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Iain Buclaw 5dbab7b3f4 libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)
When libphobos is configured with --enable-cet, this adds extra fields
to the Fiber class to support the ucontext_t fallback implementation.
These fields get omitted when compiling user code unless they also used
`-fversion=CET' to build their project, which resulted in data being
overwritten from within swapcontext().

On reviewing the ucontext_t definitions, it was found that the shadow
stack fields were missing, and the struct size didn't match up on X32.
This has been fixed in upstream druntime and merged down here.

Reviewed-on: https://github.com/dlang/druntime/pull/3293

libphobos/ChangeLog:

	PR d/98025
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (DCFG_ENABLE_CET): Substitute.
	* libdruntime/MERGE: Merge upstream druntime 0fe7974c.
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/core/thread.d: Import gcc.config.
	(class Fiber): Add ucontext_t fields when GNU_Enable_CET is true.
	* libdruntime/gcc/config.d.in (GNU_Enable_CET): Define.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2020-11-27 21:27:14 +01:00
Iain Buclaw edafa96b82 libphobos: Override tool_timeout value in testsuite
Some of the larger tests in the phobos testsuite on occasion trigger the
default timeout limit.  Increasing the limit to 10 minutes should give
compilation enough time to finish.

libphobos/ChangeLog:

	* testsuite/lib/libphobos.exp: Define tool_timeout, set to 600.
2020-10-12 12:14:47 +02:00
Iain Buclaw 0ed757604f libphobos: libdruntime doesn't support shadow stack (PR95680)
The first implementation hit a front-end implementation bug where
version conditions are resolved ahead of static if confitions.

The logic for whether to use asm implemented fiber_switchContext or
libc's swapcontext has been moved from GNU_Enable_CET to version CET.

libphobos/ChangeLog:

	PR d/95680
	PR d/97007
	* Makefile.am (AM_MAKEFLAGS): Remove $(CET_FLAGS).
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (DCFG_ENABLE_CET): Remove substitution.
	(CET_DFLAGS): Substitute.
	* libdruntime/Makefile.am (AM_DFLAGS): Add $(CET_DFLAGS).
	(AM_CFLAGS): Add $(CET_FLAGS).
	(AM_CCASFLAGS): Likewise.
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/core/thread.d: Replace static if GNU_Enable_CET
	condition with `version (CET)'.
	* libdruntime/gcc/config.d.in (GNU_Enable_CET): Remove.
	* src/Makefile.am (AM_DFLAGS): Add $(CET_DFLAGS).
	(AM_CFLAGS): Add $(CET_FLAGS).
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add $(CET_DFLAGS) to --gdcflags.
2020-09-10 18:04:12 +02:00
Iain Buclaw 285d81be97 libphobos: libdruntime doesn't support shadow stack (PR95680)
Rather than implementing support within D runtime itself, use libc
getcontext/swapcontext functions if CET is enabled.

Removes whatever CET support was in the switchContext routine for x86
D runtime, along with setting version AsmExternal, so that the fallback
ucontext_t implementation is used, which is capable of doing shadow
stack handling.

libphobos/ChangeLog:

	PR d/95680
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (DCFG_ENABLE_CET): Substitute.
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/config/x86/switchcontext.S: Remove CET support code.
	* libdruntime/core/thread.d: Import gcc.config.  Don't set version
	AsmExternal when GNU_Enable_CET is true.
	* libdruntime/gcc/config.d.in (GNU_Enable_CET): Define.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2020-09-08 12:14:56 +02:00
Iain Buclaw 6948c7c3d2 d: Turn on deprecation warnings by default.
This is the default in the upstream reference compiler, and can reduce
some confusion when comparing warning/error messages of gdc and dmd side
by side.

Merges libphobos with upstream druntime d05ebaad and phobos 021ae0df7.

Reviewed-on: https://github.com/dlang/druntime/pull/3127
	     https://github.com/dlang/phobos/pull/7521

gcc/d/ChangeLog:

	* d-lang.cc (d_init_options): Turn on deprecation warnings by default.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime d05ebaad.
	* src/MERGE: Merge upstream phobos 021ae0df7.
	* testsuite/libphobos.typeinfo/struct-align.d: Remove empty statement.

gcc/testsuite/ChangeLog:

	* gdc.dg/asm1.d: Don't use deprecated asm syntax.
	* gdc.dg/compilable.d: Add public to selective import.
	* gdc.dg/lto/ltotests_0.d: Explicitly catch Throwable.
	* gdc.dg/runnable.d: Remove empty statement.
2020-06-25 17:02:45 +02:00
Iain Buclaw 05b6520ed2 d: Merge upstream dmd 934df6f8c, druntime 7bdd83d7
Corrects a previous change made to the SPARC stdc bindings, and
backports PPC-related fixes.  The library and language testsuite now
passes fully on powerpc64le-linux-gnu.

Fixes: PR d/90719
Fixes: PR d/94825

Reviewed-on: https://github.com/dlang/dmd/pull/11079
	     https://github.com/dlang/druntime/pull/3078
	     https://github.com/dlang/druntime/pull/3083

libphobos/ChangeLog:

	PR d/94825
	* libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Remove
	config/powerpc/switchcontext.S
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/config/powerpc/callwithstack.S: Remove.
	* libdruntime/config/powerpc/switchcontext.S: Fix symbol name of
	fiber_switchContext.
	* libdruntime/core/thread.d: Disable fiber migration tests on PPC.
	* testsuite/libphobos.thread/fiber_guard_page.d: Set guardPageSize
	same as stackSize.
2020-04-30 12:16:11 +02:00
Iain Buclaw 5916f2f673 libphobos: Fix KERNEL_VERSION condition in libphobos testsuite
A typo in the macro call meant that the #error always triggered.

libphobos/ChangeLog:

	* testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639):
	Fix KERNEL_VERSION condition.
2020-04-29 10:42:21 +02:00
Iain Buclaw 81e07d422c libphobos: Remove GDCFLAGSX variable from configure scripts.
Always run testsuite with same GDCFLAGS as used in build.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove GDCFLAGSX.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Use GDCFLAGS in --gdcflags.
	* testsuite/libphobos.thread/fiber_guard_page.d: Test using -O0.
2020-04-21 23:03:23 +02:00
Iain Buclaw 261bd78d57 libphobos: Add --with-libphobos-druntime-only option.
The intended purpose of the option is both for targets that don't
support phobos yet, and for gdc itself to support bootstrapping itself
as a self-hosted D compiler.

The libphobos testsuite has been updated to only add libphobos to the
search paths if it's being built.  A new D2 testsuite directive
RUNNABLE_PHOBOS_TEST has also been patched in to disable some runnable
tests that have phobos dependencies, of which is a temporary measure
until upstream DMD fixes or removes these tests entirely.

gcc/testsuite/ChangeLog:

	* lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for tests that
	depending on the phobos standard library.

libphobos/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add --with-libphobos-druntime-only option and the
	conditional ENABLE_LIBDRUNTIME_ONLY.
	* configure.tgt: Define LIBDRUNTIME_ONLY.
	* src/Makefile.am: Add phobos sources if not ENABLE_LIBDRUNTIME_ONLY.
	* src/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add phobos path if compiling phobos.
2020-04-18 18:25:49 +02:00
Iain Buclaw b57e1621eb testsuite: Disable gdc standard runtime tests if phobos is not built.
The current check_effective_target_d_runtime procedure returns false if
the target is built without any core runtime library for D being
available (--disable-libphobos).  This additional procedure is for
targets where the core runtime library exists, but without the higher
level standard library.

gcc/ChangeLog:

	* doc/sourcebuild.texi (Effective-Target Keywords, Environment
	attributes): Document d_runtime_has_std_library.

gcc/testsuite/ChangeLog:

	* gdc.dg/link.d: Use d_runtime_has_std_library effective target.
	* gdc.dg/runnable.d: Move phobos tests to...
	* gdc.dg/runnable2.d: ...here.  New test.
	* lib/target-supports.exp
	(check_effective_target_d_runtime_has_std_library): New.

libphobos/ChangeLog:

	* testsuite/libphobos.phobos/phobos.exp: Skip if effective target is
	not d_runtime_has_std_library.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
2020-04-18 14:07:41 +02:00
Iain Buclaw 7478addd84 libphobos: Use libdruntime as a convenience library for libphobos.
As a prerequesite for PR94304, it becomes easier to manage selectively
compiling sublibraries when there's only one library to link to.

So a druntime convenience library is built to be part of phobos, however
separate druntime library is still built and installed, to allow linking
only to the core runtime explicitly, rather than pulling in the entire
standard library with it.

The gdc driver no longer generates an '-lgdruntime' option, and the
inclusion of the libdruntime library path has been removed from the
testsuite.

gcc/d/ChangeLog:

	* d-spec.cc (LIBDRUNTIME): Remove.
	(LIBDRUNTIME_PROFILE): Remove.
	(lang_specific_driver): Don't link in libgdruntime.

gcc/testsuite/ChangeLog:

	* lib/gdc.exp (gdc_link_flags): Remove libdruntime library path.

libphobos/ChangeLog:

	* d_rules.am (libdgruntime_la_LINK): Move to libdruntime/Makefile.am.
	(libgphobos_la_LINK): Move to src/Makefile.am
	* libdruntime/Makefile.am: Add libgdruntime_convenience library.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am (libgphobos_la_LIBADD): Add libgdruntime_convenience
	library.
	(libgphobos_la_DEPENDENCIES): Likewise.
	* src/Makefile.in: Regenerate.
	* testsuite/lib/libphobos.exp: Remove libdruntime library paths.
	* testsuite/testsuite_flags.in: Likewise.
2020-04-10 12:46:12 +02:00
Iain Buclaw c0dbfbd763 libphobos: Add --enable-libphobos-checking configure option
As GDCFLAGS is overriden by the top-level make file with '-O2 -g',
libphobos ends up always being built with all contracts, invariants, and
asserts compiled in.  This adds a new configurable that defaults to omit
compiling any run-time checks into the library using '-frelease'.

Other choices either set the flags '-fno-release', enabling all run-time
checks, or '-fassert', which only compiles in asserts.

The omission of compiling in contracts results in a smaller library
size, with faster build times.

libphobos/ChangeLog:

	PR d/94305
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add --enable-libphobos-checking and substitute
	CHECKING_DFLAGS.  Remove -frelease from GDCFLAGS.
	* libdruntime/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add -fno-release -funittest to
	--gdcflags.
2020-04-09 00:46:39 +02:00
Iain Buclaw 38c3017f25 libphobos: Always build with warning flags enabled
This moves WARN_DFLAGS from GDCFLAGS to AM_DFLAGS so it is always
included in the build and testsuite of libphobos.  Currently, this
doesn't happen as GDCFLAGS is overriden by it being set at the
top-level.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Substite WARN_DFLAGS independently of GDCFLAGS.
	* libdruntime/Makefile.am: Add WARN_DFLAGS to AM_DFLAGS.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Add WARN_DFLAGS to AM_DFLAGS.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add WARN_DFLAGS to --gdcflags.
2020-04-08 09:08:16 +02:00
Maciej W. Rozycki e8e66971cd Add `--with-toolexeclibdir=' configuration option
Provide means, in the form of a `--with-toolexeclibdir=' configuration
option, to override the default installation directory for target
libraries, otherwise known as $toolexeclibdir.  This is so that it is
possible to get newly-built libraries, particularly the shared ones,
installed in a common place, so that they can be readily used by the
target system as their host libraries, possibly over NFS, without a need
to manually copy them over from the currently hardcoded location they
would otherwise be installed in.

In the presence of the `--enable-version-specific-runtime-libs' option
and for configurations building native GCC the option is ignored.

	config/
	* toolexeclibdir.m4: New file.

	gcc/
	* doc/install.texi (Cross-Compiler-Specific Options): Document
	`--with-toolexeclibdir' option.

	libada/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libatomic/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libffi/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libgcc/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libgfortran/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libgomp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libhsail-rt/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libitm/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libobjc/
	* Makefile.in (aclocal_deps): Add `toolexeclibdir.m4'.
	* aclocal.m4: Include `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	liboffloadmic/
	* plugin/configure.ac: Handle `--with-toolexeclibdir='.
	* plugin/Makefile.in: Regenerate.
	* plugin/aclocal.m4: Regenerate.
	* plugin/configure: Regenerate.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libphobos/
	* m4/druntime.m4: Handle `--with-toolexeclibdir='.
	* m4/Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libquadmath/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libsanitizer/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

	libssp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libvtv/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	zlib/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2020-01-24 11:24:25 +00:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Bernd Edlinger bca3073692 libphobos.exp (libphobos_init): Add multi-lib libgcc dirs to the ld_library_path var.
2019-09-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc 
        dirs to the ld_library_path var.

From-SVN: r275332
2019-09-03 08:24:03 +00:00
Iain Buclaw 9125dc3292 libphobos: Fix segfault in runtime caused by unexpected GC of TLS data.
libphobos/ChangeLog:

2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/90250
	* libdruntime/gcc/sections/elf_shared.d (initTLSRanges): Populate
	_tlsRanges in every startup thread.
	* testsuite/libphobos.thread/thread.exp: Load libphobos-dg.exp.
	* testsuite/libphobos.thread/tlsgc_sections.d: New test.

From-SVN: r270576
2019-04-25 15:31:35 +00:00
Johannes Pfau 9168f22057 D: Implement GCC emutls in druntime
* libdruntime/Makefile.am: Add emutls and gthread files.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/gcc/emutls.d: New file. Implement GC-compatible emutls.
* libdruntime/gcc/gthread.d: New file.
* libdruntime/gcc/sections/elf_shared.d: Integrate emutls support.
* testsuite/libphobos.allocations/tls_gc_integration.d: New test for
TLS.

From-SVN: r270568
2019-04-25 11:11:39 +00:00
Iain Buclaw 7da021f080 libphobos: Add missing PWD_COMMAND to Makefile.
2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>

	* testsuite/Makefile.am: Set PWD_COMMAND.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r270566
2019-04-25 06:26:57 +00:00
Iain Buclaw 58990c4d3a libphobos: Fix FAIL phobos.exp/core.time on CentOS 5.11, Linux 2.6.18
Merges upstream druntime e03164b5.

Reviewed-on: https://github.com/dlang/druntime/pull/2581

libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89432
	* testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639):
	New proc.
	* testsuite/libphobos.druntime/druntime.exp: Add compiler flag
	-fversion=Linux_Pre_2639 if target is linux_pre_2639.
	* testsuite/libphobos.druntime_shared/druntime_shared.exp: Likewise.

From-SVN: r270554
2019-04-24 18:57:36 +00:00
Iain Buclaw 540bc8a8b1 libphobos: Skip curl tests if libcurl is not installed on the target.
libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88654
	* testsuite/lib/libphobos.exp (libphobos-dg-test): Check
	libphobos_skipped_test_p before running test.
	(libphobos-dg-prune): New proc.
	(libphobos_init): Set libphobos_skip_tests.
	(libphobos_skipped_test_p): New proc.
	(check_effective_target_libcurl_available): New proc.
	* testsuite/libphobos.phobos/phobos.exp: Skip curl tests if library
	not found.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.

From-SVN: r270545
2019-04-24 14:17:34 +00:00
Iain Buclaw 130cc10e21 libphobos: Add D support for S/390 Linux
gcc/d/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* typeinfo.cc (create_typeinfo): Write typeinfo flags as uint.

gcc/testsuite/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* gdc.dg/link.d: Test if target d_runtime.
	* gdc.dg/runnable.d: Fix tests to work on BigEndian.
	* gdc.dg/simd.d: Likewise.

libphobos/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* configure.tgt: Add s390*-linux* as a supported target.
	* libdruntime/gcc/sections/elf_shared.d: import gcc.builtins.
	(__tls_get_addr_internal): Declare.
	(TLS_DTV_OFFSET): Define as zero on SystemZ.
	(getTLSRange): Support getting TLS on SystemZ.
	* testsuite/libphobos.typeinfo/struct-align.d: New test.

Co-Authored-By: Robin Dapp <rdapp@linux.ibm.com>

From-SVN: r270523
2019-04-23 22:53:25 +00:00
Rainer Orth 235d1c467b Work around lack of dlpi_tls_modid before Solaris 11.5
2019-04-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	    Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88150
	* m4/druntime/os.m4 (DRUNTIME_OS_DLPI_TLS_MODID): New macro.
	* configure.ac: Use it.
	Call AC_USE_SYSTEM_EXTENSIONS.
	* configure: Regenerate.
	* Makefile.in, libdruntime/Makefile.in, src/Makefile.in,
	testsuite/Makefile.in: Regenerate.
	* libdruntime/gcc/config.d.in (OS_Have_Dlpi_Tls_Modid): Define.
	* libdruntime/gcc/sections/elf_shared.d: Import gcc.config.
	(scanSegments) <PT_TLS> [OS_Have_Dlpi_Tls_Modid]: Use
	dlpi_tls_modid.
	[Solaris]: Use dlinfo(RTLD_DI_LINKMAP) to get rt_tlsmodid.
	Otherwise clear pdso._tlsMod, pdso._tlsSize.
	(getTLSRange) [Solaris && !OS_Have_Dlpi_Tls_Modid]: Readjust mod.

Co-Authored-By: Iain Buclaw <ibuclaw@gdcproject.org>

From-SVN: r270347
2019-04-14 09:30:42 +00:00
Rainer Orth ba838aa6c3 Work around Solaris ld bug linking __tls_get_addr on 64-bit x86
* m4/druntime/os.m4 (DRUNTIME_OS_LINK_SPEC): New macro.
	* configure.ac: Call it.
	* configure: Regenerate.
	* Makefile.in, libdruntime/Makefile.in, src/Makefile.in,
	testsuite/Makefile.in: Regenerate.
	* src/libgphobos.spec.in (*link): Append OS_LINK_SPEC.

From-SVN: r270346
2019-04-14 09:24:26 +00:00
Iain Buclaw bb50312e02 libphobos: Add target-zlib to top-level configure
Removes the building of zlib from within libphobos, using instead the
libz_convenience.a library.

ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* configure.ac: Add target-zlib to target_libraries.
	* configure: Regenerate.

gcc/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* doc/install.texi: Document --with-target-system-zlib.

libphobos/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_ZLIB): Use
	libz_convenience.a if not using system zlib.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Remove ZLIB_CSOURCES and AM_CFLAGS.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r270328
2019-04-12 20:13:34 +00:00
Iain Buclaw df63d1b7f7 libphobos: Parallelize the libphobos testsuite
The removal of the check programs in libphobos means that all tests
will now be compiled one at a time, causing a notable slowdown in
comparison with the previous method of testing.

libphobos/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* testsuite/Makefile.am:
	* testsuite/Makefile.am (AUTOMAKE_OPTIONS): Remove dejagnu.
	(RUNTEST): Remove variable.
	(RUNTESTDEFAULTFLAGS, check_p_subno, check_p_numbers0,
	check_p_numbers1, check_p_numbers2, check_p_numbers3,
	check_p_numbers4, check_p_numbers5, check_p_numbers6, check_p_numbers,
	check_p_subdirs, check_DEJAGNU_libphobos_targets): New variables.
	(site.exp, %/site.exp, check-DEJAGNU, check-am, clean-local): New
	rules written so that all the *.exp files are ran parallelized.
	(CLEANFILES): Add *.exe, *.o, and site.exp.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r270303
2019-04-12 06:25:34 +00:00
Iain Buclaw 0d6aae249d libphobos: Replace library check programs with dg-runtest
Fixes multilib handling when running the libphobos testsuite.

libphobos/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89255
	* configure.ac (ENABLE_SHARED, ENABLE_STATIC): Remove conditionals.
	* configure: Regenerate.
	* d_rules.am (%.t.lo, %.t.o): Remove rules.
	(unittest_static_LINK, unittest_LINK, libgdruntime_t_la_LINK,
	libgphobos_t_la_LINK): Remove variables.
	* libdruntime/Makefile.am (DRUNTIME_TEST_LOBJECTS,
	DRUNTIME_TEST_OBJECTS, check_PROGRAMS, check_LTLIBRARIES,
	unittest_static_SOURCES, unittest_static_LIBTOOLFLAGS,
	unittest_static_LDFLAGS, unittest_static_LDADD,
	EXTRA_unittest_static_DEPENDENCIES, libgdruntime_t_la_SOURCES,
	libgdruntime_t_la_LIBTOOLFLAGS, libgdruntime_t_la_LDFLAGS,
	libgdruntime_t_la_LIBADD, EXTRA_libgdruntime_t_la_DEPENDENCIES,
	unittest_SOURCES, unittest_LIBTOOLFLAGS, unittest_LDFLAGS,
	unittest_LDADD): Remove variables.
	(clean-local): Remove rule.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am (PHOBOS_TEST_LOBJECTS,
	PHOBOS_TEST_OBJECTS, check_PROGRAMS, check_LTLIBRARIES,
	unittest_static_SOURCES, unittest_static_LIBTOOLFLAGS,
	unittest_static_LDFLAGS, unittest_static_LDADD,
	EXTRA_unittest_static_DEPENDENCIES, libgdruntime_t_la_SOURCES,
	libgdruntime_t_la_LIBTOOLFLAGS, libgdruntime_t_la_LDFLAGS,
	libgdruntime_t_la_LIBADD, EXTRA_libgdruntime_t_la_DEPENDENCIES,
	unittest_SOURCES, unittest_LIBTOOLFLAGS, unittest_LDFLAGS,
	unittest_LDADD): Remove variables.
	(clean-local): Remove rule.
	* src/Makefile.in: Regenerate.
	* testsuite/lib/libphobos.exp (libphobos_test_name): New global.
	(libphobos_init): Set libphobos_test_name.
	(libphobos-dg-test): Override name if libphobos_test_name is set.
	(filter_libphobos_unittests): New proc.
	* testsuite/libphobos.aa/aa.exp: Don't load libphobos-dg.exp.
	* testsuite/libphobos.cycles/cycles.exp: Set libphobos_test_name.
	* testsuite/libphobos.druntime/druntime.exp: New file.
	* testsuite/libphobos.druntime_shared/druntime_shared.exp: New file.
	* testsuite/libphobos.phobos/phobos.exp: New file.
	* testsuite/libphobos.phobos_shared/phobos_shared.exp: New file.
	* testsuite/libphobos.shared/shared.exp: Use dg-runtest to run tests.
	* testsuite/libphobos.hash/hash.exp: Don't load libphobos-dg.exp
	* testsuite/libphobos.init_fini/init_fini.exp: Likewise.
	* testsuite/libphobos.thread/thread.exp: Likewise.
	* testsuite/libphobos.typeinfo/typeinfo.exp: Likewise.
	* testsuite/libphobos.unittests/unittests.exp: Remove.
	* testsuite/test_runner.d: Remove.
	* testsuite/testsuite_flags.in: Add phobos to --gdcpaths.

From-SVN: r270302
2019-04-12 06:25:17 +00:00
Iain Buclaw be200c5c41 Fix libphobos.shared/load.d compile failure on Solaris
2019-02-19  Iain Buclaw  <ibuclaw@gdcproject.org>

	* testsuite/libphobos.shared/load.d: Import core.sys.posix.dlfcn.
	[DragonFlyBSD, FreeBSD, linux, NetBSD, OSX, Solaris]: Import only
	RTLD_NOLOAD from core.sys.*.dlfcn.
	Assert RTLD_NOLOAD is available.

From-SVN: r269014
2019-02-19 12:38:48 +00:00
Johannes Pfau 36d7f1518f libphobos: Detect if qsort_r is available
Merges upstream druntime bbfb58e8.

libphobos/ChangeLog:

2019-02-19  Johannes Pfau  <johannespfau@gmail.com>

	PR d/88127
	* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): Add new macro.
	* configure.ac: Use DRUNTIME_LIBRARIES_CLIB.
	* configure: Regenerate
	* Makefile.in: Regenerate
	* libdruntime/gcc/config.d.in: Add Have_Qsort_R.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r268999
2019-02-18 23:29:39 +00:00
Rainer Orth cc2cc3bef3 Tabify all D *.exp files
libphobos:
	* testsuite/lib/libphobos-dg.exp: Tabify.
	* testsuite/lib/libphobos.exp: Likewise.
	* testsuite/libphobos.cycles/cycles.exp: Likewise.
	* testsuite/libphobos.shared/shared.exp: Likewise.
	* testsuite/libphobos.unittests/unittests.exp: Likewise.

	gcc/testsuite:
	* gdc.dg/dg.exp: Tabify.
	* gdc.dg/lto/lto.exp: Likewise.
	* gdc.test/gdc-test.exp: Likewise.
	* lib/gdc-dg.exp: Likewise.
	* lib/gdc.exp: Likewise.

From-SVN: r268987
2019-02-18 13:53:51 +00:00
Rainer Orth 0b6e3127e8 Provide __start_minfo/__stop_minfo for linkers that don't (PR d/87864)
libphobos:
	PR d/87864
	* configure.ac (DRTSTUFF_SPEC): New variable.
	Substitute it.
	* libdruntime/m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING):
	New automake conditional.
	* configure: Regenerate.
	* libdruntime/gcc/drtstuff.c: New file.
	* libdruntime/Makefile.am [!DRUNTIME_OS_MINFO_BRACKETING]
	(DRTSTUFF, toolexeclib_DATA): New variables.
	(gcc/drtbegin.lo, gcc/drtend.lo): New rules.
	(libgdruntime_la_LDFLAGS): Use -Wc instead of -Xcompiler.
	Add -dstartfiles -B../src -Bgcc.
	(libgdruntime_la_DEPENDENCIES): New variable.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgdruntime_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* src/Makefile.am (libgphobos_la_LDFLAGS): Use -Wc instead of
	-Xcompiler.
	Add -dstartfiles -B../libdruntime/gcc.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgphobos_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* libdruntime/Makefile.in, src/Makefile.in: Regenerate.
	* Makefile.in, testsuite/Makefile.in: Regenerate.
	* libdruntime/rt/sections_elf_shared.d (Minfo_Bracketing): Don't
	assert.
	* libdruntime/gcc/config.d.in (Minfo_Bracketing): Remove.
	* src/drtstuff.spec: New file.
	* src/libgphobos.spec.in (DRTSTUFF_SPEC): Substitute.
	(*lib): Only pass SPEC_PHOBOS_DEPS without -debuglib, -defaultlib,
	-nophoboslib.
	* testsuite/testsuite_flags.in <--gdcldflags> (GDCLDFLAGS): Add
	-B${BUILD_DIR}/libdruntime/gcc.

	gcc/d:
	PR d/87864
	* lang.opt (dstartfiles): New option.
	* d-spec.cc (need_spec): New variable.
	(lang_specific_driver) <OPT_dstartfiles>: Enable need_spec.
	(lang_specific_pre_link): Also load libgphobos.spec if need_spec.

	gcc/testsuite:
	PR d/87864
	* lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if
	present.

From-SVN: r268886
2019-02-14 17:47:49 +00:00
Iain Buclaw d8b1f499d9 libphobos: Merge upstream druntime 2f764ab6
Fixes hashing of complex reals, enabling testing of rt.util.typeinfo and
core.internal.hash.

Reviewed-on: https://github.com/dlang/druntime/pull/6837

libphobos/ChangeLog:

	* Makefile.in: Rebuild.
	* configure: Rebuild.
	* libdruntime/Makefile.am: Test rt.util.typeinfo and
	core.internal.convert.
	* libdruntime/Makefile.in: Rebuild.
	* src/Makefile.in: Rebuild.
	* testsuite/Makefile.in: Rebuild.
	* testsuite/libphobos.hash/test_hash.d: Update test.

From-SVN: r268755
2019-02-10 22:10:22 +00:00
Iain Buclaw e613d99266 libphobos: Apply core.internal.hash updates from druntime
Backported from upstream druntime 2.084

Reviewed-on: https://github.com/dlang/druntime/pull/2469

libphobos/ChangeLog:

	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Remove rt/util/hash.d
	* libdruntime/Makefile.in: Rebuild.
	* testsuite/libphobos.aa/aa.exp: New file.
	* testsuite/libphobos.aa/test_aa.d: New test.
	* testsuite/libphobos.hash/hash.exp: New file.
	* testsuite/libphobos.hash/test_hash.d: New test.

From-SVN: r268754
2019-02-10 21:01:24 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Iain Buclaw 85041a5b77 Merge libphobos upstream version 2.076.1
Updated the library version to 76:3:0.

libphobos/ChangeLog:

2018-11-28  Iain Buclaw  <ibuclaw@gdcproject.org>

	* Makefile.in: Rebuild.
	* configure: Rebuild.
	* configure.ac (DRUNTIME_SOVERSION): Remove.
	(PHOBOS_SOVERSION): Remove.
	(libtool_VERSION): Add.
	* libdruntime/Makefile.am: Use libtool_VERSION.
	* libdruntime/Makefile.in: Rebuild.
	* src/Makefile.am: Use libtool_VERSION.
	* src/Makefile.in: Rebuild.
	* testsuite/Makefile.in: Rebuild.

From-SVN: r266572
2018-11-28 17:54:07 +00:00
Johannes Pfau d8bcb00f21 re PR d/87824 (x86_64-linux multilib issues)
libphobos/ChangeLog:

2018-11-22  Johannes Pfau  <johannespfau@gmail.com>

	PR d/87824
	* testsuite/libphobos.shared/shared.exp: Set proper path to phobos
	library for multilib builds.

From-SVN: r266366
2018-11-22 06:14:47 +00:00
Iain Buclaw ac67752d79 Fix libgphobos.spec in the wrong place with --enable-version-specific-runtime-libs
libphobos/ChangeLog:

2018-11-01  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87827
	* Makefile.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Properly set MULTISUBDIR.
	* d_rules.am: Set toolexecdir and toolexeclibdir.
	* libdruntime/Makefile.in: Rebuild.
	* m4/druntime.m4 (DRUNTIME_INSTALL_DIRECTORIES): Add
	--enable-version-specific-runtime-libs.
	* src/Makefile.in: Rebuild.
	* testsuite/Makefile.in: Rebuild.

From-SVN: r265742
2018-11-02 08:29:50 +00:00
Joseph Myers 22e0527251 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)

The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf.  Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree.  Autoconf 2.69 has Go support, so
local copies of that support are removed.  I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update.  Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.

Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory).  Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.

While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers.  Specifically, most of those warnings
were of the following form (example from libgfortran):

Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed.  In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.

I've tested this with native, cross and Canadian cross builds.  The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.

top level:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* multilib.am: New file.  From automake.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

config:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

fixincludes:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, configure: Regenerate.

gcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use single
	line for second argument of AC_DEFINE_UNQUOTED.
	* doc/install.texi (Tools/packages necessary for modifying GCC):
	Update to autoconf 2.69 and automake 1.15.1.
	* aclocal.m4, config.in, configure: Regenerate.

gnattools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

gotools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* config/go.m4: Remove file.
	* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
	* configure.ac:  Remove AC_PREREQ.  Do not include config/go.m4.
	* Makefile.in, aclocal.m4, configure: Regenerate.

intl:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

libada:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

libatomic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* acinclude.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libbacktrace:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libcc1:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libcpp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* aclocal.m4, config.in, configure: Regenerate.

libdecnumber:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libffi:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove doc/libffi.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
	include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
	Regenerate.

libgcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* configure: Regenerate.

libgfortran:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libgo [logically part of this change but omitted from the commit]:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* config/go.m4: Remove file.
	* config/libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use
	-Wno-override in AM_INIT_AUTOMAKE call.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libgomp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libgomp.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libhsail-rt:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libiberty:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

libitm:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libitm.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libobjc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, config.h.in, configure: Regenerate.

liboffloadmic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* plugin/Makefile.am: Include multilib.am.
	* plugin/configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
	plugin/aclocal.m4, plugin/configure: Regenerate.

libphobos:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use -Wno-override in
	AM_INIT_AUTOMAKE call.
	* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
	* m4/druntime/os.m4: Use AC_LANG_SOURCE.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
	src/Makefile.in, testsuite/Makefile.in: Regenerate.

libquadmath:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.8.  Add info-in-builddir.
	(all-local): Define outside conditional code.
	(CLEANFILES): Remove libquadmath.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libsanitizer:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.

libssp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.9.5.
	* configure.ac: Remove AC_PREREQ.  Quote argument to
	AC_RUN_IFELSE.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libstdc++-v3:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
	include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
	python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
	src/c++17/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

libvtv:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

lto-plugin:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

zlib:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

From-SVN: r265695
2018-10-31 17:03:16 +00:00