Skip to content

Fix building atop for TCC compiler and others C compilers#375

Merged
Atoptool merged 1 commit into
Atoptool:masterfrom
GermanAizek:tcc-compiler
May 30, 2026
Merged

Fix building atop for TCC compiler and others C compilers#375
Atoptool merged 1 commit into
Atoptool:masterfrom
GermanAizek:tcc-compiler

Conversation

@GermanAizek

@GermanAizek GermanAizek commented May 2, 2026

Copy link
Copy Markdown
Contributor

Clang, GCC, TCC, TDM-GCC successful building. I also used offsetof() standard, which is accepted by all compilers, instead of the STROFFSET() macro.

https://man7.org/linux/man-pages/man3/offsetof.3.html

My experiments on 2 CPUs Xeon E5-2699v3 (72 threads): I am surprised by the compilation speed on TCC, as well as equivalent resource consumption on monitoring

  • TCC 1s compilation
  • Clang 5s compilation
  • GCC 6s compialtion

I think Gentoo users will idolize Fabrice Bellard.

Install tcc compiler easy apt install tcc

Wiki: https://en.wikipedia.org/wiki/Tiny_C_Compiler
Official site: https://bellard.org/tcc/

tcc_htop gcc_htop clang_htop

Clang, GCC, TCC, TDM-GCC successful building.

My experiments on 2 CPUs Xeon E5-2699v3 (72 threads):
I am surprised by the compilation speed on TCC, as well as the resource consumption on monitoring
- TCC 1s compilation
- Clang 5s compilation
- GCC 6s compialtion

Wiki: https://en.wikipedia.org/wiki/Tiny_C_Compiler
Official site: https://bellard.org/tcc/
@Atoptool

Atoptool commented May 2, 2026

Copy link
Copy Markdown
Owner

What is the purpose of adding the regex.h file?

@GermanAizek

Copy link
Copy Markdown
Contributor Author

What is the purpose of adding the regex.h file?

For compability with TCC, TDM-GCC and GCC < 4.3.

@GermanAizek

Copy link
Copy Markdown
Contributor Author

What is the purpose of adding the regex.h file?

I'll show compile error later because of which I didn't intend to #include <regex.h>.
Install tcc compiler easy apt install tcc

@Atoptool

Copy link
Copy Markdown
Owner

The substitution of the STROFFSET macro in atopconvert.c has been merged. I removed the regex.h file which is not a native include file of atop itself and even has incompatible definitions compared to the standard regex.h file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants