IRC channel logs

2025-06-11.log

back to list of logs

<Guest74>Hi, quick question about stage0-posix; are the M2-Planet variants produced in Phases 5 and 15 supposed to be functionally identical, with the only difference being debuggability, or are there additional differences?
<stikonas>Guest74: Hi
<stikonas>functionally output should be the same
<stikonas>well, mostly
<stikonas>they use different C libraries
<stikonas>theoretically that shouldn't introduce any functional differences
<stikonas>it does mean performance differences
<stikonas>also on stage0-uefi, that 2nd C library is functionally better, so there are some functional differences in UEFI (e.g. posix paths are only supported by the 2nd build)
<Guest74>Hmm. I am asking since it seems to me like `#if !__M2__` behaves incorrectly under the Phase 5 one
<stikonas>hmm, that should work I think
<stikonas>could be bug, but not one that I'm aware of
<stikonas>do you have a reproducer?
<Guest74>I mean, just save something like this to a file and run `M2-Planet -f foo.c`
<Guest74>```
<Guest74>#if !__M2__
<Guest74>int main() {}
<Guest74>#endif
<Guest74>```
<stikonas>hmm, yes, I can see the difference
<stikonas>at the moment it is not clear to me why that happens
<stikonas>Guest74: so __M2__ is correctly expanded
<stikonas>so I think the bug is in #if processing
<stikonas>just __M2__ is replaced with 42 in both M2 and M2-Planet
<stikonas>Guest74: oh, maybe ! is not working
<stikonas>Guest74: anyway, I don't really understand it at the moment. If you want, you could try to inserts prints in various places in the sourcecode
<stikonas>and try to track the difference
<stikonas>that's probably the only viable way to debug M2...
<stikonas>since in gdb you just see pure disassembly, very hard to follow