[Top][All Lists]

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

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

From: Clive Tovero
Subject: Re: [Tinycc-devel] Problem after compiling tiny CC
Date: Sat, 26 Jun 2021 01:26:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

> should be automatically linked

Maybe "semi-automatically"... ;)

clive@akira:~/temp$ tinycc/tcc -v
tcc version 0.9.27 - b5d4b90 (x86_64 Linux)
clive@akira:~/temp$ cat b.c
int b(int x)
    float y = x;
    -y; /* generates the reference to __mzerosf */
    return y;
clive@akira:~/temp$ tinycc/tcc -c b.c
clive@akira:~/temp$ nm b.o
0000000000000000 T b
                 U __mzerosf
clive@akira:~/temp$ gcc -shared -o b.so b.o
clive@akira:~/temp$ ./a
./b.so: undefined symbol: __mzerosf

But I also got the OP's error with tcc:

clive@akira:~/temp$ tinycc/tcc -shared -o b.so b.c
clive@akira:~/temp$ ./a
./b.so: undefined symbol: __mzerosf

On 6/25/21 6:11 PM, Elijah Stone wrote:
On Fri, 25 Jun 2021, LOPEZ OLIVIER wrote:
I actually got an error when I dlopen the library compiled by tcc (no error when I compil it with gcc).

The error is : “undefined symbol: __mzerosf”

__mzerosf is part of the tcc runtime library, which should be automatically linked in with everything.  If you linked with gcc or l, though, it wouldn't know to do that so the symbol wouldn't be resolved. Make sure you're linking with tcc.

reply via email to

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