v.builder: fix compilation with tcc on FreeBSD 13.0

pull/11353/head
Delyan Angelov 2021-08-30 13:21:49 +00:00
parent f44eb88a8d
commit 9496fcdfe1
1 changed files with 7 additions and 1 deletions

View File

@ -320,7 +320,13 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
}
if v.pref.os == .freebsd {
// Needed for -usecache on FreeBSD 13, otherwise we get `ld: error: duplicate symbol: _const_math__bits__de_bruijn32` errors there
ccoptions.linker_flags << '-Wl,--allow-multiple-definition'
if !ccoptions.is_cc_tcc {
ccoptions.linker_flags << '-Wl,--allow-multiple-definition'
} else {
// tcc needs this, otherwise it fails to compile the runetype.h system header with:
// /usr/include/runetype.h:94: error: ';' expected (got "const")
ccoptions.args << '-D__RUNETYPE_INTERNAL'
}
}
if ccompiler != 'msvc' && v.pref.os != .freebsd {