-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined reference to `tcc_backtrace' when linking against v generated .so file on Linux #23198
Comments
Okay building generating the C and then building that with -lgc and -ltcc seems to have worked:
so I am guessing something went wrong in the link step. |
You can pass |
Turning off the GC can be done with |
After running
|
@spytheman Thanks that is super helpful! I think it should work without having to know how to use those flags but will leave it up to other folks to decide if this needs addressing further. |
Describe the bug
When creating a dynamic library on Linux I get a
.so
file referring to tcc symbols. Trying to link a C program with the system compiler (gcc) will fail as these symbols are missing. Using the same procedure it worked on macOS.Aside: I know I can put C files into my V project and build a program that way, what I really want to be able to do is call into the v
.so
using FFI from Perl.Reproduction Steps
Expected Behavior
I would expect a binary to be built and it should print out
4
when run.Current Behavior
Possible Solution
I looked at the C source generated by I noticed that references to Tiny C were wrapped in
#ifdefs
for__TINYC__
, so some knob to turn that define off or not including whatever that does define might do it. Trying to build generated by V with gcc gave me this error:Additional Information/Context
I tried this with both the
2024.50
and2024.51
pre-built binaries and by building from git, and always got the same error. Using the pre-built2024.51
on macOS worked fine though.V version
Current V version: V 0.4.8 afc07f4, timestamp: 2024-12-18 00:49:07 +0200
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21635
The text was updated successfully, but these errors were encountered: