IRC channel logs

2021-12-02.log

back to list of logs

***robin__ is now known as robin
<oriansj>should I submit a proposal for FOSDEM this year?
<oriansj>as it would likely just be an expanded version of my lightning talk.
<stikonas>oriansj: well, I guess it's always good to make bootstrappable work more known
<stikonas>we got a lot of reports saying "this work is really cool but I've just discovered it"
<stikonas>so it's not widely known yet
<stikonas>hmm, I have some initial riscv32 work for M2-Planet. But it crashes when built with cc_* (both riscv32 and riscv64 version)... So something in my new diff must be causing the problem
<oriansj>stikonas: stack offsets being correct? and right instructions for the reads/writes to ensure you don't put garbage on the stack?
<stikonas>hmm, not sure, but I think the easiest way to debug this is to split the diff into smaller parts and see when crashes start on riscv64...
<stikonas>then at least I can identify what construct breaks cc_riscv*
<stikonas>the diff is here https://paste.debian.net/1221740/
<stikonas>without this patch riscv64 works but with it riscv64 breaks (with the same crash as riscv32)
<stikonas>maybe "((RISCV32 == Architecture) || (RISCV64 == Architecture))" breaks something...
<stikonas>everything else seems even more benign
<stikonas>(it's M2 itself that crashes when building blood-elf)
<fossy><@oriansj> should I submit a proposal for FOSDEM this year?
<fossy>yeah
<stikonas>oriansj: yes, it's ((RISCV32 == Architecture) || (RISCV64 == Architecture)) that breaks cc_riscv*
<stikonas>oh, actually no, ignore the above
<stikonas>hmm, actually it might be two problems and once is caused by ||
<stikonas>but even without or build crashes later...
<stikonas>ok, the other problem is fixed, so it's just || not working...
<stikonas>strange... It's the construct that is already used in Knight...
<oriansj>it could be the cc_riscv32 has an output bug.
<oriansj>does cc_riscv64 build it correctly?
<stikonas>well, I found one copy-paste error where I had RISCV64 twice instead of one RISCV32 and the other branch doing RISCV64
<stikonas>checking it now...
<stikonas>(line 307 in the diff)
<stikonas>so riscv64 build succeeded now\
<stikonas>running riscv32
<stikonas>ok, that's also fixed
<stikonas>so it was just a typo
<stikonas>something later fails but I guess that's expected...
<stikonas>m2libc port is not completed
<stikonas>but blood-elf was built correctly
<oriansj>honestly it looks rather minimal delta as a new M2-Planet port so nice work stikonas
<stikonas>well, need to add tests...
<stikonas>oh, tests also need fixing due to open function that you used in M2libc...
<stikonas>I've fixed that in stage0-posix, but M2-Planet tests have the same issue
<oriansj>that is why we fix in M2libc and just have stage0-posix and M2-Planet pull the fixed version, so we only need to fix exactly once
<stikonas>well, it's the stdlib.c using fcntl.h header...
<stikonas>so I'm just moving it all in the build scripts above
<stikonas>if M2-Mesoplanet would implement includes, that issue might go away anyway
<stikonas>but includes are not that easy from what I understood...
<oriansj>stikonas: well, I have a simple way to do it in cc_reader.c but I need a solid block of time with no distractions to implment it.
<stikonas>well, no rush...
<stikonas>I'll just change order of -f for now. It's better to include .h files first anyway
<stikonas>and .c only after that
<oriansj>well we also need to update the .h and .c files to be more C standard in M2libc
<stikonas>that too...
<stikonas>including if guards...
<oriansj>yeah
<oriansj>the plan is as follows: M2libc make the .h files #include the .c versions of themselves in a #ifndef block
<oriansj>cc_reader.c when the token is #include; read the next token and load that file, pushing current file name and line number onto a stack. output a token set like // #FILENAME new_name 0 and after reading that file // #FILENAME old_name ###
<oriansj>with ### being the line number to resume at; so that M2-Planet's cc_reader.c can be adjusted to use the alternate filename and line numbers on the tokens it generates and produce more meaningful error messages
<oriansj>what do you think stikonas?
<stikonas>yeah, that should work
<stikonas>still a bit of work but I think doable
<stikonas>oriansj: now I'm hitting M2libc/stdio.c:348:unlink is not a defined symbol
<stikonas>with test0001/hello-knight-native.sh
<stikonas>I guess it's not implemented
<stikonas>probably with all tests, not just test0001...
<stikonas>so this one should be fixed in M2libc
<stikonas>empty function?
<stikonas>or what should we do
<stikonas>or should I copy it from Linux/unistd.h
<stikonas>ok, I think return 0 makes more sense...
<stikonas> https://github.com/oriansj/M2libc/pull/9
<stikonas>ok, I think M2-Planet PR is ready, I'll do it once M2libc PR is merged (as I need to update git submodule)
<stikonas>riscv32 tests are added too but not enabled in make test since M2libc is not ready yet
<oriansj>the only thing I have to note about your M2libc pull is you didn't include yourself in the copyright header
<oriansj>but if you are fine will that I will merge as is
<stikonas>ok, I can add that...
<stikonas>it's something I usually try to add but also often forget...
<stikonas>as do many other people...
<oriansj>true however you are making meaningful additions
<stikonas>well, I mean in general, not just in this project
<stikonas>anyway, let me update PR
<oriansj>literally whole ports worth of work by yourself. (which is quite impressive BTW)
<stikonas>well, riscv32 is not really a full port
<stikonas>so much is common with riscv32...
<stikonas>it's way more similar than e.g. amd64 vs x86
<stikonas>ok, PR updated
<oriansj>ok merged
<stikonas>ok, let me prepare M2-Planet...
<stikonas> https://github.com/oriansj/M2-Planet/pull/37
<oriansj> 205 computed checksums did NOT match and test1000 proof.answer wasn't updated
<oriansj>wait, didn't update M2libc first
<oriansj>double checking now
<oriansj>ok, looks good
<stikonas>yaeh, most of those run_test.sh changes are due to M2libc update...
<stikonas>I'm looking at remaining M2libc changes now
<stikonas>everything is trivial except for waitpid