aboutsummaryrefslogtreecommitdiff
path: root/libphobos
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 /libphobos
parenta6c723e202ebd5ae388ca04b7be5ff6fbe70439f (diff)
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 'libphobos')
-rw-r--r--libphobos/ChangeLog4
-rw-r--r--libphobos/configure.tgt2
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/core/stdc/assert_.d7
-rw-r--r--libphobos/libdruntime/core/stdc/stdio.d34
-rw-r--r--libphobos/libdruntime/core/stdc/wchar_.d42
-rw-r--r--libphobos/libdruntime/core/sys/netbsd/dlfcn.d2
7 files changed, 62 insertions, 31 deletions
diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog
index 4efd97efaaf..22766a2d52a 100644
--- a/libphobos/ChangeLog
+++ b/libphobos/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-14 Maya Rashish <coypu@sdf.org>
+
+ * configure.tgt: Add netbsd/x86 as supported target.
+
2019-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR d/87864
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 2b2a9746811..0471bfd816b 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -30,6 +30,8 @@ case "${target}" in
;;
x86_64-*-linux* | i?86-*-linux*)
;;
+ x86_64-*-netbsd* | i?86-*-netbsd*)
+ ;;
*)
UNSUPPORTED=1
;;
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 921b954aafb..09ce8d03566 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-2fd957307d94b5ce89eb173910cc7f1995d99031
+fb4bda91b0b43b5a18e1c143943c101ad4e17667
The first line of this file holds the git revision number of the last
merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/core/stdc/assert_.d b/libphobos/libdruntime/core/stdc/assert_.d
index ead9c05f35c..ca7afe93b1e 100644
--- a/libphobos/libdruntime/core/stdc/assert_.d
+++ b/libphobos/libdruntime/core/stdc/assert_.d
@@ -53,6 +53,13 @@ else version (FreeBSD)
*/
void __assert(const(char)* exp, const(char)* file, uint line);
}
+else version (NetBSD)
+{
+ /***
+ * Assert failure function in the NetBSD C library.
+ */
+ void __assert(const(char)* file, int line, const(char)* exp);
+}
else version (DragonFlyBSD)
{
/***
diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d
index c0223b5c776..c04b9c41228 100644
--- a/libphobos/libdruntime/core/stdc/stdio.d
+++ b/libphobos/libdruntime/core/stdc/stdio.d
@@ -198,12 +198,6 @@ else version (FreeBSD)
ubyte *_base;
int _size;
}
-
- union __mbstate_t // <sys/_types.h>
- {
- char[128] _mbstate8;
- long _mbstateL;
- }
}
else version (NetBSD)
{
@@ -228,12 +222,6 @@ else version (NetBSD)
ubyte *_base;
int _size;
}
-
- union __mbstate_t // <sys/_types.h>
- {
- char[128] _mbstate8;
- long _mbstateL;
- }
}
else version (OpenBSD)
{
@@ -258,12 +246,6 @@ else version (OpenBSD)
ubyte *_base;
int _size;
}
-
- union __mbstate_t // <sys/_types.h>
- {
- char[128] __mbstate8;
- long __mbstateL;
- }
}
else version (DragonFlyBSD)
{
@@ -297,12 +279,6 @@ else version (DragonFlyBSD)
SBUF_DYNSTRUCT = 0x00080000, // sbuf must be freed
SBUF_INSECTION = 0x00100000, // set by sbuf_start_section()
}
-
- union __mbstate_t // <sys/stdint.h>
- {
- char[128] _mbstate8;
- long _mbstateL;
- }
}
else version (Solaris)
{
@@ -518,6 +494,9 @@ else version (Darwin)
}
else version (FreeBSD)
{
+ // Need to import wchar_ now since __mbstate_t now resides there
+ import core.stdc.wchar_ : mbstate_t;
+
///
alias off_t fpos_t;
@@ -554,7 +533,7 @@ else version (FreeBSD)
pthread_t _fl_owner;
int _fl_count;
int _orientation;
- __mbstate_t _mbstate;
+ mbstate_t _mbstate;
}
///
@@ -664,10 +643,7 @@ else version (DragonFlyBSD)
}
else version (Solaris)
{
- import core.stdc.wchar_ : __mbstate_t;
-
- ///
- alias mbstate_t = __mbstate_t;
+ import core.stdc.wchar_ : mbstate_t;
///
alias c_long fpos_t;
diff --git a/libphobos/libdruntime/core/stdc/wchar_.d b/libphobos/libdruntime/core/stdc/wchar_.d
index 3bdaf824b80..05c3ad862bc 100644
--- a/libphobos/libdruntime/core/stdc/wchar_.d
+++ b/libphobos/libdruntime/core/stdc/wchar_.d
@@ -43,13 +43,52 @@ version (CRuntime_Glibc)
___value __value;
}
}
+else version (FreeBSD)
+{
+ ///
+ union __mbstate_t // <sys/_types.h>
+ {
+ char[128] _mbstate8 = 0;
+ long _mbstateL;
+ }
+
+ ///
+ alias mbstate_t = __mbstate_t;
+}
+else version (NetBSD)
+{
+ ///
+ union __mbstate_t
+ {
+ int64_t __mbstateL;
+ char[128] __mbstate8;
+ }
+
+ ///
+ alias mbstate_t = __mbstate_t;
+}
else version (OpenBSD)
{
+ ///
union __mbstate_t
{
char[128] __mbstate8;
int64_t __mbstateL;
}
+
+ ///
+ alias mbstate_t = __mbstate_t;
+}
+else version (DragonFlyBSD)
+{
+ ///
+ union __mbstate_t // <sys/stdint.h>
+ {
+ char[128] _mbstate8 = 0;
+ long _mbstateL;
+ }
+
+ ///
alias mbstate_t = __mbstate_t;
}
else version (Solaris)
@@ -66,6 +105,9 @@ else version (Solaris)
int[6] __filler;
}
}
+
+ ///
+ alias mbstate_t = __mbstate_t;
}
else version (CRuntime_UClibc)
{
diff --git a/libphobos/libdruntime/core/sys/netbsd/dlfcn.d b/libphobos/libdruntime/core/sys/netbsd/dlfcn.d
index e56b5f58c68..88eb94bf20e 100644
--- a/libphobos/libdruntime/core/sys/netbsd/dlfcn.d
+++ b/libphobos/libdruntime/core/sys/netbsd/dlfcn.d
@@ -103,7 +103,7 @@ static if (__BSD_VISIBLE)
//void* fdlopen(int, int);
int dladdr(const(void)*, Dl_info*);
//dlfunc_t dlfunc(void*, const(char)*);
- //int dlinfo(void*, int, void*);
+ int dlinfo(void*, int, void*);
/+void dllockinit(void* _context,
void* function(void* _context) _lock_create,
void function(void* _lock) _rlock_acquire,