Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-15 Thread Christian Jullien
Sorry but it was supposed to be a private email.

I asked David if he thinks the latest FreeBSD patch is ready to be committed.
IMHO it clearly improves all FreeBSD ports.

Sorry again for this French message.

C.


-Original Message-
From: Christian Jullien [mailto:eli...@orange.fr] 
Sent: Tuesday, February 15, 2022 10:52
To: 'tinycc-devel@nongnu.org'
Subject: RE: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

Bonjour David,

Le dernier patch semble minimal et complet.
Comme tu en es à l'initiative, tu peux le pousser dans mob.

Si Grischka proteste, il n'avait qu'à réagir mais franchement, je ne vois pas 
pourquoi il le ferait.

Bonne journée.

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of David CARLIER
Sent: Wednesday, February 02, 2022 18:13
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.

Kind regards.
-- Forwarded message -
From: David CARLIER 
Date: Sun, 30 Jan 2022 at 18:35
Subject: Re: [PATCH] freebsd support update proposal
To: 


> new version considering feedbacks. Cheers.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-15 Thread Christian Jullien
Bonjour David,

Le dernier patch semble minimal et complet.
Comme tu en es à l'initiative, tu peux le pousser dans mob.

Si Grischka proteste, il n'avait qu'à réagir mais franchement, je ne vois pas 
pourquoi il le ferait.

Bonne journée.

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of David CARLIER
Sent: Wednesday, February 02, 2022 18:13
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.

Kind regards.
-- Forwarded message -
From: David CARLIER 
Date: Sun, 30 Jan 2022 at 18:35
Subject: Re: [PATCH] freebsd support update proposal
To: 


> new version considering feedbacks. Cheers.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-09 Thread Christian Jullien
I think this one is good.

 

Thanks for your review.

 

C.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Herman ten Brugge via Tinycc-devel
Sent: Wednesday, February 09, 2022 08:14
To: tinycc-devel@nongnu.org
Cc: Herman ten Brugge
Subject: Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

 

On 2/9/22 06:45, Christian Jullien wrote:

Hi Herman,

 

As just tested, your recent patch fixes the __Thread_local issue we have 
otherwise with 

 

I think, the two following patches proposed by David are also needed, wdyt?

 

diff --git a/include/tccdefs.h b/include/tccdefs.h

index 2d42bea..1bef382 100644

--- a/include/tccdefs.h

+++ b/include/tccdefs.h

@@ -91,6 +91,11 @@

# if __SIZEOF_POINTER__ == 8

 /* FIXME, __int128_t is used by setjump */

 #define __int128_t struct { unsigned char _dummy[16] 
__attribute((aligned(16))); }

+#define __SIZEOF_SIZE_T__ 8

+#define __SIZEOF_PTRDIFF_T__ 8

+#else

+#define __SIZEOF_SIZE_T__ 4

+#define __SIZEOF_PTRDIFF_T__ 4

# endif

 #elif defined __FreeBSD_kernel__

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_TIDsyscall (SYS_getthrid)

-#elif defined(__FreeBSD__) || defined(__NetBSD__)

+#elif defined(__FreeBSD__)

#define BOUND_TID_TYPE   pid_t

-#define BOUND_GET_TID0

-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || 
defined(__aarch64__) || defined(__riscv)

+#define BOUND_GET_TIDsyscall (SYS_thr_self)

+#elif defined(__NetBSD__)

+#define BOUND_TID_TYPE   pid_t

+#define BOUND_GET_TIDsyscall (SYS_lwp_self)

+#elif defined(__linux__)

#define BOUND_TID_TYPE   pid_t

#define BOUND_GET_TIDsyscall (SYS_gettid)

#else

 

There is a typo in the netbsd part. See attached corrected patch.
The other parts are ok.

Herman



 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Herman ten Brugge via Tinycc-devel
Sent: Tuesday, February 08, 2022 19:03
To: tinycc-devel@nongnu.org
Cc: Herman ten Brugge
Subject: Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

 

On 2/7/22 10:54, grischka wrote:

David CARLIER wrote: 




Hi if nobody objects, I may apply the last aforementioned patch 
sometime next week. 


Since you asked: 





--- a/tests/tests2/46_grep.c 
+++ b/tests/tests2/46_grep.c 
@@ -14,6 +14,9 @@ 
  * included and reference made to  the  fact  that  reproduction 
  * privileges were granted by DECUS. 
  */ 
+#if defined(__FreeBSD__) 
+#include  
+#endif 
 #include  
 #include  
 #include // tolower() 


- what is this (nobody will know without a comment) 
- sys/cdefs.h is not that a user file should include 
- 46_grep.c looks really "innocent" enough that it should compile 
  OOTB on any C and platform 
- in general, when tests fail, we want the problem be fixed, not the test 

Maybe you can find a better solution, or maybe someone else can... 

-- gr 


I checked the stdio.h file on freebsd 12.2 and 13.0 and see:

