-
Notifications
You must be signed in to change notification settings - Fork 7
Improve build on FreeBSD #11
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
Conversation
@devnexen as a FreeBSD user, would you know how to fix this non-portable cast? |
a pthread_t is an opaque type in FreeBSD maybe this deserves a try. |
Thank you for your quick response! What would be |
Well, theoretically, what can be tried here is something like this |
Hmmm, I did that (without long tid;
thr_self(&tid);
return static_cast<crn_thread_id_t>(tid); And it now builds but
As it looks related to memory, I maybe did a mistake with the |
The header-only fix was extracted as its own PR: #12 |
c585076
to
eeabea5
Compare
So, this now looks ready to me. Those commits fixes the build of the Until now, only the Now the The We need that other patch to avoid getting those errors at run time:
|
I removed one commit that was introducing a specific FreeBSD |
Those changes are trivial, so let's merge them. |
nice ! I completely forgot about this 🙂 |
Hi @devnexen, nice to see you around! Since you seems to know FreeBSD better than me, would you know what is happening there? Some error only disappear if I use
And the code just works if I disable the checks. Right now the tool builds but does not run… |
This is definitively a weird issue, I ve tried crunch on Linux with jemalloc (which is FreeBSD's allocator backend) and still no issue ... I hope you can, at worse, make your change for aligned_alloc getting merged. |
Those commits improves the build of the
crunch
tool on FreeBSD.Until now, only the
crnlib
was buildable on FreeBSD when integrated in another tool (for example, NetRadiant):Now the
crunch
command line tool builds as well, if that other MR is merged:_FILE_OFFSET_BITS 64
withfopen
/fseek
/ftell
outside of Linux #38The
crunch
tool will build but will not run properly until aligned allocation is enforced, see:We need that other patch to avoid getting those errors at run time:
Original message:
This is a list of commits aiming to fix crunch build on FreeBSD. The task is not complete yet since I now face this issue and I don't know yet how to fix it:
about a code that is already marked as non-portable:
crunch/crnlib/crn_threading_pthreads.cpp
Lines 37 to 40 in 98c7429
The first commit is enough to allow
crn_decomp.h
in third-party projects. I did this fix to enable crn support in NetRadiant andq3map2
on FreeBSD, but that would enable crn support in Dæmon engine on FreeBSD too.