As a matter a style, I prefer to define BOUND_TID_TYPE and BOUND_GET_TIB for a
single system like:
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 0379b6e..007b8c2 100644
--- a/lib/bcheck.c
+++ b/lib/bcheck.c
@@ -226,9 +226,12 @@ typedef struct alloca_list_struct {
#elif defined(__OpenBSD__)
#define BOUND_TID_TYPE pid_t
#define BOUND_GET_TID syscall (SYS_getthrid)
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__)
#define BOUND_TID_TYPE pid_t
-#define BOUND_GET_TID 0
+#define BOUND_GET_TID syscall (SYS_thr_self)
+#elif defined(__NetBSD__)
+#define BOUND_TID_TYPE pid_t
+#define BOUND_GET_TID syscall (SYS_lwp_self)
#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) ||
defined(__aarch64__) || defined(__riscv)
#define BOUND_TID_TYPE pid_t
#define BOUND_GET_TID syscall (SYS_gettid)
But this is your patch not mine.
Grischka, I also think that the last #elif should be relate to __linux__ not
for specific CPU, so complete patch for bcheck should be
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 0379b6e..3f66b1c 100644
--- a/lib/bcheck.c
+++ b/lib/bcheck.c
@@ -226,10 +226,13 @@ typedef struct alloca_list_struct {
#elif defined(__OpenBSD__)
#define BOUND_TID_TYPE pid_t
#define BOUND_GET_TID syscall (SYS_getthrid)
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__)
#define BOUND_TID_TYPE pid_t
-#define BOUND_GET_TID 0
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) ||
defined(__aarch64__) || defined(__riscv)
+#define BOUND_GET_TID syscall (SYS_thr_self)
+#elif defined(__NetBSD__)
+#define BOUND_TID_TYPE pid_t
+#define BOUND_GET_TID syscall (SYS_lwp_self)
+#elif defined(__linux__)
#define BOUND_TID_TYPE pid_t
#define BOUND_GET_TID syscall (SYS_gettid)
#else
Wdyt?
-----Original Message-----
From: Tinycc-devel [mailto:[email protected]] On
Behalf Of David CARLIER
Sent: Sunday, January 30, 2022 14:44
To: [email protected]
Subject: Re: [Tinycc-devel] [PATCH] freebsd support update proposal
Hi here a revised version.
Cheers.
On Sat, 29 Jan 2022 at 17:38, David CARLIER <[email protected]> wrote:
>
> fair enough. thanks.
>
> On Sat, 29 Jan 2022 at 17:09, David CARLIER <[email protected]> wrote:
> >
> > Hi and thanks here a new version of the patchset.
> >
> > On Sat, 29 Jan 2022 at 00:18, David CARLIER <[email protected]> wrote:
> > >
> > > adding few constants for compile time and fetching thread id for bound
> > > check.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel