Skip to content

Master #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/gcc/gcc-vers.texi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@set version-GCC 11.0.1
@set DEVELOPMENT
@set srcdir C:/data/build/gcc/../../gcc
@set VERSION_PACKAGE (GCC)
@set BUGURL @uref{https://gcc.gnu.org/bugs/}
12,305 changes: 12,305 additions & 0 deletions build/gcc/tm.texi

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions gcc/config.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,8 @@ case ${target} in
default_use_cxa_atexit=yes
;;
esac
d_target_objs="${d_target_objs} openbsd-d.o"
target_has_targetdm=yes
;;
*-*-phoenix*)
gas=yes
Expand Down Expand Up @@ -2121,6 +2123,8 @@ i[34567]86-*-cygwin*)
extra_objs="${extra_objs} winnt.o winnt-stubs.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
d_target_objs="${d_target_objs} winnt-d.o"
target_has_targetdm="yes"
if test x$enable_threads = xyes; then
thread_file='posix'
fi
Expand All @@ -2137,6 +2141,8 @@ x86_64-*-cygwin*)
extra_objs="${extra_objs} winnt.o winnt-stubs.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
d_target_objs="${d_target_objs} winnt-d.o"
target_has_targetdm="yes"
if test x$enable_threads = xyes; then
thread_file='posix'
fi
Expand All @@ -2149,7 +2155,9 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
xm_file=i386/xm-mingw32.h
c_target_objs="${c_target_objs} winnt-c.o"
cxx_target_objs="${cxx_target_objs} winnt-c.o"
d_target_objs="${d_target_objs} winnt-d.o"
target_has_targetcm="yes"
target_has_targetdm="yes"
case ${target} in
x86_64-*-* | *-w64-*)
need_64bit_isa=yes
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/aarch64/aarch64-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/arm/arm-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
1 change: 1 addition & 0 deletions gcc/config/freebsd-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "memmodel.h"
#include "tm.h"
#include "tm_p.h"
#include "d/d-target.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/i386/cygming.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ along with GCC; see the file COPYING3. If not see
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
flag_pic = TARGET_64BIT ? 1 : 0; \
if (!global_options_set.x_dwarf_version) \
dwarf_version = 4; \
} while (0)

/* Define this macro if references to a symbol must be treated
Expand Down
9 changes: 9 additions & 0 deletions gcc/config/i386/cygwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ along with GCC; see the file COPYING3. If not see
} \
while (0)

#define EXTRA_TARGET_D_OS_VERSIONS() \
do \
{ \
builtin_version ("Cygwin"); \
builtin_version ("Posix"); \
builtin_version ("CRuntime_Newlib"); \
} \
while (0)

#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
%{!ansi:-Dunix} \
Expand Down
14 changes: 14 additions & 0 deletions gcc/config/i386/i386-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "d/d-target.h"
#include "d/d-target-def.h"
#include "d/dmd/globaltypes.h" /* For enum LINK. */

/* Implement TARGET_D_CPU_VERSIONS for x86 targets. */

Expand All @@ -42,3 +45,14 @@ ix86_d_target_versions (void)
else
d_add_builtin_version ("D_SoftFloat");
}

/* Implement TARGET_D_EXTERN_SYSTEM_LINKAGE for x86 targets. */

int
ix86_d_extern_system_linkage (void)
{
if (ix86_abi == MS_ABI)
return LINKwindows;

return LINKc;
}
1 change: 1 addition & 0 deletions gcc/config/i386/i386-protos.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ extern void ix86_register_pragmas (void);

/* In i386-d.c */
extern void ix86_d_target_versions (void);
extern int ix86_d_extern_system_linkage (void);

/* In winnt.c */
extern void i386_pe_unique_section (tree, int);
Expand Down
3 changes: 2 additions & 1 deletion gcc/config/i386/i386.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,9 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
/* Target Pragmas. */
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()

/* Target CPU versions for D. */
/* Target hooks for D language. */
#define TARGET_D_CPU_VERSIONS ix86_d_target_versions
#define TARGET_D_EXTERN_SYSTEM_LINKAGE ix86_d_extern_system_linkage

#ifndef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) "
Expand Down
12 changes: 12 additions & 0 deletions gcc/config/i386/mingw32.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ along with GCC; see the file COPYING3. If not see
} \
while (0)

#define EXTRA_TARGET_D_OS_VERSIONS() \
do \
{ \
builtin_version ("MinGW"); \
if (TARGET_64BIT && ix86_abi == MS_ABI) \
builtin_version ("Win64"); \
else if (!TARGET_64BIT) \
builtin_version ("Win32"); \
builtin_version ("CRuntime_Microsoft"); \
} \
while (0)

#ifndef TARGET_USE_PTHREAD_BY_DEFAULT
#define SPEC_PTHREAD1 "pthread"
#define SPEC_PTHREAD2 "!no-pthread"
Expand Down
4 changes: 4 additions & 0 deletions gcc/config/i386/t-cygming
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coret
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/i386/winnt-stubs.c

winnt-d.o: $(srcdir)/config/i386/winnt-d.c
$(COMPILE) $<
$(POSTCOMPILE)

msformat-c.o: $(srcdir)/config/i386/msformat-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
$(TM_P_H) $(HASHTAB_H) $(GGC_H)
Expand Down
61 changes: 61 additions & 0 deletions gcc/config/i386/winnt-d.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* Windows support needed only by D front-end.
Copyright (C) 2021 Free Software Foundation, Inc.

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.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "target.h"
#include "d/d-target.h"
#include "d/d-target-def.h"
#include "tm_p.h"

/* Implement TARGET_D_OS_VERSIONS for Windows targets. */

static void
winnt_d_os_builtins (void)
{
d_add_builtin_version ("Windows");

if (ix86_abi == SYSV_ABI)
d_add_builtin_version ("SYSV_ABI");
else
d_add_builtin_version ("MS_ABI");

#define builtin_version(TXT) d_add_builtin_version (TXT)

#ifdef EXTRA_TARGET_D_OS_VERSIONS
EXTRA_TARGET_D_OS_VERSIONS ();
#endif
}

#undef TARGET_D_OS_VERSIONS
#define TARGET_D_OS_VERSIONS winnt_d_os_builtins

/* Define TARGET_D_MINFO_SECTION for Windows targets. */

#undef TARGET_D_MINFO_SECTION
#define TARGET_D_MINFO_SECTION "minfo"

#undef TARGET_D_MINFO_START_NAME
#define TARGET_D_MINFO_START_NAME "__start_minfo"

#undef TARGET_D_MINFO_END_NAME
#define TARGET_D_MINFO_END_NAME "__stop_minfo"

struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
2 changes: 2 additions & 0 deletions gcc/config/mips/mips-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
39 changes: 39 additions & 0 deletions gcc/config/openbsd-d.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Functions for generic OpenBSD as target machine for GNU D compiler.
Copyright (C) 2021 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.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "memmodel.h"
#include "tm.h"
#include "tm_p.h"
#include "d/d-target.h"
#include "d/d-target-def.h"

static void
openbsd_d_os_builtins (void)
{
d_add_builtin_version ("Posix");
d_add_builtin_version ("OpenBSD");
}

#undef TARGET_D_OS_VERSIONS
#define TARGET_D_OS_VERSIONS openbsd_d_os_builtins

struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
2 changes: 2 additions & 0 deletions gcc/config/pa/pa-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/riscv/riscv-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/rs6000/rs6000-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/s390/s390-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
2 changes: 2 additions & 0 deletions gcc/config/sparc/sparc-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
Expand Down
5 changes: 5 additions & 0 deletions gcc/config/t-openbsd
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# We don't need GCC's own include files.
USER_H = $(EXTRA_HEADERS)

# OpenBSD-specific D support.
openbsd-d.o: $(srcdir)/config/openbsd-d.c
$(COMPILE) $<
$(POSTCOMPILE)
5 changes: 4 additions & 1 deletion gcc/d/d-target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,14 @@ TargetCPP::fundamentalType (const Type *, bool &)
return false;
}

/* Return the default system linkage for the target. */
/* Return the default `extern (System)` linkage for the target. */

LINK
Target::systemLinkage (void)
{
if (targetdm.d_extern_system_linkage)
return (LINK) targetdm.d_extern_system_linkage ();

return LINKc;
}

Expand Down
10 changes: 10 additions & 0 deletions gcc/d/d-target.def
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ relating to the target operating system.",
void, (void),
hook_void_void)

/* */
DEFHOOK
(d_extern_system_linkage,
"If defined, this hook returns the extern linkage which should be applied\n\
for all declarations annotated with @code{extern (System)}. Typically,\n\
@code{extern (System)} is the same as @code{extern (Windows)} on Microsoft\n\
Windows platforms, and @code{extern (C)} on other platforms.",
int, (void),
NULL)

/* ModuleInfo section name and brackets. */
DEFHOOKPOD
(d_minfo_section,
Expand Down
Loading