tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Problem after compiling tiny CC


From: Michael Matz
Subject: Re: [Tinycc-devel] Problem after compiling tiny CC
Date: Wed, 30 Jun 2021 17:29:44 +0200 (CEST)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Sat, 26 Jun 2021, Elijah Stone wrote:

On Sat, 26 Jun 2021, Clive Tovero via Tinycc-devel wrote:
 Also watch out for "ar", this will cause the problem too.

Perhaps 'tcc -ar' should add libtcc.a automatically (unless you tell it not to)? That way it would be possible to compile a static library with tcc and link a gcc app to it.

No, 'tcc -ar' should behave like 'ar' (within the implemented features). It can't simply add random objects from random libraries to the output it creates. There's a proposal somewhere to extend the ar format to be able to specify dependencies on libraries for the included objects, that would be a possible half-solution. It's only a half-solution because it wouldn't specify search paths for the dependencies and hence would require putting the support libs into a default lib path forever (i.e. it would rules out the possibility to put that support lib in a compiler specific path like GCC is doing for e.g. libgcc.a).

The situation is the same as when trying to use gcc to link stuff compiled by g++, or to build with icc and link with clang, or when linking with ld directly, or the old problem of compiling with -pthread but not also linking with it. If you do that you need to know how to link the compilers runtime libs into the result. The easiest way to achieve this is to compile and link with the same program.

(for this specific instance of the problem with __mzerosf we could possibly find an alternate solution, but I think we shouldn't bother as there are other instances that can't be easily changed).


Ciao,
Michael.



reply via email to

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