[Top][All Lists]

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

Re: [Tinycc-devel] Add support of musl-libc to tinycc

From: grischka
Subject: Re: [Tinycc-devel] Add support of musl-libc to tinycc
Date: Sat, 13 May 2017 09:00:31 +0200
User-agent: Thunderbird (Windows/20090812)

avih wrote:
I tested tcc on alpine linux (has gcc and musl-libc only) and noticed:

1. tcc commit 1094891 broke musl detection on alpine.

I disabled auto-detection and added a switch instead
   ./configure --config-musl
and a suggestion to use it if musl is detected
  "Perhaps you want ./configure --config-musl"

2. While all the tests now pass, if tcc is used to build tcc again, tests fail.

Could be setjmp/longjmp or jmp_buf size/alignment.

3. It seems that (with musl) tcc needs stdarg.h included before stdio.h, or else

You could create a stdio.h in <tccdir>/include
   #include "stdarg.h"
   #include_next <stdio.h>

4. Initializers of NAN fail with "division by 0 in a constant", but I was _not_

tcc knows __nan__

5. tcc dislikes some #defines (I couldn't reproduce in a minimal case), e.g.:
A: #define HAVE_CHMAP_API \
    (defined(SND_CHMAP_API_VERSION) && SND_CHMAP_API_VERSION >= (1 << 16))

According to the standard "#define ... defined" is undefined.

Undefined identifiers however evaluate to 0:
    #define HAVE_CHMAP_API (SND_CHMAP_API_VERSION >= (1 << 16))

All that being said, after replacing the NANs with 0, moving include stdarg to
the top, and modifying the #define, mpv builds with tcc cleanly and runs fine
on alpine (with video, opengl, audio, etc).

Doesn't sound too bad ;)

--- grischka

reply via email to

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