tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] linux/unix shared libraries?


From: grischka
Subject: Re: [Tinycc-devel] linux/unix shared libraries?
Date: Mon, 21 Apr 2008 18:07:35 +0200

Works for me. (on ubuntu 6.02)

--- grischka

From: "Olaf Dietrich":
> The simple question is: Is it or has it ever been possible to
> compile shared libraries with tcc under linux/unix?
> 
> Here is a very simple test case:
> 
> 
> $ cat mylib.c
> 
> int func(void)
> {
>         return 12345;
> }
> 
> 
> $ cat testlib.c
> 
> #include <stdio.h>
> 
> extern int func(void);
> 
> int main(void) {
>         printf("%d\n", func());
>         return 0;
> }
> 
> 
> Using gcc, I can simply compile these files and 
> obtain a working shared library:
> 
> $ export LD_LIBRARY_PATH=`pwd`
> $ gcc -fPIC -shared mylib.c -o libmylib.so
> $ gcc testlib.c -L. -lmylib -o testlib
> $ ./testlib 
> 12345
> 
> How can I do the same thing with tcc? I tried:
> 
> $ export LD_LIBRARY_PATH=`pwd`
> $ tcc -r -shared mylib.c -o libmylib.so
> $ tcc testlib.c -L. -lmylib -o testlib
> $ ./testlib 
> Segmentation fault





reply via email to

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