From 9496fcdfe1bcbb52915d63433bf9018549afadbf Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 30 Aug 2021 13:21:49 +0000 Subject: [PATCH] v.builder: fix compilation with tcc on FreeBSD 13.0 --- vlib/v/builder/cc.v | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index de05059f07..b7b0d1392b 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -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 {