tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Major issue with current macos port. clang and tcc .o


From: Christian Jullien
Subject: Re: [Tinycc-devel] Major issue with current macos port. clang and tcc .o are not compatible
Date: Tue, 23 Jun 2020 18:44:32 +0200

Hi Michael,

 

I agree that it is the same on Windows however on macOS and more generally on unix systems it is not uncommon to have components shipped as static libs (.a).

While I never copy .o I very often use .a installed on my system.

In that case, you can't use tcc with any of them.

For example, once installed, OpenLisp static libs compiled with clang go to /usr/local/lib (as with many others)

 

ls /usr/local/lib/*.a

/usr/local/lib/libasprintf.a            /usr/local/lib/libgmp.a                 /usr/local/lib/libpcre2-16.a

/usr/local/lib/libcord.a                /usr/local/lib/libgmpxx.a               /usr/local/lib/libpcre2-32.a

/usr/local/lib/libevent.a               /usr/local/lib/libguile-3.0.a           /usr/local/lib/libpcre2-8.a

/usr/local/lib/libevent_core.a          /usr/local/lib/libhogweed.a             /usr/local/lib/libpcre2-posix.a

/usr/local/lib/libevent_extra.a         /usr/local/lib/libidn2.a                /usr/local/lib/libtasn1.a

/usr/local/lib/libevent_openssl.a       /usr/local/lib/libintl.a                /usr/local/lib/libtcc.a

/usr/local/lib/libevent_pthreads.a      /usr/local/lib/libltdl.a                /usr/local/lib/libtextstyle.a

/usr/local/lib/libgc.a                  /usr/local/lib/liblzma.a                /usr/local/lib/libunbound.a

/usr/local/lib/libgccpp.a               /usr/local/lib/libnettle.a              /usr/local/lib/libunistring.a

/usr/local/lib/libgdbm.a                /usr/local/lib/libola64.a

/usr/local/lib/libgettextpo.a           /usr/local/lib/libolcpa64.a

 

 

Trying to compile an application with tcc that uses a clang .a lib fails.

jullien@byas src % tcc -o lisp main.c -lola64

 

jullien@byas src % tcc -o lisp main.c -lola64

tcc: error: undefined symbol '_olmain'

tcc: error: undefined symbol '_olmemheader'

 

You must use shared libs which are slower and introduce dependencies on executable.

Reverse is true, you can’t use a .a compiled with tcc with clang. A clang++ program can’t statically link with tcc lib.

 

Don’t think I loudly complain. I really enjoy this first version and the amazing work you did.

I hope you agree with all my macos commits which try to make the port even better.

 

-----Original Message-----
From: Michael Matz [mailto:matz.tcc@frakked.de]
Sent: Tuesday, June 23, 2020 18:16
To: jullien@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] Major issue with current macos port. clang and tcc .o are not compatible

 

Hello Christian,

 

On Tue, 23 Jun 2020, Christian Jullien wrote:

 

> As suspected, I have a proof that current version does not allow to mix

> clang and tcc objects (which is of course a big issue).

 

Well, of course, that's exactly the same as if someone tried to do similar

things on Windows, the .o files from there and tcc aren't compatible

either.  Why do you say this is a major issue, when it isn't on Windows?

 

Personally I think this restriction is perfectly fine, how often do you

copy over .o files from somewhere else?

 

 

Ciao,

Michael.


reply via email to

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