.
#ifndef _STDIO_H_ 
#define _STDIO_H_ 

#include 
.

So the file is included in stdio.h for freebsd.
What version of freebsd are you using?

Herman

PS:
I just added a fix for freebsd 13.0 in mob.











Kind regards. 

 

 

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-08 Thread Herman ten Brugge via Tinycc-devel

On 2/9/22 06:45, Christian Jullien wrote:


Hi Herman,

As just tested, your recent patch fixes the __Thread_local issue we 
have otherwise with 


I think, the two following patches proposed by David are also needed, 
wdyt?


diff --git a/include/tccdefs.h b/include/tccdefs.h

index 2d42bea..1bef382 100644

--- a/include/tccdefs.h

+++ b/include/tccdefs.h

@@ -91,6 +91,11 @@

# if __SIZEOF_POINTER__ == 8

/* FIXME, __int128_t is used by setjump */

#define __int128_t struct { unsigned char _dummy[16] 
__attribute((aligned(16))); }


+ #define __SIZEOF_SIZE_T__ 8

+ #define __SIZEOF_PTRDIFF_T__ 8

+#else

+ #define __SIZEOF_SIZE_T__ 4

+ #define __SIZEOF_PTRDIFF_T__ 4

# endif

 #elif defined __FreeBSD_kernel__

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


There is a typo in the netbsd part. See attached corrected patch.
The other parts are ok.

    Herman


*From:*Tinycc-devel 
[mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] *On Behalf 
Of *Herman ten Brugge via Tinycc-devel

*Sent:* Tuesday, February 08, 2022 19:03
*To:* tinycc-devel@nongnu.org
*Cc:* Herman ten Brugge
*Subject:* Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

On 2/7/22 10:54, grischka wrote:

David CARLIER wrote:

Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.


Since you asked:


--- a/tests/tests2/46_grep.c
+++ b/tests/tests2/46_grep.c
@@ -14,6 +14,9 @@
  * included and reference made to  the  fact  that reproduction
  * privileges were granted by DECUS.
  */
+#if defined(__FreeBSD__)
+#include 
+#endif
 #include 
 #include 
 #include     // tolower()


- what is this (nobody will know without a comment)
- sys/cdefs.h is not that a user file should include
- 46_grep.c looks really "innocent" enough that it should compile
  OOTB on any C and platform
- in general, when tests fail, we want the problem be fixed, not
the test

Maybe you can find a better solution, or maybe someone else can...

-- gr


I checked the stdio.h file on freebsd 12.2 and 13.0 and see:

.
#ifndef _STDIO_H_
#define _STDIO_H_

#include 
.

So the file is included in stdio.h for freebsd.
What version of freebsd are you using?

    Herman

PS:
I just added a fix for freebsd 13.0 in mob.





Kind regards.

diff --git a/include/tccdefs.h b/include/tccdefs.h
index 2d42bea..83e3c38 100644
--- a/include/tccdefs.h
+++ b/include/tccdefs.h
@@ -88,9 +88,15 @@
 #define __GNUC_PATCHLEVEL__ 0
 #define __GNUC_STDC_INLINE__ 1
 #define __NO_TLS 1
+#define __RUNETYPE_INTERNAL 1
 # if __SIZEOF_POINTER__ == 8
 /* FIXME, __int128_t is used by setjump */
 #define __int128_t struct { unsigned char _dummy[16] 
__attribute((aligned(16))); }
+#define __SIZEOF_SIZE_T__ 8
+#define __SIZEOF_PTRDIFF_T__ 8
+#else
+#define __SIZEOF_SIZE_T__ 4
+#define __SIZEOF_PTRDIFF_T__ 4
 # endif
 
 #elif defined __FreeBSD_kernel__
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 0379b6e..91b7b12 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_TIDsyscall (SYS_getthrid)
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__)
 #define BOUND_TID_TYPE   pid_t
-#define BOUND_GET_TID0
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || 
defined(__aarch64__) || defined(__riscv)
+#define BOUND_GET_TIDsyscall (SYS_thr_self)
+#elif defined(__NetBSD__)
+#define BOUND_TID_TYPE   pid_t
+#define BOUND_GET_TIDsyscall (SYS__lwp_self)
+#elif defined(__linux__)
 #define BOUND_TID_TYPE   pid_t
 #define BOUND_GET_TIDsyscall (SYS_gettid)
 #else
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-08 Thread Christian Jullien
Hi Herman,

 

As just tested, your recent patch fixes the __Thread_local issue we have 
otherwise with 

 

I think, the two following patches proposed by David are also needed, wdyt?

 

diff --git a/include/tccdefs.h b/include/tccdefs.h

index 2d42bea..1bef382 100644

--- a/include/tccdefs.h

+++ b/include/tccdefs.h

@@ -91,6 +91,11 @@

