tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] libtcc without tcclib1 on Emscripten


From: noneofyourbusiness
Subject: Re: [Tinycc-devel] libtcc without tcclib1 on Emscripten
Date: Sat, 12 Aug 2023 13:55:47 +0200

> From: Marcus Ottosson <konstruktion@gmail.com>
> Subject: [Tinycc-devel] libtcc without tcclib1 on Emscripten

> I've had great success with libtcc as a prototyping/scripting language for
> my application, however one of my targets is Emscripten which does not have
> the ability to dynamically load libraries nor access the filesystem.
> Before I abandon all hope, can I confirm whether it is possible to use
> libtcc without dynamically loading any other files, such as tcclib1?

What you are describing is possible.
1. no dynamic linking
2. no filesystem access

for 1. you just statically link instead
for 2. you paste all the sources into the program instead of getting them from 
the filesystem, that's easy with a cpp, it's made for doing that

1.
as can be seen in ./configure -h
you can use
./configure --enable-static
to produce an archive libtcc.a, with which you can produce statically linked 
binaries as you please

2.
within libtcc you can specify options with tcc_set_options(), including 
-static, -nostdlib, etc.

example:

tcc_set_options(s, "-static -nostdlib -nostdinc");

P.S.
        nm libtcc.a | grep U
reveals a lot of undefined symbols to sort out, plenty of them from tcc which 
are not in libtcc1 either



reply via email to

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