IRC channel logs

2023-06-06.log

back to list of logs

<oriansj>the only problem i predict with this change is it break's mescc' !0xDF !0xFC strings (which i don't understand when we have 'DF FC' raw strings in M1)
<oriansj>or we special case !## to work for -127 to 255 and leave it to the user to know what they are doing.
<stikonas>oriansj: I've switched mescc to raw strings
<stikonas>though that is still pending for the next release
<stikonas>oriansj: but the next mes/mescc release would need new stage0-posix release anyway (at least on 64-bits)
<stikonas>oriansj, janneke: so perhaps stage0-posix release should be made at the same time as the next mes release
<oriansj>well that solves that concern.
<oriansj>and I am good with that.
<stikonas> (https://gitlab.com/janneke/mes/-/commit/061d7f93800e39b9927f748c9d1c17eaffb7e106#15d34292635b3d1487809ba9d4393e5f6ca36149_143_148)
<stikonas>it's still on wip branch for now
<stikonas>I need to create a gnu style commit message and add copyright statements but I just returned back from holiday, so haven't done that yet
<oriansj>ultimately it will be up to builder-hex0 and mescc to dictate what they want as standard M1 behavior.
<theruran>on my new Void Linux-musl system, and `sh kaem.amd64` fails with `kaem.amd64: 30: ./bootstrap-seeds/POSIX/AMD64/kaem-optional-seed: Permission denied`
<theruran>kaem-0 and bin/kaem: not found
<theruran>cleanup.sh also failed. couldn't find pushd???
<theruran>feel like I am missing some essential utility
<stikonas>theruran: are you running with bash or some other shell?
<stikonas>pushd is bashism
<theruran>fish
<stikonas>might be the cause
<stikonas>and I recommend running kame scripts with kaem or kaem-optional-seed
<stikonas>they might not be fully compatible with posix shells
<theruran>I ran it wish fish before. and cleanup.sh starts with /usr/bin/env bash which seems to work
<stikonas>oh ok, that's fine then
<theruran>what's the difference between kaem and kaem-optional-seed?
<stikonas>kaem is a C program
<stikonas>with more features
<stikonas>kaem-optional-seed is handwritten hex0 code
<stikonas>which only knows how to run other programs (with command line arguments) and 2 types of comments
<theruran>kaem-optional-seed is the one I get permission denied
<stikonas>kaem has e.g. aliases, conditionals, environmental variables
<theruran>because it's not a PIE?
<stikonas>it's not
<stikonas>it's the only binary in stage0-posix-amd64 that is not PIE
<theruran>OK
<stikonas>you can create PIE version
<stikonas>it would be a few bytes bigger
<stikonas>perhaps it makes sense to port
<stikonas>theruran: e.g. lines like https://github.com/oriansj/stage0-posix-amd64/blob/master/GAS/kaem-minimal.S#L121
<stikonas>mov eax, OFFSET hard
<stikonas>have to be replaced with lea eax, [rip+hard]
<stikonas>or possibly lea rax, [rip+hard] (whichever has smaller x86_64 encoded size)
<stikonas>theruran: so you system can only run PIE binaries?
<stikonas>I suspect some later stages of bootstrap might break...
<theruran>I guess so. seems to be the standard nowadays
<stikonas>not sure how well old gnu software supports requiring PIE
<theruran>hmmm
<stikonas>but perhaps you can pipeclean it to work
<stikonas>nobody tried running bootstrap on hardened system that only supports PIE
<theruran>ACTION :)
<stikonas>anyway, in stage0-posix and mes stages you'll only have to fix kaem-optional-seed
<stikonas>no idea what will happen with old tcc...
<oriansj>well old tcc didn't support making Position Independent Executables
<oriansj>mostly because trying to doing that on x86 sucks
<oriansj>(you literally have to do call 0; pop rax and then you can do mov eax, [eax+offset])
<oriansj>^pop rax^pop eax^
<stikonas>well, in any case we don't have a working tcc-0.9.26 bootstrap on amd64
<stikonas>only on x86...
<stikonas>and I'm right now running a test with riscv64 with wip-riscv branches from janneke and ekaitz
<stikonas>already running for 2h...
<stikonas>(qemu user emulation is being slow...)
<stikonas>janneke: tcc 0.9.26 is probably not too far from building
<stikonas>compiler (mescc) seemed to be happy on wip-riscv branch but linking stage errored out with
<stikonas>"Target label expr_const64 is not valid"
<stikonas>probably a bit more patching is needed
<stikonas>before HAVE_LONG_LONG is available
<janneke>stikonas: very good news; patching of mescc or of tinycc (or both?)
<janneke>oriansj: very nice
<stikonas[m]>janneke: I think just tinycc
<janneke>nice
<stikonas[m]>Well, the fact that it compiled but failed to link means we called some function that was #ifdefed not to exist