savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
155 stars 12 forks source link

Fix build on DragonFly #381

Closed mneumann closed 1 year ago

mneumann commented 1 year ago

With this commit I can successfully build savi-release on DragonFly with:

gmake build/savi-release \
    LLVM_PATH=/usr/local/llvm14 \
    CLANGXX=clang++14 \
    CLANG=clang14 \
    LIB_GC=/usr/local/lib/libgc-threaded.a \
    LIB_EVENT=/usr/local/lib/libevent.a \
    LIB_PCRE=/usr/local/lib/libpcre.a \
    LIB_CXX_KIND=""

Supersedes #379

jemc commented 1 year ago

The failing FreeBSD build appears to be a true breakage introduced by this PR.

The spec failures were introduced when merging the BCD code, but should be resolved by #382

jemc commented 1 year ago

To avoid the spec failures, rebase or merge latest main branch into this branch, which has the fixes from #382.

mneumann commented 1 year ago

@jemc are you okay with this change?

I could also use clang (and not clang++) on DragonFly, but then I would have to include -L/usr/lib/gcc80 so that it picks up -lc++. I wonder if we can get rid of the LIB_CXX_KIND thing for other platforms just by utilizing clang++ instead.

Note, I am okay with hard-coding /usr/lib/gcc80. It does not change that frequently, as it is the base compiler. DragonFly always comes with two base compilers. If we retire gcc47, gcc80 would still be the second base compiler for a couple of years.

jemc commented 1 year ago

Yeah I'm okay with merging this (I'll do so in a moment).

And I agree we could explore using clang++ on all platforms - it's definitely worth a try!

Regarding /usr/lib/gcc80 - yeah, this is okay. Eventually if there is a new DragonFly released with a later compiler, we could have both options in the link path search list, with the newer option taking priority - that would allow us to simultaneously support older and newer versions of DragonFly, even if there weren't two versions available on every release of it.