***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>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>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>(it's M2 itself that crashes when building blood-elf) <fossy><@oriansj> should I submit a proposal for FOSDEM this year? <stikonas>oriansj: yes, it's ((RISCV32 == Architecture) || (RISCV64 == Architecture)) that breaks cc_riscv* <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. <stikonas>well, I found one copy-paste error where I had RISCV64 twice instead of one RISCV32 and the other branch doing RISCV64 <stikonas>something later fails but I guess that's expected... <oriansj>honestly it looks rather minimal delta as a new M2-Planet port so nice work stikonas <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>I'll just change order of -f for now. It's better to include .h files first anyway <oriansj>well we also need to update the .h and .c files to be more C standard in M2libc <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 <stikonas>oriansj: now I'm hitting M2libc/stdio.c:348:unlink is not a defined symbol <stikonas>probably with all tests, not just test0001... <stikonas>ok, I think return 0 makes more sense... <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>it's something I usually try to add but also often forget... <oriansj>true however you are making meaningful additions <stikonas>well, I mean in general, not just in this project <oriansj>literally whole ports worth of work by yourself. (which is quite impressive BTW) <stikonas>it's way more similar than e.g. amd64 vs x86 <oriansj> 205 computed checksums did NOT match and test1000 proof.answer wasn't updated <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