scc, branch HEADsimple c99 compiler
575a2d87cac49174b7f53aa6ac5f9186c21656972026-08-19T18:32:01Z2026-08-24T16:22:51ZDon't specify a QBE return type for C functions with void return typeSören Tempelsoeren+git@soeren-tempel.netcommit 575a2d87cac49174b7f53aa6ac5f9186c2165697
parent cc00e16d081e5f802f046bc0a40ef597a4af1c0e
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date: Wed, 19 Aug 2026 20:32:01 +0200
Don't specify a QBE return type for C functions with void return type
Without this patch, SCC currently emits QBE functions that have a "w"
return type for C functions that have a void return type. However, in
the return statement of these functions, it doesn't return a value.
Depending on the reader's interpretation, one could argue that this is
in violation of the QBE specification, which states: “All return values
of this function must have [the specified] return type” [1]. Arguably, a
ret instruction without an argument does not have a "w" return type.
qbe(1) itself accepts this, but other tooling built around QBE may not.
With this patch, functions with zero-sized types are now represented as
not having a return type in the QBE representation. Further, the emitted
QBE call instruction no longer assigns the return value of functions
with a void return type to a temporary.
This was discovered while executing SCC's emitted QBE representation
using quebex, a software analysis framework that comes with its own
standalone implementation of the QBE specification [2].
[1]: https://c9x.me/compile/doc/il.html#Functions
[2]: https://git.8pit.net/quebex
cc00e16d081e5f802f046bc0a40ef597a4af1c0e2026-06-24T09:35:06Z2026-06-26T21:38:10Zcc2/qbe: Fix post increment and decrementZhaoming Luozhml@posteo.comcommit cc00e16d081e5f802f046bc0a40ef597a4af1c0e
parent 0768762d445cd3850147a54ea6625f72e5c1a8e4
Author: Zhaoming Luo <zhml@posteo.com>
Date: Wed, 24 Jun 2026 09:35:06 +0000
cc2/qbe: Fix post increment and decrement
These operators use their operand as lhs and rhs. Function
lhs_rhs() calls lhs() and may modify variable 'l'. When the
operator is pointer dereference or struct/union field access,
the variable 'l' will be modifed to a pointer type node
pointing to the value of lhs. After that, in load(), choose
the QBE load instruction based on the lhs type. Because
'l' may be modifed to a pointer type node, 'l->type' may be
different to the lhs type; if it's the case, it may happen
using an address to a 32 bits value to get a 64 bits value.
Therefore, 'l->type' should not be used to define the QBE
load instruction. Use 'r->type' because the value of 'r' is
not modified, and the type of 'lhs' and 'rhs' are the same,
otherwise they can't be operands of the same expression.
Also add the tests for this fix.
Co-authored-by: Roberto E. Vargas Caballero <k0ga@shike2.net>
0768762d445cd3850147a54ea6625f72e5c1a8e42026-06-26T20:27:00Z2026-06-26T20:27:00Zbuild: Update proto.all after removing gcc-sccRoberto E. Vargas Caballerok0ga@shike2.netcommit 0768762d445cd3850147a54ea6625f72e5c1a8e4
parent 027ea37e73f2faca232788a21dd1d1280c74adbc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 26 Jun 2026 22:27:00 +0200
build: Update proto.all after removing gcc-scc
027ea37e73f2faca232788a21dd1d1280c74adbc2026-06-18T11:40:08Z2026-06-18T11:47:57Zcc1: Pretty format cpp outputRoberto E. Vargas Caballerok0ga@shike2.netcommit 027ea37e73f2faca232788a21dd1d1280c74adbc
parent 89f23214f7e97af01aea675a2a24650fbc5d77ea
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 18 Jun 2026 13:40:08 +0200
cc1: Pretty format cpp output
The output of cc1 -E was ugly because indentation was lost
and because spaces were blindly added just to avoid token
concatenation. This patch solves the problem in a easy way
because we can access directly the input line to recover
the leading spaces and we already have the variable yyspace,
which holds the last space seen, but it was mangled by
expandarg() to handle spaces correctly for stringize of
macro parameters. We just save the space value before the
macro and then we restore after the expansion was done
because we don't care about intermediate spaces, just spaces
before the expansion of the macro.
89f23214f7e97af01aea675a2a24650fbc5d77ea2026-06-17T17:53:05Z2026-06-17T17:53:05Ztest/cc: Ignore 0275-structRoberto E. Vargas Caballerok0ga@shike2.netcommit 89f23214f7e97af01aea675a2a24650fbc5d77ea
parent ac0fa861813f8101072d96af883e47e610365ebc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 19:53:05 +0200
test/cc: Ignore 0275-struct
ac0fa861813f8101072d96af883e47e610365ebc2026-06-17T17:40:14Z2026-06-17T17:40:14Zcc1: Fix intersect()Roberto E. Vargas Caballerok0ga@shike2.netcommit ac0fa861813f8101072d96af883e47e610365ebc
parent d56373f248e2f819620ae0e192bc09f79500398b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 19:40:14 +0200
cc1: Fix intersect()
Intersect() was assuming that hidesets were NULL terminated, but
addhideset() ran over the full array filling all the possible
positions. Having NULL terminated arrays make easier to run over
them, and as we have plenty of space in the hidesets instead of
changing intersect() is better to change addhideset() and have
NULL terminated arrays. This simplifies sethideset() and
unsethideset().
d56373f248e2f819620ae0e192bc09f79500398b2026-06-17T16:39:06Z2026-06-17T16:39:06Zcc1: Fix handling of NOEXPAND and EXPANDRoberto E. Vargas Caballerok0ga@shike2.netcommit d56373f248e2f819620ae0e192bc09f79500398b
parent 3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 18:39:06 +0200
cc1: Fix handling of NOEXPAND and EXPAND
When they happen we have to modify disexpand and move
to the next character, but we were passing c with the
NOEXPAND or EXPAND value to the lexer, which due to a
casuality was finally working but only due to casuality
(a weird one).
3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b2026-06-17T14:08:12Z2026-06-17T14:08:12Zcc1:Improve size checking in expandargs()Roberto E. Vargas Caballerok0ga@shike2.netcommit 3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b
parent c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 16:08:12 +0200
cc1:Improve size checking in expandargs()
c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b2026-06-17T13:41:10Z2026-06-17T13:41:10Zcc1: Remove outdated TODORoberto E. Vargas Caballerok0ga@shike2.netcommit c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b
parent c4b7c0458ffee84c043739645afe0aedffb906ed
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 15:41:10 +0200
cc1: Remove outdated TODO
Changing that means changing scc.
c4b7c0458ffee84c043739645afe0aedffb906ed2026-06-17T12:44:08Z2026-06-17T12:44:08ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit c4b7c0458ffee84c043739645afe0aedffb906ed
parent 2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a5
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 14:44:08 +0200
Merge remote-tracking branch 'origin/master'
2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a52026-06-17T11:46:24Z2026-06-17T12:42:42Ztests/cc: Mark 0189-cpp as resolvedRoberto E. Vargas Caballerok0ga@shike2.netcommit 2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a5
parent f89df166f2425304ff0ab221940e41a1b8ea079f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 13:46:24 +0200
tests/cc: Mark 0189-cpp as resolved
f89df166f2425304ff0ab221940e41a1b8ea079f2026-06-17T07:52:15Z2026-06-17T12:41:39Zcc1: Mark hidden tokensRoberto E. Vargas Caballerok0ga@shike2.netcommit f89df166f2425304ff0ab221940e41a1b8ea079f
parent c9d3ab93258058932a722957c30d16c41a48615b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 09:52:15 +0200
cc1: Mark hidden tokens
The input hideset approximation works very well because we are able
to maintain the hideset for every change in the hideset, but it fails
when we fully expand a macro, because then the rescan loses the hideset
information. To solve it, we have to introduce annotation tokens to
the lexer to signal it that it should disable expansions between
a NOEXPAND and a EXPAND. These tokens are always consumed by the
lexer or the macro expansion and they are not shown ever in the
-E output or the grammar parser, because they always appear in a buffer
associated to a IMACRO input that is consumed by the lexer to generate
the tokens seen by the grammar parser.
c9d3ab93258058932a722957c30d16c41a48615b2026-06-17T12:37:22Z2026-06-17T12:37:22Zcc1: Remove colons in INPUT DBGRoberto E. Vargas Caballerok0ga@shike2.netcommit c9d3ab93258058932a722957c30d16c41a48615b
parent d59f0b5d2d11178047efaa052eb6659e48bb827e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 17 Jun 2026 14:37:22 +0200
cc1: Remove colons in INPUT DBG
Just be consistent wit other DBG statements.
d59f0b5d2d11178047efaa052eb6659e48bb827e2026-06-16T20:07:09Z2026-06-17T12:36:57Zcc1: Add hideset by inputRoberto E. Vargas Caballerok0ga@shike2.netcommit d59f0b5d2d11178047efaa052eb6659e48bb827e
parent cd2e378821e5e5f86215643e87a6b806a8b54492
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 16 Jun 2026 22:07:09 +0200
cc1: Add hideset by input
Having a hideset by input allows to follow the Prosser algorithm [1],
because hideset changes happens only when expansions happen, so we
can continue using the push up input streams to implemenet the algorithm
while we maintain the hideset for every new input push up.
[1] https://www.spinellis.gr/blog/20060626/cpp.algo.pdf
bbd527058259a2bac5fed45610949b110645e8052026-06-09T12:23:28Z2026-06-10T07:26:32ZMake it easier to configure the name of the QBE binarySören Tempelsoeren@soeren-tempel.netcommit bbd527058259a2bac5fed45610949b110645e805
parent ab709ce7d4bc60982fa69b0956e58e9330892f2c
Author: Sören Tempel <soeren@soeren-tempel.net>
Date: Tue, 9 Jun 2026 14:23:28 +0200
Make it easier to configure the name of the QBE binary
While it is already possible to configure the as(1) and ld(1) binary
name through C macros, the QBE binary name is itself currently
hardcoded. However, for distribution following the functional software
deployment model (e.g., Guix or Nix), it is useful to also make the
name of the QBE binary configurable. This is implemented here through
the addition of a QBEBIN macro.
ab709ce7d4bc60982fa69b0956e58e9330892f2c2026-06-09T06:28:42Z2026-06-09T06:28:42Zcc1: Minor changes in commentsRoberto E. Vargas Caballerok0ga@shike2.netcommit ab709ce7d4bc60982fa69b0956e58e9330892f2c
parent 5a6e26e28744a0fa4efe9f6e032bd40c647b3749
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 9 Jun 2026 08:28:42 +0200
cc1: Minor changes in comments
5a6e26e28744a0fa4efe9f6e032bd40c647b37492026-06-03T04:39:45Z2026-06-05T08:09:30Zcc1: Try parsing specifiers after struct/union/enumZhaoming Luozhml@posteo.comcommit 5a6e26e28744a0fa4efe9f6e032bd40c647b3749
parent a7a08bb3d51b852995346c96d94265ea936731e5
Author: Zhaoming Luo <zhml@posteo.com>
Date: Wed, 3 Jun 2026 04:39:45 +0000
cc1: Try parsing specifiers after struct/union/enum
In specifier(), the type is returned after parsing the
struct/union/enum specifier. Therefore, the compile will fail with
the declaration like: `struct S const s;`.
However, according to the syntax of `declaration-specifiers` in c99
spec 6.7, it's accpectable to have other specifiers or qualifiers
following the struct/union/enum specifier, which is a type specifier.
To follow the c99 spec, continue looking for other specifiers or
qualifiers after a struct/union/enum specifier rather than return
immediately.
a7a08bb3d51b852995346c96d94265ea936731e52026-06-05T07:38:00Z2026-06-05T07:38:00Ztests/cc: Add 0042-struct-enum error testRoberto E. Vargas Caballerok0ga@shike2.netcommit a7a08bb3d51b852995346c96d94265ea936731e5
parent 5136c8c992d0d99e593e447a0e74aa79dc50fb18
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 5 Jun 2026 09:38:00 +0200
tests/cc: Add 0042-struct-enum error test
This test is marked as TODO because the error recovery mechanism is
not working correctly as it was already known. Every of the error
conditions of the test were manually tested.
5136c8c992d0d99e593e447a0e74aa79dc50fb182026-06-03T09:04:49Z2026-06-03T09:04:49Zcc1: Fix bug introduced in 15b64d5Roberto E. Vargas Caballerok0ga@shike2.netcommit 5136c8c992d0d99e593e447a0e74aa79dc50fb18
parent 15b64d5d2636103fdeafea92ea7886dbd23c6574
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 3 Jun 2026 11:04:49 +0200
cc1: Fix bug introduced in 15b64d5
The symbol related to the tag is symtag and not sym
which ius used later and it is not initialized at this
point.
Co-authored-by: Zhaoming Luo <zhml@posteo.com>
15b64d5d2636103fdeafea92ea7886dbd23c65742026-06-02T11:18:09Z2026-06-02T13:32:13Zcc1: Error when no struct identifier and '{'Zhaoming Luozhml@posteo.comcommit 15b64d5d2636103fdeafea92ea7886dbd23c6574
parent 5d10a2436b4df6c82723bb7174451ab267512155
Author: Zhaoming Luo <zhml@posteo.com>
Date: Tue, 2 Jun 2026 11:18:09 +0000
cc1: Error when no struct identifier and '{'
In c99 spec 6.7.2.1.1 `struct-or-union-specifier`, when there is an
identifier following `struct-or-union`, it's optional to have
`{ struct-declaration-list }` after the identifier; if the
identifier does not exist, there must be
`{ struct-declaration-list }`.
In structdcl(), in the error case where the token after
`struct-or-union` is neither an identifier nor '{', a placeholder
type is created in newtag() and returned.
Compiling 'struct const s { int v; };' gives error message:
```
test.c:1: error: expected ';' before 'const'
test.c:1: error: expected ';' before '{'
..
test.c:1: error: expected ';' before '{'
too many errors
```
Error when the token after `struct-or-union` is neither an
identifier nor '{'. The error message will be more understandable:
```
test.c:1: error: unexpected 'const'
```
5d10a2436b4df6c82723bb7174451ab2675121552026-06-01T21:08:14Z2026-06-01T21:08:14Zbuild/libc: Recover the definition of CPPINCLUDESRoberto E. Vargas Caballerok0ga@shike2.netcommit 5d10a2436b4df6c82723bb7174451ab267512155
parent 4db66b3e48d2821ea034c2cc9e233594695872ca
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 1 Jun 2026 23:08:14 +0200
build/libc: Recover the definition of CPPINCLUDES
While this definition is not needed anymore because we use
scc to build the libc, not having it creates problems in
the config-musl configuration, which would try to use the
musl headers with the scc libc. Adding these additional -I
is odd, but not building the libc in the case of musl creates
other problems, because the proto files used in the install
target require the different libcs to be built and present in
the lib directory.
4db66b3e48d2821ea034c2cc9e233594695872ca2026-06-01T18:21:08Z2026-06-01T18:21:08Zdoc: Update QBE version to 1.3Roberto E. Vargas Caballerok0ga@shike2.netcommit 4db66b3e48d2821ea034c2cc9e233594695872ca
parent cd2e378821e5e5f86215643e87a6b806a8b54492
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 1 Jun 2026 20:21:08 +0200
doc: Update QBE version to 1.3
QBE finally made a release that includes the common storeage
and we don't have to pointer to a development commit anymore.
cd2e378821e5e5f86215643e87a6b806a8b544922026-05-29T16:56:57Z2026-05-29T16:56:57Ztests/cc: Use make to build the programsRoberto E. Vargas Caballerok0ga@shike2.netcommit cd2e378821e5e5f86215643e87a6b806a8b54492
parent f60bf2a21373462c9b7636b9546a6574c9db7f5f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 18:56:57 +0200
tests/cc: Use make to build the programs
This simplifies the shell script and the Makefile.
f60bf2a21373462c9b7636b9546a6574c9db7f5f2026-05-29T16:33:39Z2026-05-29T16:33:39Zlibc/stdio: Reorder functions in headerRoberto E. Vargas Caballerok0ga@shike2.netcommit f60bf2a21373462c9b7636b9546a6574c9db7f5f
parent 00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 18:33:39 +0200
libc/stdio: Reorder functions in header
00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd42026-05-29T12:34:38Z2026-05-29T12:34:38Ztests/libc: Add -s to make to be silentRoberto E. Vargas Caballerok0ga@shike2.netcommit 00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd4
parent d9b6c4384a9995d70c3bfa352d343a84c7491059
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 14:34:38 +0200
tests/libc: Add -s to make to be silent
d9b6c4384a9995d70c3bfa352d343a84c74910592026-05-29T12:34:10Z2026-05-29T12:34:10Ztests/libc: Add 0099-tmpnamRoberto E. Vargas Caballerok0ga@shike2.netcommit d9b6c4384a9995d70c3bfa352d343a84c7491059
parent 33141db27c405bbec69efaa2808b502d091c36e8
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 14:34:10 +0200
tests/libc: Add 0099-tmpnam
33141db27c405bbec69efaa2808b502d091c36e82026-05-29T11:19:29Z2026-05-29T11:19:29ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 33141db27c405bbec69efaa2808b502d091c36e8
parent 36a1eef62de6d85631e2f6ae728620dec34454cc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 13:19:29 +0200
Merge remote-tracking branch 'origin/master'
74119bd8d7b2d8a91b2b2e5bd7984ce5377402ab2026-05-29T11:16:32Z2026-05-29T11:16:32Zcc2/qbe: Emit an initial body labelRoberto E. Vargas Caballerok0ga@shike2.netcommit 74119bd8d7b2d8a91b2b2e5bd7984ce5377402ab
parent 47b81d4c6f906155f23054757a85c829aff80c40
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 29 May 2026 13:16:32 +0200
cc2/qbe: Emit an initial body label
This label is needed because otherwise branching to the label at
the beginning og the function generates an error in qbe:
invalid jump to the start block
36a1eef62de6d85631e2f6ae728620dec34454cc2026-05-28T09:39:48Z2026-05-29T10:11:18Ztests/libc: Use timeoutRoberto E. Vargas Caballerok0ga@shike2.netcommit 36a1eef62de6d85631e2f6ae728620dec34454cc
parent 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 28 May 2026 11:39:48 +0200
tests/libc: Use timeout
While the timeout utility became standard only in POSIX 2024
it was available for many years in every UNIX alike system
and dealing directly wit signals and timeout in the shell it
is not easy and it was generating problems in OpenBSD.
47b81d4c6f906155f23054757a85c829aff80c402026-05-28T08:19:01Z2026-05-28T08:19:01Zcc1: Don't add addional spaces in macro argumentsRoberto E. Vargas Caballerok0ga@shike2.netcommit 47b81d4c6f906155f23054757a85c829aff80c40
parent a64383b5e55ca6d2da9cf4039bd8926222a7d9b9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 28 May 2026 10:19:01 +0200
cc1: Don't add addional spaces in macro arguments
Cpp was adding spajce between tokens composing a macro argument.
This space was needed to avoid undesired concatenations between
adjancents tokens, like for example identifiers, but it was breaking
some cases of the stringize operator because it wan adding spaces
in the string where they were not in the macro argument. The scc
tokenizer does not preserves spaces, and this makes a bit difficult
to know when to insert spaces for this case, so the simpler solution
is just to add a new variable that stores the last space seen in
the tokenizer, and lets the caller to manage it as desired because
the majority of the code doesn't matter about it.
a64383b5e55ca6d2da9cf4039bd8926222a7d9b92026-05-25T22:29:39Z2026-05-25T22:31:59Zcc1: Don't escape \ out of "" or ''Roberto E. Vargas Caballerok0ga@shike2.netcommit a64383b5e55ca6d2da9cf4039bd8926222a7d9b9
parent e22d82e7c5eff9eb5b0390e06b7df8e11c7e4599
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 26 May 2026 00:29:39 +0200
cc1: Don't escape \ out of "" or ''
e22d82e7c5eff9eb5b0390e06b7df8e11c7e45992026-05-25T08:54:03Z2026-05-25T08:54:03Ztest/cc: Add more cases to 0273-cppRoberto E. Vargas Caballerok0ga@shike2.netcommit e22d82e7c5eff9eb5b0390e06b7df8e11c7e4599
parent ef83e049a0f548e2ca4c1bb7f8d4fae71a2c8678
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 25 May 2026 10:54:03 +0200
test/cc: Add more cases to 0273-cpp
ef83e049a0f548e2ca4c1bb7f8d4fae71a2c86782026-05-25T08:41:49Z2026-05-25T08:41:49Ztests/cc: Use SCC for the test driven compilerRoberto E. Vargas Caballerok0ga@shike2.netcommit ef83e049a0f548e2ca4c1bb7f8d4fae71a2c8678
parent e662a3a5d5922a6f3925731ff52363834e1c9d4d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 25 May 2026 10:41:49 +0200
tests/cc: Use SCC for the test driven compiler
This helps when generating coverage information.
e662a3a5d5922a6f3925731ff52363834e1c9d4d2026-05-25T08:40:29Z2026-05-25T08:40:29Zcc1: Add \r to cppspaces()Roberto E. Vargas Caballerok0ga@shike2.netcommit e662a3a5d5922a6f3925731ff52363834e1c9d4d
parent 9dfcc04c761ad5d218a1178795398883c0925aba
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 25 May 2026 10:40:29 +0200
cc1: Add \r to cppspaces()
While this is not required (accepted?) by the standard, ignoring
them would help in cases where source code from Win is used in
Unix systems.
9dfcc04c761ad5d218a1178795398883c0925aba2026-05-22T09:59:54Z2026-05-22T10:13:54Ztests/cc: Add 0273-cpp.cRoberto E. Vargas Caballerok0ga@shike2.netcommit 9dfcc04c761ad5d218a1178795398883c0925aba
parent 328388439b2db162f7dedb75db497509131cc745
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 22 May 2026 11:59:54 +0200
tests/cc: Add 0273-cpp.c
328388439b2db162f7dedb75db497509131cc7452026-05-22T09:26:14Z2026-05-22T09:30:04Zcc1: Add cppspaces()Roberto E. Vargas Caballerok0ga@shike2.netcommit 328388439b2db162f7dedb75db497509131cc745
parent 693af8c7f3cef75f855092950a8601e25714a23d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 22 May 2026 11:26:14 +0200
cc1: Add cppspaces()
The rules about how the preprocssor must handle spaces are a bit
unspecified in the standard. The paragraph 6.4.3 says:
Preprocessing tokens can be separated by white space; this
consists of comments (described later), or white-space characters
(space, horizontal tab, new-line, vertical tab, and form-feed),
or both
but 6.10.5 says:
The only white-space characters that shall appear between
preprocessing tokens within a preprocessing directive (from just
after the introducing # preprocessing token through just before
the terminating new-line character) are space and horizontal-tab
(including spaces that have replaced comments or possibly other
white-space characters in translation phase 3).
so, it seems that this paragraph seems to limit the spaces in
preprocessing directives to only ' ' and '\t', but 5.1.1.2.1 says about
translation phase 3:
Each comment is replaced by one space character. New-line
characters are retained. Whether each nonempty sequence of
white-space characters other than new-line is retained or replaced
by one space character is implementation-defined.
so, as 6.10.5 accepts the changes possibily done in translation phase 3,
then we can decide to accept all the white spaces in preprocessor directives.
To make all this stuff simpler we just deal all the white spaces in the same
way using the freedom provided by 5.1.1.2.1, and we add a new cppspace()
function to avoid problems with ctype isspace() because there are cases where
valid programs can pass characters over 127 and being processed by these
calls, for example:
#define a(x) #x
a(word)
`word` can contain any character, including utf8 characters over 127 and still
being a valid C program, so using isspaces there can be problematic. While we
don't care so much about having problems with invalid inputs (as in these cases
the result is undefined) it is different in the case of vaild inputs.
693af8c7f3cef75f855092950a8601e25714a23d2026-05-22T09:06:58Z2026-05-22T09:24:03Zcc1: Consolidate spaces in stringize operatorRoberto E. Vargas Caballerok0ga@shike2.netcommit 693af8c7f3cef75f855092950a8601e25714a23d
parent f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 22 May 2026 11:06:58 +0200
cc1: Consolidate spaces in stringize operator
The rules about spaces in stringize operators are specified in 6.10.3.2 of
the C99 spec, and it defines that any sequence of white space between
preprocessor tokens must be consolidated to a single white space
character, but the white characters in strings or character constants
must be preserved. In the same way, " and \ must be escaped.
f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f2026-05-22T08:49:53Z2026-05-22T08:49:53Zcc1: Accept spaces after stringize operatorRoberto E. Vargas Caballerok0ga@shike2.netcommit f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f
parent 5e1de781e494bc498563179f42fa19355816b29b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 22 May 2026 10:49:53 +0200
cc1: Accept spaces after stringize operator
Spaces after # operator in macro definitions must be ignored.
5e1de781e494bc498563179f42fa19355816b29b2026-05-21T09:12:36Z2026-05-21T09:12:36Zcc1: Fix cpp parameter space strimmingRoberto E. Vargas Caballerok0ga@shike2.netcommit 5e1de781e494bc498563179f42fa19355816b29b
parent ebcda96d082604b10e93af543fd719ed037f4746
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 21 May 2026 11:12:36 +0200
cc1: Fix cpp parameter space strimming
The trailing white spaces where not removed because we were always
checking the ending \0 instead of the last character of the string.
ebcda96d082604b10e93af543fd719ed037f47462026-05-20T08:01:37Z2026-05-20T08:01:37Zcc1: Use isspace() around concat operatorRoberto E. Vargas Caballerok0ga@shike2.netcommit ebcda96d082604b10e93af543fd719ed037f4746
parent 1e0f1124de63a6ef2e30314484fca2e2f60da4ad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 20 May 2026 10:01:37 +0200
cc1: Use isspace() around concat operator
The spec indicates that a preprocessor white space is any of ' ',
\t, \f, \v and \n. As we use the default C locale that is equivalent
to use isspace(), which is already used in other places of the cpp,
even when there are (very rare) cases where it could produce problems.
1e0f1124de63a6ef2e30314484fca2e2f60da4ad2026-05-12T10:55:38Z2026-05-12T10:57:38Zbuild: Continue with the migration to sccRoberto E. Vargas Caballerok0ga@shike2.netcommit 1e0f1124de63a6ef2e30314484fca2e2f60da4ad
parent 783ac157e892d418efb54c7c3b4e76e2330f65d9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 12:55:38 +0200
build: Continue with the migration to scc
This commits continue with the migration to use scc for the libc
and for the tests. It also means removing the gcc-scc tool that
used to be used to test the libc before scc was able to complie it.
In case of being needed it can be recovered from the history.
783ac157e892d418efb54c7c3b4e76e2330f65d92026-05-12T10:51:05Z2026-05-12T10:51:05Zbuild: Reorder includes in gcov profileRoberto E. Vargas Caballerok0ga@shike2.netcommit 783ac157e892d418efb54c7c3b4e76e2330f65d9
parent a27201f2a9b36722cc7a81b31b0e6ae0621078bb
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 12:51:05 +0200
build: Reorder includes in gcov profile
It allows to override variables defined in the gnu profile
a27201f2a9b36722cc7a81b31b0e6ae0621078bb2026-05-12T10:18:02Z2026-05-12T10:18:02Ztests/libc: Adjust FOPEN_MAX in 0098-tmpfilRoberto E. Vargas Caballerok0ga@shike2.netcommit a27201f2a9b36722cc7a81b31b0e6ae0621078bb
parent d681ea0ce2e1903f5047140fb3bcb6da1dc0e673
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 12:18:02 +0200
tests/libc: Adjust FOPEN_MAX in 0098-tmpfil
The value of FOPEN_MAX includes stdin, stdout and stderr
so it is impossible to open FOPEN_MAX new streams.
d681ea0ce2e1903f5047140fb3bcb6da1dc0e6732026-05-12T10:15:06Z2026-05-12T10:15:06Zlibc/stdio: Fix tmpnam()Roberto E. Vargas Caballerok0ga@shike2.netcommit d681ea0ce2e1903f5047140fb3bcb6da1dc0e673
parent 6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 12:15:06 +0200
libc/stdio: Fix tmpnam()
The logic to find the digits to increment was wrong and
it returned FALSE always.
6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb2026-05-12T09:27:31Z2026-05-12T09:28:44Ztests/cc: Remove entries from .gitignoreRoberto E. Vargas Caballerok0ga@shike2.netcommit 6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb
parent d0c8ee4efa225ebecb471bef5bcbe3a7033de81c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 11:27:31 +0200
tests/cc: Remove entries from .gitignore
We don't use test names for this test suite.
d0c8ee4efa225ebecb471bef5bcbe3a7033de81c2026-05-06T19:33:16Z2026-05-12T09:28:44Zbuild/gcov: Override SCCRoberto E. Vargas Caballerok0ga@shike2.netcommit d0c8ee4efa225ebecb471bef5bcbe3a7033de81c
parent 937941341d13f7fd6da062d332faf4a1be4edd04
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 21:33:16 +0200
build/gcov: Override SCC
When the gcov toolchain is used then we don't want to use
scc for the tests, because that removes any possibility
of extracting coverage information. We still have problems
with the coverage of the libc, because when we use gcc then
we use the gcc libc.
937941341d13f7fd6da062d332faf4a1be4edd042026-05-12T07:45:02Z2026-05-12T07:45:02Ztests/make: Add 0110-loopRoberto E. Vargas Caballerok0ga@shike2.netcommit 937941341d13f7fd6da062d332faf4a1be4edd04
parent 95b1d6c4ae74328c31bc2a3bdc80db53886bedea
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 09:45:02 +0200
tests/make: Add 0110-loop
95b1d6c4ae74328c31bc2a3bdc80db53886bedea2026-05-12T07:40:59Z2026-05-12T07:43:06Zmake: Use recursion to find circular dependenciesRoberto E. Vargas Caballerok0ga@shike2.netcommit 95b1d6c4ae74328c31bc2a3bdc80db53886bedea
parent fddf43508290bc39144364d09e641f3bba7ef095
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 09:40:59 +0200
make: Use recursion to find circular dependencies
fddf43508290bc39144364d09e641f3bba7ef0952026-05-12T07:32:04Z2026-05-12T07:32:04Ztests/cc: Add 0041-iconst to the test listRoberto E. Vargas Caballerok0ga@shike2.netcommit fddf43508290bc39144364d09e641f3bba7ef095
parent 720db27ed2d65d714ad11f96b3368c7a83b2ac11
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 12 May 2026 09:32:04 +0200
tests/cc: Add 0041-iconst to the test list
720db27ed2d65d714ad11f96b3368c7a83b2ac112026-05-11T19:01:59Z2026-05-11T19:01:59Ztests/cc: Update scc path in update.shRoberto E. Vargas Caballerok0ga@shike2.netcommit 720db27ed2d65d714ad11f96b3368c7a83b2ac11
parent aae32c7523883c103a8bdb847549345388563c54
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 21:01:59 +0200
tests/cc: Update scc path in update.sh
The shell script update.sh is a helper to automatize getting the
error messages from scc, and for that reason it should point to
the scc produced by the build and not the one from the PATH.
aae32c7523883c103a8bdb847549345388563c542026-05-11T19:01:27Z2026-05-11T19:01:27Ztests/cc: Add execute/0041-iconstRoberto E. Vargas Caballerok0ga@shike2.netcommit aae32c7523883c103a8bdb847549345388563c54
parent 33787455afaea0e22d89176ede170941766a9bd4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 21:01:27 +0200
tests/cc: Add execute/0041-iconst
33787455afaea0e22d89176ede170941766a9bd42026-05-11T18:55:40Z2026-05-11T18:55:40Zcc1: Check type of array designator indexRoberto E. Vargas Caballerok0ga@shike2.netcommit 33787455afaea0e22d89176ede170941766a9bd4
parent ea6d8cf4e6d83ca32ce98443dc939ec897daf6b7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 20:55:40 +0200
cc1: Check type of array designator index
The expression between [ ] must an integer constant expression,
and the function iconstexpr() returns NULL in that case and
it has to be checked to give the proper error message.
ea6d8cf4e6d83ca32ce98443dc939ec897daf6b72026-05-11T08:16:52Z2026-05-11T08:16:52ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit ea6d8cf4e6d83ca32ce98443dc939ec897daf6b7
parent 334fc49dab766c427e4ea98719cbaf869e60b6c9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 10:16:52 +0200
Merge remote-tracking branch 'origin/master'
334fc49dab766c427e4ea98719cbaf869e60b6c92026-05-11T08:04:31Z2026-05-11T08:04:31Zranlib: Remove offset and oldsiz globalsRoberto E. Vargas Caballerok0ga@shike2.netcommit 334fc49dab766c427e4ea98719cbaf869e60b6c9
parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 10:04:31 +0200
ranlib: Remove offset and oldsiz globals
How these variables were used was a bit weirdd, since they could
just be parameters passed to newsymbol(), and avoid the delta
calculation storing only offset without any index in the first
stage. That makes trivial to do the second phase.
3a1198d1a58ea4e4aff5a3c127b9235e14e13c472026-05-08T19:21:41Z2026-05-08T19:21:41Zlibc/stdio: Use wb+ for tmpfile()Roberto E. Vargas Caballerok0ga@shike2.netcommit 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47
parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 21:21:41 +0200
libc/stdio: Use wb+ for tmpfile()
It is required by the C99 spec, but in our case there
is not difference between text and binary streams anyway.
0dcd0d571ff51bbc87adcec9531f6a21707823d62026-05-08T18:05:20Z2026-05-08T18:05:20Zbuild/libmach: Add elf header dependenciesRoberto E. Vargas Caballerok0ga@shike2.netcommit 0dcd0d571ff51bbc87adcec9531f6a21707823d6
parent d8242493b4b9b1b20e2a22403eec1f550c6fed14
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 20:05:20 +0200
build/libmach: Add elf header dependencies
d8242493b4b9b1b20e2a22403eec1f550c6fed142026-05-08T18:00:32Z2026-05-08T18:00:32Zlibmach: Remove unused elf64.h headerRoberto E. Vargas Caballerok0ga@shike2.netcommit d8242493b4b9b1b20e2a22403eec1f550c6fed14
parent a4c40d95dec037a875469cddc7987c8d3783c86a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 20:00:32 +0200
libmach: Remove unused elf64.h header
a4c40d95dec037a875469cddc7987c8d3783c86a2026-05-08T17:44:40Z2026-05-08T17:57:40Zlibmach: Unify coff32getidx and elfgetidxRoberto E. Vargas Caballerok0ga@shike2.netcommit a4c40d95dec037a875469cddc7987c8d3783c86a
parent 260689938154916eebc6d7002c81f001a8771ab3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 19:44:40 +0200
libmach: Unify coff32getidx and elfgetidx
260689938154916eebc6d7002c81f001a8771ab32026-05-08T17:44:40Z2026-05-08T17:44:40Zlibmach: Unify coff32setidx and elfsetidxRoberto E. Vargas Caballerok0ga@shike2.netcommit 260689938154916eebc6d7002c81f001a8771ab3
parent fc170495f7e645ac620e28c546cdd7401d1668c7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 19:44:40 +0200
libmach: Unify coff32setidx and elfsetidx
fc170495f7e645ac620e28c546cdd7401d1668c72026-05-08T17:32:01Z2026-05-08T17:32:01Zbuild/libc: Use scc-ranlibRoberto E. Vargas Caballerok0ga@shike2.netcommit fc170495f7e645ac620e28c546cdd7401d1668c7
parent 887b0bef5f76997de2bdbd2a91168dde357821d1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 19:32:01 +0200
build/libc: Use scc-ranlib
887b0bef5f76997de2bdbd2a91168dde357821d12026-05-08T17:27:24Z2026-05-08T17:27:24Zranlib: Use 2 phases writing the indexRoberto E. Vargas Caballerok0ga@shike2.netcommit 887b0bef5f76997de2bdbd2a91168dde357821d1
parent 5cdbd266c31962ec9ebcef0415d2f104b209cddb
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 19:27:24 +0200
ranlib: Use 2 phases writing the index
When the different offsets are calculated they are based in the
size of the existing index if there was any index, but if the new
index has a different size then the offset are misplaced. In order
to fix this issue we have to record the size of the existing index
file, generate the new index file, and apply fixups to every offset
to adjust it to the actual offset in the final archive.
5cdbd266c31962ec9ebcef0415d2f104b209cddb2026-05-08T17:08:59Z2026-05-08T17:08:59Zranlib: Use offset to member headersRoberto E. Vargas Caballerok0ga@shike2.netcommit 5cdbd266c31962ec9ebcef0415d2f104b209cddb
parent c1e1df2ac4a400eae9b97a01106a95cc927f83db
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 19:08:59 +0200
ranlib: Use offset to member headers
We were generating an index table of pointers to the content of
the object files, but ld expects the pointers to the ar headers
which contain required information like the size of the object
file.
c1e1df2ac4a400eae9b97a01106a95cc927f83db2026-05-08T16:52:07Z2026-05-08T16:52:07Zlibmach: Use 32BE for index in elfRoberto E. Vargas Caballerok0ga@shike2.netcommit c1e1df2ac4a400eae9b97a01106a95cc927f83db
parent 6abf674372bf77c7bcd7ed762b3791c67b7fdf47
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 18:52:07 +0200
libmach: Use 32BE for index in elf
Archive of elf always use offset of 4 bytes and being big endian
independently of the architecture used in the object files.
6abf674372bf77c7bcd7ed762b3791c67b7fdf472026-05-08T16:44:35Z2026-05-08T16:44:35Zranlib: Fix detection of previous indexRoberto E. Vargas Caballerok0ga@shike2.netcommit 6abf674372bf77c7bcd7ed762b3791c67b7fdf47
parent e9fd2f28fb1200643f668d500c1239a4154d0cb1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 18:44:35 +0200
ranlib: Fix detection of previous index
The strncmp was wrong because after the end of the member name
the ar format has spaces that are not going to match with the
end of string. Also, it didn't consider the padding of ar members
which has to be 2 bytes.
e9fd2f28fb1200643f668d500c1239a4154d0cb12026-05-08T15:09:40Z2026-05-08T15:09:40Zlibmach: Remove unused variableRoberto E. Vargas Caballerok0ga@shike2.netcommit e9fd2f28fb1200643f668d500c1239a4154d0cb1
parent 166e28278d2647af887159e78a28cae8e45fa381
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 17:09:40 +0200
libmach: Remove unused variable
166e28278d2647af887159e78a28cae8e45fa3812026-05-08T14:17:13Z2026-05-08T14:31:06Zlibmach: Implement setindex() for elfRoberto E. Vargas Caballerok0ga@shike2.netcommit 166e28278d2647af887159e78a28cae8e45fa381
parent c3fa57c8e3433a5a3d22b558f97e959fd129d613
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 16:17:13 +0200
libmach: Implement setindex() for elf
c3fa57c8e3433a5a3d22b558f97e959fd129d6132026-05-08T14:14:20Z2026-05-08T14:22:10Zlibc: Remove duplicated _openRoberto E. Vargas Caballerok0ga@shike2.netcommit c3fa57c8e3433a5a3d22b558f97e959fd129d613
parent 6212cd97ef3b5311a8245131e8bf5f9957e4fd67
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 16:14:20 +0200
libc: Remove duplicated _open
_open can be implemented with a syscall or with a wrapper using
_openat. Some versions of linux only has _openat and it is required
to use _openat to implement _open, but in many other systems like
in openbsd and netbsd you have a _open syscall and having both
symbols in the archive makes impredictable which symbol is used.
6212cd97ef3b5311a8245131e8bf5f9957e4fd672026-05-08T13:34:16Z2026-05-08T14:22:03Zlibmach: Encode number of bits in OBJ()Roberto E. Vargas Caballerok0ga@shike2.netcommit 6212cd97ef3b5311a8245131e8bf5f9957e4fd67
parent 73b42fa96c7f6580d0cc18a4611c620e3ec28e44
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 15:34:16 +0200
libmach: Encode number of bits in OBJ()
Some formats have different versions based in being a 32 or 64
bit version, and deriving it from the arch has corner cases and
it requires continous maintainance.
73b42fa96c7f6580d0cc18a4611c620e3ec28e442026-05-08T12:03:50Z2026-05-08T14:21:53Zlibmach: Make coff32csetidx genericRoberto E. Vargas Caballerok0ga@shike2.netcommit 73b42fa96c7f6580d0cc18a4611c620e3ec28e44
parent 87395a88f21b0102683b3d1ce8754a5f6fa6cf5a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 14:03:50 +0200
libmach: Make coff32csetidx generic
The function coff32csetidx() can be used for elf too because they
share the index file format. A.out had a different layout, but as
we don't support it yet, we can just use the name setidx32().
87395a88f21b0102683b3d1ce8754a5f6fa6cf5a2026-05-08T10:10:45Z2026-05-08T10:23:21Zas: Remove debug abort()Roberto E. Vargas Caballerok0ga@shike2.netcommit 87395a88f21b0102683b3d1ce8754a5f6fa6cf5a
parent 70da2bb8081e70c1ee0f2d9a90104356b61e6b9a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 12:10:45 +0200
as: Remove debug abort()
The call to abort() was a leftover from a previous change
where we added support for folding constant labels. We still
have cases where we can't deal with non constant expressions
that would require support from relocations.
70da2bb8081e70c1ee0f2d9a90104356b61e6b9a2026-05-08T07:57:17Z2026-05-08T07:57:17ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 70da2bb8081e70c1ee0f2d9a90104356b61e6b9a
parent 69a6dd3cdb185af347d93e03f82e9f303575843f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 09:57:17 +0200
Merge remote-tracking branch 'origin/master'
69a6dd3cdb185af347d93e03f82e9f303575843f2026-05-08T07:54:28Z2026-05-08T07:54:28Zranlib: Ignore undefine referencesRoberto E. Vargas Caballerok0ga@shike2.netcommit 69a6dd3cdb185af347d93e03f82e9f303575843f
parent 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 09:54:28 +0200
ranlib: Ignore undefine references
When building an index of symbol definitions undefine
references don't help so much and with the current code
they were generating wrong redefinition errors.
49ad9073f0ae0db7c459cba3e41dfccaa95c7abe2026-05-08T07:52:11Z2026-05-08T07:52:11Zranlib: Fix offset calculationRoberto E. Vargas Caballerok0ga@shike2.netcommit 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe
parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 09:52:11 +0200
ranlib: Fix offset calculation
After reading th header of an archive member the file
pointer is already located at the end of the header
and armember returns the offset from the beginning
of the archive header, so we have to use the cur variable
instead of the offset in the file pointer.
117094fdd583ac0907bef5e80e27f23a848477352026-05-07T08:38:17Z2026-05-07T08:38:17Ztests/libc: Add 0098-tmpfilRoberto E. Vargas Caballerok0ga@shike2.netcommit 117094fdd583ac0907bef5e80e27f23a84847735
parent 6f15a112f5ed7705f322845bdb7c9914d191dbc7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 7 May 2026 10:38:17 +0200
tests/libc: Add 0098-tmpfil
6f15a112f5ed7705f322845bdb7c9914d191dbc72026-05-06T19:24:55Z2026-05-06T19:24:55Zbuild: Fix libscc-$(DRIVER).a dependencyRoberto E. Vargas Caballerok0ga@shike2.netcommit 6f15a112f5ed7705f322845bdb7c9914d191dbc7
parent e62db67e3da88d0e908dd58d9e7688c1c0791bc1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 21:24:55 +0200
build: Fix libscc-$(DRIVER).a dependency
e62db67e3da88d0e908dd58d9e7688c1c0791bc12026-05-06T19:19:35Z2026-05-06T19:19:35Zbuild: Cover Add coverage to top MakefileRoberto E. Vargas Caballerok0ga@shike2.netcommit e62db67e3da88d0e908dd58d9e7688c1c0791bc1
parent f32b47792675b766275a003f4a644973d72f89e7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 21:19:35 +0200
build: Cover Add coverage to top Makefile
The coverage target is defined in the gcov toolchain, but it needs to be
populated in the top level Makefile in order to be used.
f32b47792675b766275a003f4a644973d72f89e72026-05-06T19:15:55Z2026-05-06T19:15:55Zlibc/cc: Minor fixesRoberto E. Vargas Caballerok0ga@shike2.netcommit f32b47792675b766275a003f4a644973d72f89e7
parent b4bb95aaed9b85dc43d293e2c7310e81f0092005
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 21:15:55 +0200
libc/cc: Minor fixes
b4bb95aaed9b85dc43d293e2c7310e81f00920052026-05-06T19:07:48Z2026-05-06T19:07:48Zlibc/stdio: Use uinptr_t instead of -1 pointersRoberto E. Vargas Caballerok0ga@shike2.netcommit b4bb95aaed9b85dc43d293e2c7310e81f0092005
parent 10686ff83b100fbf8f51b136fe5b351be6014226
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 21:07:48 +0200
libc/stdio: Use uinptr_t instead of -1 pointers
Using (char *)-1 - s should work in the majority of systems and
or compilers, but using uinptr_t and UINTPTR_MAX makes the code
cleaner and allows to remove the comment.
10686ff83b100fbf8f51b136fe5b351be60142262026-05-06T18:58:19Z2026-05-06T18:59:25Ztests/libc: Add 0097-fopsRoberto E. Vargas Caballerok0ga@shike2.netcommit 10686ff83b100fbf8f51b136fe5b351be6014226
parent 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 20:58:19 +0200
tests/libc: Add 0097-fops
442f7a3a7ae3ad6412dbee2b688a85bef45a89f72026-05-06T18:54:32Z2026-05-06T18:59:25Ztests/libc: Remove debug comment from 0096-divRoberto E. Vargas Caballerok0ga@shike2.netcommit 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7
parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 20:54:32 +0200
tests/libc: Remove debug comment from 0096-div
77f7bee754210661f4bcf5cdcdebdb3058bb8a8b2026-05-06T18:28:43Z2026-05-06T18:28:43Zbuild/libc: Use scc arRoberto E. Vargas Caballerok0ga@shike2.netcommit 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b
parent f1fd6cc9a7ab7a9e2154674f5b59118b58727dad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 20:28:43 +0200
build/libc: Use scc ar
f1fd6cc9a7ab7a9e2154674f5b59118b58727dad2026-05-06T13:46:38Z2026-05-06T13:46:38Ztests/libc: Fix expected outputRoberto E. Vargas Caballerok0ga@shike2.netcommit f1fd6cc9a7ab7a9e2154674f5b59118b58727dad
parent abb580ab3b5c38c0a59ee61220dbada9147bf615
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 15:46:38 +0200
tests/libc: Fix expected output
abb580ab3b5c38c0a59ee61220dbada9147bf6152026-05-06T11:14:28Z2026-05-06T11:22:58ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit abb580ab3b5c38c0a59ee61220dbada9147bf615
parent d2d1660217ff0a583f1d5736be450ac97a8d8035
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 13:14:28 +0200
Merge remote-tracking branch 'origin/master'
d2d1660217ff0a583f1d5736be450ac97a8d80352026-05-06T11:13:46Z2026-05-06T11:22:58Ztests/libc: Add 0096-divRoberto E. Vargas Caballerok0ga@shike2.netcommit d2d1660217ff0a583f1d5736be450ac97a8d8035
parent d6d570e027558233db7d49102557ad4865845e76
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 13:13:46 +0200
tests/libc: Add 0096-div
6da80aa96eaf48cd85fe1183b86f6a264ef4319a2026-05-06T08:54:00Z2026-05-06T11:22:58Zdoc: Update scc-cc.1 with ignored -pipe optionRoberto E. Vargas Caballerok0ga@shike2.netcommit 6da80aa96eaf48cd85fe1183b86f6a264ef4319a
parent 49e32bc0eead3e6a85d284a7bbfada253e813b13
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 10:54:00 +0200
doc: Update scc-cc.1 with ignored -pipe option
d6d570e027558233db7d49102557ad4865845e762026-05-06T08:24:01Z2026-05-06T11:22:58Zcc2/qbe: Whitespace changeRoberto E. Vargas Caballerok0ga@shike2.netcommit d6d570e027558233db7d49102557ad4865845e76
parent 77bdf8dce1514fb0bb812428784f41fa02628511
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 10:24:01 +0200
cc2/qbe: Whitespace change
49e32bc0eead3e6a85d284a7bbfada253e813b132026-05-06T08:51:42Z2026-05-06T11:22:58Zbuild/openbsd: Use scc_clang libprofile by defaultRoberto E. Vargas Caballerok0ga@shike2.netcommit 49e32bc0eead3e6a85d284a7bbfada253e813b13
parent 77f0a2c2cff21b19223f8fae93b8344d7e57972a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 10:51:42 +0200
build/openbsd: Use scc_clang libprofile by default
Openbsd as is an old version of gas, and qbe emits some syntax that
is not accepted by openbsd as. The libprofile scc_clang was added
long time ago to support openbsd better, so it makes sense to use
it by default.
77bdf8dce1514fb0bb812428784f41fa026285112026-05-06T08:22:27Z2026-05-06T11:22:58Zcc2: Remove some of the escape sequencesRoberto E. Vargas Caballerok0ga@shike2.netcommit 77bdf8dce1514fb0bb812428784f41fa02628511
parent 7c50a30f3752d051e7745525d25740e88d115366
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 10:22:27 +0200
cc2: Remove some of the escape sequences
Some sequences are valid C sequences, but they don't make sense
when we generate the asm code, like for example the \? or others
are not needed (and not accepted by assemblers) like for example
\' in a string.
77f0a2c2cff21b19223f8fae93b8344d7e57972a2026-05-06T08:25:55Z2026-05-06T11:22:58ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 77f0a2c2cff21b19223f8fae93b8344d7e57972a
parent 07765e654c10f17169bd66e0e5ca3e6205a449b7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 6 May 2026 10:25:55 +0200
Merge remote-tracking branch 'origin/master'
7c50a30f3752d051e7745525d25740e88d1153662026-05-02T07:47:58Z2026-05-06T11:22:58ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 7c50a30f3752d051e7745525d25740e88d115366
parent 5c8293050bf3288cccd5249ee120460a49a43631
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 2 May 2026 09:47:58 +0200
Merge remote-tracking branch 'origin/master'
07765e654c10f17169bd66e0e5ca3e6205a449b72026-05-04T16:36:23Z2026-05-06T11:22:58Zscc: Ignore -pipe optionRoberto E. Vargas Caballerok0ga@shike2.netcommit 07765e654c10f17169bd66e0e5ca3e6205a449b7
parent 0654230abc8c9cef6f0603ec456ef63471599e86
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 4 May 2026 18:36:23 +0200
scc: Ignore -pipe option
This is used by default in OpenBSD.
0654230abc8c9cef6f0603ec456ef63471599e862026-05-01T20:22:23Z2026-05-06T11:22:53ZMerge branch 'master' into devRoberto E. Vargas Caballerok0ga@shike2.netcommit 0654230abc8c9cef6f0603ec456ef63471599e86
parent 0ee5b49181c1813e136046ad648f909fe6102ea4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 22:22:23 +0200
Merge branch 'master' into dev
0ee5b49181c1813e136046ad648f909fe6102ea42026-05-01T17:55:24Z2026-05-01T20:22:05Ztests/libc: Add 0095-absRoberto E. Vargas Caballerok0ga@shike2.netcommit 0ee5b49181c1813e136046ad648f909fe6102ea4
parent f9dd9d11f059550c22ff819080400574d515da8e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 19:55:24 +0200
tests/libc: Add 0095-abs
f9dd9d11f059550c22ff819080400574d515da8e2026-05-01T17:40:38Z2026-05-01T20:22:04Ztests/libc: Add 0094-bsearchRoberto E. Vargas Caballerok0ga@shike2.netcommit f9dd9d11f059550c22ff819080400574d515da8e
parent d96e3eb8b442d7a67846161f37e368d5a64b95b2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 19:40:38 +0200
tests/libc: Add 0094-bsearch
d96e3eb8b442d7a67846161f37e368d5a64b95b22026-05-01T19:47:04Z2026-05-01T20:22:04Zlibc/qsprt: Fix typo calculating njRoberto E. Vargas Caballerok0ga@shike2.netcommit d96e3eb8b442d7a67846161f37e368d5a64b95b2
parent 67dc80bf14ef15162fa94ded320c7a338a330267
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 21:47:04 +0200
libc/qsprt: Fix typo calculating nj
The variable nj was using nj that was not initialized
and it should be ni, because nj is just the amount of
space after removing the ni elements.
67dc80bf14ef15162fa94ded320c7a338a3302672026-05-01T19:45:02Z2026-05-01T20:22:04Zlibc/qsort: Use unsigned char instead of charRoberto E. Vargas Caballerok0ga@shike2.netcommit 67dc80bf14ef15162fa94ded320c7a338a330267
parent 89dd30dc93dcee2a470c322901a63dd69f476a7c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 21:45:02 +0200
libc/qsort: Use unsigned char instead of char
While it is not very important in this specific case
because we only transfer between char pointers, but
having char can involve sign extensions that are
later discarded, so it is just better to use
unsigned.
89dd30dc93dcee2a470c322901a63dd69f476a7c2026-05-01T17:03:41Z2026-05-01T20:22:04Ztests/libc: Add 0093-systemRoberto E. Vargas Caballerok0ga@shike2.netcommit 89dd30dc93dcee2a470c322901a63dd69f476a7c
parent 630099c016f0cb6c231f10e78b77926ae57bdfaf
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 19:03:41 +0200
tests/libc: Add 0093-system
630099c016f0cb6c231f10e78b77926ae57bdfaf2026-05-01T16:56:31Z2026-05-01T20:22:04Ztests/libc: Add 0092-getenvRoberto E. Vargas Caballerok0ga@shike2.netcommit 630099c016f0cb6c231f10e78b77926ae57bdfaf
parent e11ab93848714e96d346795e2cc4be2c86dce19c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 18:56:31 +0200
tests/libc: Add 0092-getenv
e11ab93848714e96d346795e2cc4be2c86dce19c2026-05-01T11:21:02Z2026-05-01T20:22:04Ztests/libc: Add 0091-atexitRoberto E. Vargas Caballerok0ga@shike2.netcommit e11ab93848714e96d346795e2cc4be2c86dce19c
parent f31dacb5f419d4e082230bd8366c97585e5c9b16
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 1 May 2026 13:21:02 +0200
tests/libc: Add 0091-atexit
f31dacb5f419d4e082230bd8366c97585e5c9b162026-04-30T21:51:30Z2026-05-01T20:22:04Ztests/libc: Add 0090-randRoberto E. Vargas Caballerok0ga@shike2.netcommit f31dacb5f419d4e082230bd8366c97585e5c9b16
parent 2b616739bf590b1f3cbf3740e5b60e1b56e5edd2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 30 Apr 2026 23:51:30 +0200
tests/libc: Add 0090-rand