-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
tools: default to -cc clang on FreeBSD tests #21534
Conversation
Why is it needed? It only tests the The |
The reason it worked for me, was that in my FreeBSD VM, I have applied this patch (from https://discord.com/channels/592103645835821068/592106336838352923/1197417932771315822 ) in --- /sys/sys/cdefs.h 2023-08-25 13:19:02.607408000 -0700
+++ /usr/include/sys/cdefs.h 2023-11-26 13:42:31.999208000 -0800
@@ -539,10 +539,16 @@
__asm__(".section .gnu.warning." #sym); \
__asm__(".asciz \"" msg "\""); \
__asm__(".previous")
+#ifndef __TINYC__
#define __sym_compat(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@" #verid)
#define __sym_default(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@@@" #verid)
+#else
+/* TinyC doesn't implement .symver */
+#define __sym_compat(sym,impl,verid)
+#define __sym_default(sym,impl,verid)
+#endif
#else
#define __weak_reference(sym,alias) \
__asm__(".weak alias"); \ |
I am running on a stock 14.0 release, so that patch isn't on my system. Thanks for pointing it out. |
As much as I like tcc, because of its speed, the V tests, should pass on a stock FreeBSD, when possible. Thanks for fixing it. |
I don't see this patch in the main branch of FreeBSD. Do you know who authored it? I don't have a discord account so I can't see the discussion. If it's ok, I can create a pull request for it but I would like to give credit to whoever came up with it. |
It was done by @bakul . |
The patch originally came from Warner Losh. Ideally someone teaches tcc about .symver…. Also note that there is something else broken on arm64 platform for tcc. Nevertheless it is a good idea to run tests once in a while with tcc as more things are broken now. At one point only tests using atomics were broken and I tracked it down to some interaction with the boen-go-threaded pkg…. |
I had asked Warner about integrating this patch. He said he his some snag when he proposed it. Kim, I can forward that email separately if you like. |
Yes, forward me the email. I also run FreeBSD current on a Traverse Ten64, which is an 8-core arm machine. I have been using |
@kimshrier that's unacceptable for an open source project, that's why this week I'll be doing a discord bridge to volt.im, which will never require an account to read stuff, and all links to messages will always work. Every single message will by synced from the discord server. Thanks for improving V on FreeBSD, I'm considering moving my servers to FreeBSD, but I'm a bit afraid of how the big V web services will run on it. |
Forwared (outside of github). Alex, big V web services should be no problem provided they don't depend on third party s/w for which there is no freebsd package. May be you can set up a reverse proxy to send a small fraction of traffic to the freebsd based web server until you're confident it will stand up! |
Note also that just moving |
@medvednikov, I've been running FreeBSD servers since version 2.1.5 so I've learned a thing or two over that time. If you need assistance, I am more than happy to help... subject to time constraints imposed by my day job. |
Thanks :) To start, I've just implemented cross compilation to FreeBSD. Just tested the binaries on a FreeBSD 13.2 server, they work great, even with networking and openssl:
Right now it requires downloading the entire base.txz (~200MB), but I'll build a minimal sysroot soon. |
There is one flaky test that bothers me, vlib/v/slow_tests/keep_args_alive_test.c.v. I've looked at it but I don't have enough familiarity with V yet to figure out where the race condition is. I haven't put any production V code on a FreebBSD server yet and this test, which just locks up about 80% of the time, contributes to that reluctance. |
Running ktrace on it, I see the following repeating over and over again:
|
tcc on FreeBSD does not support
.symver
which causes compile errors for cmd/tools/vtest_test.v.When this omission gets corrected, we can remove this update but in the mean time, this allows the test to pass. The choice to use clang as the C compiler is because that is the default compiler distributed with the base FreeBSD system.