tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Segfault when using '-static'


From: Herman ten Brugge
Subject: Re: [Tinycc-devel] Segfault when using '-static'
Date: Thu, 26 May 2022 17:31:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

Yes.
The relocations that are missing are TLS relocations.
On other targets functions are missing that are in libgcc.a
which is only present in local gcc directory. These functions
must be implemented in libtcc to let -static work.

    Herman

On 5/26/22 17:13, Christian Jullien wrote:
Just curious,

When you say "All failed..."
Is it the consequence of

Rpi32
tcc: error: Unknown relocation type for got: 107

Rpi64
tcc: error: Unknown relocation type for got: 313

On macOS, issue is different (and logic AFAIK)
tcc: error: library 'c' not found
tcc: error: undefined symbol '_free'
tcc: error: undefined symbol '_longjmp'
tcc: error: undefined symbol '_malloc'
tcc: error: undefined symbol '_printf'
tcc: error: undefined symbol '_setjmp'

?


-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On 
Behalf Of Herman ten Brugge via Tinycc-devel
Sent: Thursday, May 26, 2022 16:04
To: tinycc-devel@nongnu.org
Cc: Herman ten Brugge
Subject: Re: [Tinycc-devel] Segfault when using '-static'

I fixed the core dump problem but still cannot use -static on any platform.
The problem is that TLS support is needed that is not implemented.

I tried x86-64, i386, rasperry pi 32 and 64, riscv64 and macos, freebsd,
netbsd.

All failed for me because of missing TLS support.

I only got this working on openbsd 7.1 (only tried x86_64).

      Herman


On 5/26/22 07:21, Arthur Williams wrote:
So noticed that I can no longer build static packages with tcc.

```
$ cat test.c
int main(){return 0;}
$./tcc -static test.c
Segmentation fault
```

I ran through git-bisect and concluded the regression was introduced in
4c82b003420fabbb95e077866784badc1a49189b: Update for elflint problems.

Simply reverting the commit allows the above example to not error. Any
objection to just reverting the offending commit.

- Arthur


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





reply via email to

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