+2019-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ 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.
+
2019-01-26 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/89042
standard libraries. */
static bool need_phobos = true;
+/* If true, do load libgphobos.spec even if not needed otherwise. */
+static bool need_spec = false;
+
void
lang_specific_driver (cl_decoded_option **in_decoded_options,
unsigned int *in_decoded_options_count,
switch (decoded_options[i].opt_index)
{
+ case OPT_dstartfiles:
+ need_spec = true;
+ break;
+
case OPT_nostdlib:
case OPT_nodefaultlibs:
phobos_library = PHOBOS_NOLINK;
int
lang_specific_pre_link (void)
{
- if (phobos_library != PHOBOS_NOLINK && need_phobos)
+ if ((phobos_library != PHOBOS_NOLINK && need_phobos) || need_spec)
do_spec ("%:include(libgphobos.spec)");
return 0;
Driver Joined
Default library to use instead of phobos.
+dstartfiles
+Driver
+Do link the standard D startup files in the compilation.
+
-verbose
D Alias(v)
+2019-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR d/87864
+ * lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if
+ present.
+
2019-02-14 Tamar Christina <tamar.christina@arm.com>
PR target/88850
if { $gccpath != "" } {
# Path to libgphobos.spec.
append flags "-B${gccpath}/libphobos/src "
+ # Path to drtbegin.o/drtend.o.
+ if { [file exists "${gccpath}/libphobos/libdruntime/gcc/drtbegin.o"] } {
+ append flags "-B${gccpath}/libphobos/libdruntime/gcc "
+ }
if { [file exists "${gccpath}/libphobos/src/.libs/libgphobos.a"] \
|| [file exists "${gccpath}/libphobos/src/.libs/libgphobos.${shlib_ext}"] } {
+2019-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ 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.
+
2019-02-13 Iain Buclaw <ibuclaw@gdcproject.org>
* libdruntime/core/runtime.d (defaultTraceHandler): Give
# Generated by GNU Autoconf 2.69 for package-unused version-unused.
#
#
-# Copyright (C) 1992-2019 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
DCFG_HAVE_LIBATOMIC
DCFG_HAVE_64BIT_ATOMICS
DCFG_HAVE_ATOMIC_BUILTINS
+DRUNTIME_OS_MINFO_BRACKETING_FALSE
+DRUNTIME_OS_MINFO_BRACKETING_TRUE
DCFG_MINFO_BRACKETING
DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE
DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
-ac_subst_files=''
+ac_subst_files='DRTSTUFF_SPEC'
ac_user_opts='
enable_option_checking
enable_multilib
package-unused configure version-unused
generated by GNU Autoconf 2.69
-Copyright (C) 2012-2019 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11499 "configure"
+#line 11501 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11605 "configure"
+#line 11607 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ if test "$DCFG_MINFO_BRACKETING" = "true"; then
+ DRUNTIME_OS_MINFO_BRACKETING_TRUE=
+ DRUNTIME_OS_MINFO_BRACKETING_FALSE='#'
+else
+ DRUNTIME_OS_MINFO_BRACKETING_TRUE='#'
+ DRUNTIME_OS_MINFO_BRACKETING_FALSE=
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+# Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec
+if test "$DCFG_MINFO_BRACKETING" = "false"; then
+ DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec
+else
+ DRTSTUFF_SPEC=/dev/null
+fi
+
+
# Add dependencies for libgphobos.spec file
SPEC_PHOBOS_DEPS="$LIBS"
as_fn_error $? "conditional \"DRUNTIME_OS_ARM_EABI_UNWINDER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${DRUNTIME_OS_MINFO_BRACKETING_TRUE}" && test -z "${DRUNTIME_OS_MINFO_BRACKETING_FALSE}"; then
+ as_fn_error $? "conditional \"DRUNTIME_OS_MINFO_BRACKETING\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${DRUNTIME_ZLIB_SYSTEM_TRUE}" && test -z "${DRUNTIME_ZLIB_SYSTEM_FALSE}"; then
as_fn_error $? "conditional \"DRUNTIME_ZLIB_SYSTEM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012-2019 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+rm -f conf$$files.sh
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = "\a"
-
+ \$ac_cs_awk_pipe_init
}
{
line = $ 0
} else
len += 1 + keylen
}
-
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
print line
}
-
+\$ac_cs_awk_pipe_fini
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$ac_tmp/subs.awk"
+else
+ $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996-2019 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
DRUNTIME_LIBRARIES_ZLIB
DRUNTIME_INSTALL_DIRECTORIES
+# Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec
+if test "$DCFG_MINFO_BRACKETING" = "false"; then
+ DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec
+else
+ DRTSTUFF_SPEC=/dev/null
+fi
+AC_SUBST_FILE(DRTSTUFF_SPEC)
+
# Add dependencies for libgphobos.spec file
SPEC_PHOBOS_DEPS="$LIBS"
AC_SUBST(SPEC_PHOBOS_DEPS)
if DRUNTIME_OS_SOLARIS
ALL_DRUNTIME_COMPILE_DSOURCES += $(DRUNTIME_DSOURCES_SOLARIS)
endif
+
+# Provide __start_minfo, __stop_minfo if linker doesn't.
+if !DRUNTIME_OS_MINFO_BRACKETING
+ DRTSTUFF = gcc/drtbegin.o gcc/drtend.o
+
+ toolexeclib_DATA = $(DRTSTUFF)
+
+gcc/drtbegin.o: gcc/drtstuff.c
+ $(COMPILE) -DDRT_BEGIN -c -o $@ $<
+
+gcc/drtend.o: gcc/drtstuff.c
+ $(COMPILE) -DDRT_END -c -o $@ $<
+endif
+
# Generated by configure
ALL_DRUNTIME_COMPILE_DSOURCES += $(DRUNTIME_DSOURCES_GENERATED)
toolexeclib_LTLIBRARIES = libgdruntime.la
libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES)
libgdruntime_la_LIBTOOLFLAGS =
-libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
+libgdruntime_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../src,-Bgcc \
+ -version-info $(libtool_VERSION)
libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE)
+libgdruntime_la_DEPENDENCIES = $(DRTSTUFF)
# For static unittest, link objects directly
unittest_static_SOURCES = ../testsuite/test_runner.d $(DRUNTIME_CSOURCES) \
$(DRUNTIME_SSOURCES)
unittest_static_LIBTOOLFLAGS =
-unittest_static_LDFLAGS = -Xcompiler -nophoboslib
+unittest_static_LDFLAGS = -Wc,-nophoboslib
unittest_static_LDADD = $(DRUNTIME_TEST_OBJECTS) $(LIBATOMIC) $(LIBBACKTRACE)
EXTRA_unittest_static_DEPENDENCIES = $(DRUNTIME_TEST_OBJECTS)
libgdruntime_t_la_LIBTOOLFLAGS =
# Automake by default does not generate shared libs for non-installed
# libraries. Use -rpath to force shared lib generation.
-libgdruntime_t_la_LDFLAGS = -Xcompiler -nophoboslib -rpath /foo -shared
+libgdruntime_t_la_LDFLAGS = -Wc,-nophoboslib -rpath /foo -shared
libgdruntime_t_la_LIBADD = $(DRUNTIME_TEST_LOBJECTS) $(LIBATOMIC) $(LIBBACKTRACE)
EXTRA_libgdruntime_t_la_DEPENDENCIES = $(DRUNTIME_TEST_LOBJECTS)
# For unittest
unittest_SOURCES = ../testsuite/test_runner.d
unittest_LIBTOOLFLAGS =
-unittest_LDFLAGS = -Xcompiler -nophoboslib
+unittest_LDFLAGS = -Wc,-nophoboslib
unittest_LDADD = libgdruntime_t.la
# Extra install and clean rules.
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(toolexeclibdir)"
+am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
+ "$(DESTDIR)$(toolexeclibdir)"
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
am__DEPENDENCIES_1 =
-libgdruntime_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
am__dirstamp = $(am__leading_dot)dirstamp
am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \
core/checkedint.lo core/cpuid.lo core/demangle.lo \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+DATA = $(toolexeclib_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# Setup source files depending on configure
+
# Generated by configure
ALL_DRUNTIME_COMPILE_DSOURCES = $(DRUNTIME_DSOURCES) $(am__append_1) \
$(am__append_2) $(am__append_3) $(am__append_4) \
$(am__append_8) $(am__append_9) $(am__append_10) \
$(am__append_11) $(am__append_12) \
$(DRUNTIME_DSOURCES_GENERATED)
+
+# Provide __start_minfo, __stop_minfo if linker doesn't.
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@DRTSTUFF = gcc/drtbegin.o gcc/drtend.o
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@toolexeclib_DATA = $(DRTSTUFF)
ALL_DRUNTIME_SOURCES = $(ALL_DRUNTIME_COMPILE_DSOURCES) $(DRUNTIME_CSOURCES) \
$(DRUNTIME_SSOURCES)
toolexeclib_LTLIBRARIES = libgdruntime.la
libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES)
libgdruntime_la_LIBTOOLFLAGS =
-libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
+libgdruntime_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../src,-Bgcc \
+ -version-info $(libtool_VERSION)
+
libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE)
+libgdruntime_la_DEPENDENCIES = $(DRTSTUFF)
# For static unittest, link objects directly
unittest_static_SOURCES = ../testsuite/test_runner.d $(DRUNTIME_CSOURCES) \
$(DRUNTIME_SSOURCES)
unittest_static_LIBTOOLFLAGS =
-unittest_static_LDFLAGS = -Xcompiler -nophoboslib
+unittest_static_LDFLAGS = -Wc,-nophoboslib
unittest_static_LDADD = $(DRUNTIME_TEST_OBJECTS) $(LIBATOMIC) $(LIBBACKTRACE)
EXTRA_unittest_static_DEPENDENCIES = $(DRUNTIME_TEST_OBJECTS)
libgdruntime_t_la_LIBTOOLFLAGS =
# Automake by default does not generate shared libs for non-installed
# libraries. Use -rpath to force shared lib generation.
-libgdruntime_t_la_LDFLAGS = -Xcompiler -nophoboslib -rpath /foo -shared
+libgdruntime_t_la_LDFLAGS = -Wc,-nophoboslib -rpath /foo -shared
libgdruntime_t_la_LIBADD = $(DRUNTIME_TEST_LOBJECTS) $(LIBATOMIC) $(LIBBACKTRACE)
EXTRA_libgdruntime_t_la_DEPENDENCIES = $(DRUNTIME_TEST_LOBJECTS)
# For unittest
unittest_SOURCES = ../testsuite/test_runner.d
unittest_LIBTOOLFLAGS =
-unittest_LDFLAGS = -Xcompiler -nophoboslib
+unittest_LDFLAGS = -Wc,-nophoboslib
unittest_LDADD = libgdruntime_t.la
DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d
# Source file definitions. Boring stuff, auto-generated with
-rm -rf rt/typeinfo/.libs rt/typeinfo/_libs
-rm -rf rt/util/.libs rt/util/_libs
-rm -rf rt/util/container/.libs rt/util/container/_libs
+install-toolexeclibDATA: $(toolexeclib_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \
+ done
+
+uninstall-toolexeclibDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(toolexeclibdir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
check: check-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(toolexeclibdir)"; do \
+ for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-dvi-am:
-install-exec-am: install-toolexeclibLTLIBRARIES
+install-exec-am: install-toolexeclibDATA \
+ install-toolexeclibLTLIBRARIES
install-html: install-html-am
ps-am:
-uninstall-am: uninstall-toolexeclibLTLIBRARIES
+uninstall-am: uninstall-toolexeclibDATA \
+ uninstall-toolexeclibLTLIBRARIES
.MAKE: check-am install-am install-strip
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
- install-toolexeclibLTLIBRARIES installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-toolexeclibLTLIBRARIES
+ install-toolexeclibDATA install-toolexeclibLTLIBRARIES \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-toolexeclibDATA \
+ uninstall-toolexeclibLTLIBRARIES
.PRECIOUS: Makefile
%.t.o : %.t.lo
@:
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@gcc/drtbegin.o: gcc/drtstuff.c
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@ $(COMPILE) -DDRT_BEGIN -c -o $@ $<
+
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@gcc/drtend.o: gcc/drtstuff.c
+@DRUNTIME_OS_MINFO_BRACKETING_FALSE@ $(COMPILE) -DDRT_END -c -o $@ $<
+
# Extra install and clean rules.
# This does not delete the .libs/.t.o files, but deleting
# the .lo is good enough to rerun the rules
enum ThreadModel GNU_Thread_Model = ThreadModel.@DCFG_THREAD_MODEL@;
-// Whether the linker provides __start_minfo and __stop_minfo symbols
-enum Minfo_Bracketing = @DCFG_MINFO_BRACKETING@;
-
// Whether target has support for builtin atomics.
enum GNU_Have_Atomics = @DCFG_HAVE_ATOMIC_BUILTINS@;
--- /dev/null
+/* Provide minfo section bracketing for D executables and shared libraries
+ when the linker doesn't provide it.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* Avoid interference with targets without support for named sections. */
+#ifdef __ELF__
+
+#ifdef DRT_BEGIN
+void *__start_minfo[]
+__attribute__((used, section("minfo"), aligned(sizeof(void *)))) = { };
+#endif
+
+#ifdef DRT_END
+void *__stop_minfo[]
+__attribute__((used, section("minfo"), aligned(sizeof(void *)))) = { };
+#endif
+
+#endif /* __ELF__ */
///////////////////////////////////////////////////////////////////////////////
import gcc.config;
-static assert(Minfo_Bracketing, "Can't use _d_dso_registry interface");
/*
* This data structure is generated by the compiler, and then passed to
[AC_MSG_RESULT([no])
DCFG_MINFO_BRACKETING=false])
AC_SUBST(DCFG_MINFO_BRACKETING)
+ AM_CONDITIONAL([DRUNTIME_OS_MINFO_BRACKETING], [test "$DCFG_MINFO_BRACKETING" = "true"])
AC_LANG_POP([C])
])
toolexeclib_LTLIBRARIES = libgphobos.la
libgphobos_la_SOURCES = $(ALL_PHOBOS_SOURCES) $(ZLIB_SRC)
libgphobos_la_LIBTOOLFLAGS =
-libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
+libgphobos_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../libdruntime/gcc \
+ -version-info $(libtool_VERSION)
libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la
libgphobos_la_DEPENDENCIES = libgphobos.spec
# For static unittest, link objects directly
unittest_static_SOURCES = ../testsuite/test_runner.d $(ZLIB_SRC)
unittest_static_LIBTOOLFLAGS =
-unittest_static_LDFLAGS = -Xcompiler -nophoboslib -static-libtool-libs
+unittest_static_LDFLAGS = -Wc,-nophoboslib -static-libtool-libs
unittest_static_LDADD = $(PHOBOS_TEST_OBJECTS) \
../libdruntime/libgdruntime.la
EXTRA_unittest_static_DEPENDENCIES = $(PHOBOS_TEST_OBJECTS)
# For unittest with dynamic library
libgphobos_t_la_SOURCES = $(ZLIB_SRC)
libgphobos_t_la_LIBTOOLFLAGS =
-libgphobos_t_la_LDFLAGS = -Xcompiler -nophoboslib -rpath /foo -shared
+libgphobos_t_la_LDFLAGS = -Wc,-nophoboslib -rpath /foo -shared
libgphobos_t_la_LIBADD = $(PHOBOS_TEST_LOBJECTS) \
../libdruntime/libgdruntime.la
EXTRA_libgphobos_t_la_DEPENDENCIES = $(PHOBOS_TEST_LOBJECTS)
# For unittest
unittest_SOURCES = ../testsuite/test_runner.d
unittest_LIBTOOLFLAGS =
-unittest_LDFLAGS = -Xcompiler -nophoboslib -shared
+unittest_LDFLAGS = -Wc,-nophoboslib -shared
unittest_LDADD = libgphobos_t.la ../libdruntime/libgdruntime.la
# Extra install and clean rules.
toolexeclib_LTLIBRARIES = libgphobos.la
libgphobos_la_SOURCES = $(ALL_PHOBOS_SOURCES) $(ZLIB_SRC)
libgphobos_la_LIBTOOLFLAGS =
-libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
+libgphobos_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../libdruntime/gcc \
+ -version-info $(libtool_VERSION)
+
libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la
libgphobos_la_DEPENDENCIES = libgphobos.spec
# For static unittest, link objects directly
unittest_static_SOURCES = ../testsuite/test_runner.d $(ZLIB_SRC)
unittest_static_LIBTOOLFLAGS =
-unittest_static_LDFLAGS = -Xcompiler -nophoboslib -static-libtool-libs
+unittest_static_LDFLAGS = -Wc,-nophoboslib -static-libtool-libs
unittest_static_LDADD = $(PHOBOS_TEST_OBJECTS) \
../libdruntime/libgdruntime.la
# For unittest with dynamic library
libgphobos_t_la_SOURCES = $(ZLIB_SRC)
libgphobos_t_la_LIBTOOLFLAGS =
-libgphobos_t_la_LDFLAGS = -Xcompiler -nophoboslib -rpath /foo -shared
+libgphobos_t_la_LDFLAGS = -Wc,-nophoboslib -rpath /foo -shared
libgphobos_t_la_LIBADD = $(PHOBOS_TEST_LOBJECTS) \
../libdruntime/libgdruntime.la
# For unittest
unittest_SOURCES = ../testsuite/test_runner.d
unittest_LIBTOOLFLAGS =
-unittest_LDFLAGS = -Xcompiler -nophoboslib -shared
+unittest_LDFLAGS = -Wc,-nophoboslib -shared
unittest_LDADD = libgphobos_t.la ../libdruntime/libgdruntime.la
# Zlib sources when not using system libz
--- /dev/null
+%rename startfile startfile_orig
+*startfile: %(startfile_orig) drtbegin.o%s
+
+%rename endfile endfile_orig
+*endfile: %(endfile_orig) drtend.o%s
# order.
#
+@DRTSTUFF_SPEC@
+
%rename lib liborig_gdc_renamed
-*lib: @SPEC_PHOBOS_DEPS@ %(liborig_gdc_renamed)
+*lib: %{debuglib|defaultlib|nophoboslib: ; :@SPEC_PHOBOS_DEPS@} %(liborig_gdc_renamed)
;;
--gdcldflags)
GDCLDFLAGS="-B${BUILD_DIR}/src
+ -B${BUILD_DIR}/libdruntime/gcc
-L${BUILD_DIR}/libdruntime/.libs
-L${BUILD_DIR}/src/.libs"
echo ${GDCLDFLAGS}