# if __SIZEOF_POINTER__ == 8

 /* FIXME, __int128_t is used by setjump */

 #define __int128_t struct { unsigned char _dummy[16] 
__attribute((aligned(16))); }

+#define __SIZEOF_SIZE_T__ 8

+#define __SIZEOF_PTRDIFF_T__ 8

+#else

+#define __SIZEOF_SIZE_T__ 4

+#define __SIZEOF_PTRDIFF_T__ 4

# endif

 #elif defined __FreeBSD_kernel__

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_TIDsyscall (SYS_getthrid)

-#elif defined(__FreeBSD__) || defined(__NetBSD__)

+#elif defined(__FreeBSD__)

#define BOUND_TID_TYPE   pid_t

-#define BOUND_GET_TID0

-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || 
defined(__aarch64__) || defined(__riscv)

+#define BOUND_GET_TIDsyscall (SYS_thr_self)

+#elif defined(__NetBSD__)

+#define BOUND_TID_TYPE   pid_t

+#define BOUND_GET_TIDsyscall (SYS_lwp_self)

+#elif defined(__linux__)

#define BOUND_TID_TYPE   pid_t

#define BOUND_GET_TIDsyscall (SYS_gettid)

#else

 

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Herman ten Brugge via Tinycc-devel
Sent: Tuesday, February 08, 2022 19:03
To: tinycc-devel@nongnu.org
Cc: Herman ten Brugge
Subject: Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

 

On 2/7/22 10:54, grischka wrote:

David CARLIER wrote: 



Hi if nobody objects, I may apply the last aforementioned patch 
sometime next week. 


Since you asked: 




--- a/tests/tests2/46_grep.c 
+++ b/tests/tests2/46_grep.c 
@@ -14,6 +14,9 @@ 
  * included and reference made to  the  fact  that  reproduction 
  * privileges were granted by DECUS. 
  */ 
+#if defined(__FreeBSD__) 
+#include  
+#endif 
 #include  
 #include  
 #include // tolower() 


- what is this (nobody will know without a comment) 
- sys/cdefs.h is not that a user file should include 
- 46_grep.c looks really "innocent" enough that it should compile 
  OOTB on any C and platform 
- in general, when tests fail, we want the problem be fixed, not the test 

Maybe you can find a better solution, or maybe someone else can... 

-- gr 


I checked the stdio.h file on freebsd 12.2 and 13.0 and see:

.
#ifndef _STDIO_H_ 
#define _STDIO_H_ 

#include 
.

So the file is included in stdio.h for freebsd.
What version of freebsd are you using?

Herman

PS:
I just added a fix for freebsd 13.0 in mob.









Kind regards. 

 

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-08 Thread Herman ten Brugge via Tinycc-devel

On 2/7/22 10:54, grischka wrote:

David CARLIER wrote:

Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.


Since you asked:


--- a/tests/tests2/46_grep.c
+++ b/tests/tests2/46_grep.c
@@ -14,6 +14,9 @@
  * included and reference made to  the  fact  that reproduction
  * privileges were granted by DECUS.
  */
+#if defined(__FreeBSD__)
+#include 
+#endif
 #include 
 #include 
 #include     // tolower()


- what is this (nobody will know without a comment)
- sys/cdefs.h is not that a user file should include
- 46_grep.c looks really "innocent" enough that it should compile
  OOTB on any C and platform
- in general, when tests fail, we want the problem be fixed, not the test

Maybe you can find a better solution, or maybe someone else can...

-- gr


I checked the stdio.h file on freebsd 12.2 and 13.0 and see:

.
#ifndef _STDIO_H_
#define _STDIO_H_

#include 
.

So the file is included in stdio.h for freebsd.
What version of freebsd are you using?

    Herman

PS:
I just added a fix for freebsd 13.0 in mob.





Kind regards.



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-07 Thread grischka

David CARLIER wrote:

Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.


Since you asked:


--- a/tests/tests2/46_grep.c
+++ b/tests/tests2/46_grep.c
@@ -14,6 +14,9 @@
  * included and reference made to  the  fact  that  reproduction
  * privileges were granted by DECUS.
  */
+#if defined(__FreeBSD__)
+#include 
+#endif
 #include 
 #include 
 #include// tolower()


- what is this (nobody will know without a comment)
- sys/cdefs.h is not that a user file should include
- 46_grep.c looks really "innocent" enough that it should compile
  OOTB on any C and platform
- in general, when tests fail, we want the problem be fixed, not the test

Maybe you can find a better solution, or maybe someone else can...

-- gr



Kind regards.



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Fwd: [PATCH] freebsd support update proposal

2022-02-02 Thread David CARLIER
Hi if nobody objects, I may apply the last aforementioned patch
sometime next week.

Kind regards.
-- Forwarded message -
From: David CARLIER 
Date: Sun, 30 Jan 2022 at 18:35
Subject: Re: [PATCH] freebsd support update proposal
To: 


> new version considering feedbacks. Cheers.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel