You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backend-cThe C backend (CBE) outputs C source code.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.
I would prefer to change the generated C to not use these qualifiers so that the code generates the lowest common denominator compatibility. There should not be any TCC specific logic.
Thread local variables should lower to something like zig_threadlocal and have that be an undeclared identifier so that TCC generates a compile error when thread local variables are used.
change the generated C to not use these qualifiers
Sounds good, as I understand these qualifiers only add safety/optimization hints to compilers that support them, no change in functionality.
The undeclared identifier thing is already in place (generates an undefined zig_threadlocal_unavailable), but I thought I should point it out because there are a couple instances of thread-local vars in the behavior tests, which blocks this issue's criterion.
Aye. More data bits: Arch and Homebrew provide the tagged release by default, but latest is still available with an AUR and --HEAD respectively. Small point perhaps, but I'm not sure what the expectation is for TCC since it's more niche and the original author disclaims detachment from the project.
Assuming there are other compilers in use without full C99 support out there, "lowest common denominator" might still suggest foregoing the array param qualifiers.
I must be missing something because adding -fsingle-threaded to the original command still generates a C file with the (undefined) thread-local attribute. I'll comb the community and issues for more info.
backend-cThe C backend (CBE) outputs C source code.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.
Activity
hryx commentedon Nov 26, 2022
C codegen outputs functions taking arrays qualified inside
[...]like so:TCC added support for this syntax in 2018 but there have been no new releases since 2017.
Would you prefer to change the generated C (maybe for TCC only, since these qualifiers are ignored anyway) or only support TCC built from git?
hryx commentedon Nov 26, 2022
It also looks like TCC doesn't support thread-local variables, unless built with gcc on Linux i386/x86_64.
andrewrk commentedon Nov 27, 2022
I would prefer to change the generated C to not use these qualifiers so that the code generates the lowest common denominator compatibility. There should not be any TCC specific logic.
Thread local variables should lower to something like zig_threadlocal and have that be an undeclared identifier so that TCC generates a compile error when thread local variables are used.
hryx commentedon Nov 27, 2022
Sounds good, as I understand these qualifiers only add safety/optimization hints to compilers that support them, no change in functionality.
The undeclared identifier thing is already in place (generates an undefined
zig_threadlocal_unavailable), but I thought I should point it out because there are a couple instances of thread-local vars in the behavior tests, which blocks this issue's criterion.andrewrk commentedon Nov 27, 2022
We can pass
-fsingle-threadedin this case to disable dependency on thread local variablesnektro commentedon Nov 27, 2022
many systems now test and pull the master branch from various points, for example:
tcc-0.9.27+date=2022-01-11on nix0.9.27+git20200814.62c30a4aon debian0.9.27_git20220323on alpinehryx commentedon Nov 27, 2022
Aye. More data bits: Arch and Homebrew provide the tagged release by default, but latest is still available with an AUR and
--HEADrespectively. Small point perhaps, but I'm not sure what the expectation is for TCC since it's more niche and the original author disclaims detachment from the project.Assuming there are other compilers in use without full C99 support out there, "lowest common denominator" might still suggest foregoing the array param qualifiers.
hryx commentedon Nov 27, 2022
I must be missing something because adding
-fsingle-threadedto the original command still generates a C file with the (undefined) thread-local attribute. I'll comb the community and issues for more info.LemonHX commentedon Dec 29, 2024
Have you ever considered https://github.com/rui314/chibicc