tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Grischka last commit breaks some ports


From: grischka
Subject: Re: [Tinycc-devel] Grischka last commit breaks some ports
Date: Sat, 19 Dec 2020 10:40:53 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Herman ten Brugge via Tinycc-devel wrote:
On 12/18/20 2:45 PM, grischka wrote:
Christian Jullien wrote:
On OpenBSD:

I noticed some tests were excluded but the reasons were say
not really obvious:

Test: 106_pthread...

From it's name it's testing pthreads. OpenBSD appears to have
pthreads. So what is the deal?
I added a comment that pthread_condattr_setpshared does not exists.

Better than nothing.  Still someone might ask what the heck so
interesting with pthread_condattr_whatnot is this trying to test
at all?  (You know that, and maybe I do, but...)

Anyway, if printf had versyms then I'd just test that instead and
while at it, rename to 106_versym.  I guess it doesn't.

Test: 114_bound_signal...
^^^^  wait forever

I think I mailed the reason before.
The problem is in the libc implementation.
- signals should be disabled during pthread_create
- after a fork libc should init the internal i/o mutex for a client
process.

I fixed the pthread_create problem in bcheck.c but this does not work
for bsd because of broken dlsym.
I disabled the fork test on mac. All other libc do this correctly.

Hm, on an alpine musl it does hang, sometimes.  Sometimes it comes
back after a few seconds.  Sometimes almost instantly.

There is also another problem.
The dlltest does not work on arm(32 bits) because the jmp_buf has
different size in tcc and gcc due to '__attribute__((__aligned__ (8)))'

Only the "dlltest with PIC" links to a gcc file.  But wrong size
for TCCState is not good.

See code below.
tcc prints: 388
gcc prints: 392.
If I move the jmpbuf field in the struct TCCState to the end the code
works.

Should we implement the aligned attribute in tcc or should we disable
this test on arm32?

We do have the aligned attribute in tcc and we tried to make it
work. Also, your test does print 392 with tcc on a 32-bit windows:

#define BF_DEBUG

    set field __val offset 0  size 128 align 4
    struct size 128 align 4

    set field __jmpbuf offset 0  size 256 align 8
    set field __mask_was_saved offset 256 size 4  align 4
    set field __saved_mask offset 260 size 128 align 4
    struct size 392 align 8

Why it can be different on arm,  hm...,  maybe __attribute__ was
defined to empty?

-- grischka


    Herman



#include <stdio.h>

typedef int __jmp_buf[64] __attribute__((__aligned__ (8)));
typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;

struct __jmp_buf_tag
  {
    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };

int

main(void)
{
   printf ("%d\n", sizeof (struct __jmp_buf_tag));
   return 0;
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]