aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMaya Rashish <coypu@sdf.org>2019-02-14 21:25:39 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-02-14 21:25:39 +0000
commit2f2b8e4054f5b84594a9b113e409e73480f2ebdf (patch)
tree4363f9b841561fc326988db52935c42a19bc155f /gcc
parenta6c723e202ebd5ae388ca04b7be5ff6fbe70439f (diff)
downloadgcc-2f2b8e4054f5b84594a9b113e409e73480f2ebdf.zip
gcc-2f2b8e4054f5b84594a9b113e409e73480f2ebdf.tar.gz
gcc-2f2b8e4054f5b84594a9b113e409e73480f2ebdf.tar.bz2
Add netbsd support for D compiler and runtime
Merges upstream druntime fb4bda91. 2019-02-14 Maya Rashish <coypu@sdf.org> gcc/ChangeLog: * config.gcc (*-*-netbsd*): Add netbsd-d.o * config/netbsd-d.c: New file. * config/t-netbsd: Add netbsd-d.o gcc/d/ChangeLog: * d-system.h: NetBSD is POSIX. libphobos/ChangeLog: * configure.tgt: Add netbsd/x86 as supported target. From-SVN: r268905
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config/netbsd-d.c41
-rw-r--r--gcc/config/t-netbsd4
-rw-r--r--gcc/d/ChangeLog4
-rw-r--r--gcc/d/d-system.h3
6 files changed, 59 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1c4aa5d..e2c7b8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-14 Maya Rashish <coypu@sdf.org>
+
+ * config.gcc (*-*-netbsd*): Add netbsd-d.o
+ * config/netbsd-d.c: New file.
+ * config/t-netbsd: Add netbsd-d.o
+
2018-02-14 Steve Ellcey <sellcey@marvell.com>
* config/aarch64/aarch64.c (aarch64_attribute_table): Change
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 31b47c5..3ee31c5 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -839,6 +839,7 @@ case ${target} in
tm_p_file="${tm_p_file} netbsd-protos.h"
tmake_file="t-netbsd t-slibgcc"
extra_objs="${extra_objs} netbsd.o"
+ d_target_objs="${d_target_objs} netbsd-d.o"
gas=yes
gnu_ld=yes
use_gcc_stdint=wrap
@@ -847,6 +848,7 @@ case ${target} in
esac
nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
default_use_cxa_atexit=yes
+ target_has_targetdm=yes
;;
*-*-openbsd*)
tmake_file="t-openbsd"
diff --git a/gcc/config/netbsd-d.c b/gcc/config/netbsd-d.c
new file mode 100644
index 0000000..76342aa
--- /dev/null
+++ b/gcc/config/netbsd-d.c
@@ -0,0 +1,41 @@
+/* Functions for generic NetBSD as target machine for GNU D compiler.
+ 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.
+
+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 "tm.h"
+#include "tree.h"
+#include "varasm.h"
+#include "netbsd-protos.h"
+#include "tm_p.h"
+#include "d/d-target.h"
+#include "d/d-target-def.h"
+
+static void
+netbsd_d_os_builtins (void)
+{
+ d_add_builtin_version ("Posix");
+ d_add_builtin_version ("NetBSD");
+}
+
+#undef TARGET_D_OS_VERSIONS
+#define TARGET_D_OS_VERSIONS netbsd_d_os_builtins
+
+struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd
index 4626e96..716a94f 100644
--- a/gcc/config/t-netbsd
+++ b/gcc/config/t-netbsd
@@ -19,3 +19,7 @@
netbsd.o: $(srcdir)/config/netbsd.c
$(COMPILE) $<
$(POSTCOMPILE)
+
+netbsd-d.o: $(srcdir)/config/netbsd-d.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog
index 6eb2ac4..4bf2e95 100644
--- a/gcc/d/ChangeLog
+++ b/gcc/d/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-14 Maya Rashish <coypu@sdf.org>
+
+ * d-system.h: NetBSD is POSIX.
+
2019-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR d/87864
diff --git a/gcc/d/d-system.h b/gcc/d/d-system.h
index cd59b82..c32825d 100644
--- a/gcc/d/d-system.h
+++ b/gcc/d/d-system.h
@@ -24,7 +24,8 @@
/* Used by the dmd front-end to determine if we have POSIX-style IO. */
#define POSIX (__linux__ || __GLIBC__ || __gnu_hurd__ || __APPLE__ \
- || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun)
+ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ \
+ || __sun)
/* Forward assert invariants to gcc_assert. */
#undef assert