tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] e41730f11 (tcc -vv: show cross-libtcc1.a correctly (a


From: grischka
Subject: Re: [Tinycc-devel] e41730f11 (tcc -vv: show cross-libtcc1.a correctly (and more)) broke my libtcc code
Date: Wed, 5 Oct 2022 20:33:43 +0200
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 04.10.2022 07:45, Eric Raible wrote:
Perhaps I was using libtcc incorrectly, but libtcc.h is a bit unclear about it.

The comment for tcc_set_output_type() says:
/* set output type. MUST BE CALLED before any compilation */

In reality, as of e41730f11 that is no longer good enough.
It used to be that tcc_add_symbol() would work if called before
tcc_set_output_type().
After e41730f11 tcc_set_output_type() must be called first in order to
avoid symtab_section==0.

Sure, I can fix this by calling tcc_set_output_type() first, but it
was a regression for my use case.

Hi,

Well, I think we could argue that since the output type can be also
PREPROCESS,  and since for example tcc_add_symbol() does not make
sense in that case, it is somewhat reasonable that libtcc wants to know
the output type before it would accept other specific api calls.

Such the "correct" order (if any) is:
- create the state
- set options and paths
- set the output type
- ... proceed

Incidentally just the other day after the commit there was a report
from "Chris" about all kind of strange problems that he had, and the
reason turned out was that he forgot to set any output type at all.
https://lists.gnu.org/archive/html/tinycc-devel/2022-09/msg00009.html

At least that now wont happen to anyone anymore ;)

-- gr



A more general comment: tcc and the ongoing work is awesome awesome
awesome, THANK YOU!

Thanks - Eric

_______________________________________________
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]