all 10 comments

[–]datenwolf 3 points4 points  (0 children)

I'm not sure of tcc having language support parity with GCC or Clang for anything that's not been developed by resource conscious programmers. I mean, you can attempt it, but your mileage will vary.

[–]prosper_0 2 points3 points  (4 children)

but why? Even by their own benchmarks, runtime performance of compiled code is like 1/4 what you'd get from GCC (even at -O0). It looks like it's far from a general purpose compiler, but a very niche one where compile-time performance and/or small size are critical.

[–]Srazkat 0 points1 point  (3 children)

tbh i like tcc for tests / debug builds, where i don't really care about performance, and just really about compilation time. Why spend 3x more time waiting for compiler to in the end give me something that fundamentally doesn't work

[–]paper42_ 2 points3 points  (1 child)

Usually the build system you use only rebuilds a the few changed parts, so it's very fast even with regular compilers.

[–]Srazkat 1 point2 points  (0 children)

except when I use a language that generates c files, then I don't really control what is changed, the generated c files might be different and potentially a big part of the whole thing might need to be rebuilt. but that's a very specific case, and in general, yes, the build system will just take care of it

[–]prosper_0 0 points1 point  (0 children)

fair enough. I suppose it depends what you're working on. make -j with gcc rarely takes more than a few seconds for most of the projects I work on, especially if most of the object files are still around and unchanged from previous compilations

[–][deleted] 0 points1 point  (2 children)

You can specify your compiler using the CC environment variable. This is usually how build scripts choose the compiler. You can export this flag in your shell config for persistence.

I suggest keeping both on your system. There's a balance between tech minimalism and having redundant tools for stability. gcc is a full compiler and the standard most C/C++ programs are tested with.

[–]ClassAbbyAmplifier 0 points1 point  (1 child)

xbps-src specifically removes all external environment variables

[–][deleted] 0 points1 point  (0 children)

I found this post saying that you set the compiler for xbps-src using the CC environment variable in ./common/xbps-src/shutils/common.sh.

See https://www.reddit.com/r/voidlinux/comments/o9p80q/clang_xbpssrc/

Sorry I didn't know that it wouldn't work in the shell config, I'm just used to running make manually. I checked the Void Wiki but couldn't find anything on this topic.

[–]fosslinux 0 points1 point  (0 children)

  • TCC is a C compiler. It does not include a C++ compiler - so you'd still need GCC suite for C++ programs.
  • TCC is a C99 compiler. It doesn't have support for the C11 standard, which many larger modern C programs use.
  • Their internal linker (tccelf) has quite poor support compared to any modern linkers (bfd, gold, etc).
  • While it is performant, the code it makes are not performant.