IRC channel logs

2024-02-28.log

back to list of logs

<ekaitz>good
<ekaitz>then everything should be easy!
<ekaitz> https://github.com/ekaitz-zarraga/tcc/blob/mob-riscv-bootstrap/guix/commencement.scm#L739 that's the guix recipe for riscv
<webczat>ekaitz: tcc: error: invalid option -- '-MMD,scripts/basic/.fixdep.d' when trying to install the linux headers. is that option added in newer tcc?
<ekaitz>it's just some command execution
<ekaitz>hmm i don't know what that is
<webczat>which fails and doesn't allow me to header_install
<webczat>okay so i want to build tcc-mob. what I need is tcc-mob from orig repo with your patch? or something more?
<webczat>i took it directly from repo.or.cz
<ekaitz>you can use the one from my mob-riscv-bootstrap branch if you want
<webczat>mmh
<ekaitz>it has other commits we use for our stuff, but the ones that affect your build are just the ones you need
<ekaitz>there are just a few commits
<ekaitz>you can review them
<ekaitz>i just fixed some stuff on riscv and the realpath thing
<ekaitz>it's not that much
<webczat>mhmm okay
<ekaitz>if you don't use riscv you won't notice most of the commits
<webczat>and I can use that tcc to compile what? real libc like musl?
<ekaitz>only that one i linked to you (btw i push --forced)
<ekaitz>webczat: you can try! I only built make, patch and gzip with it
<ekaitz>(for riscv64)
<ekaitz>but surely i'll try to build more things in the next days
<webczat>i am actually going to use uclibc for this stage, not musl
<webczat>not sure if it's even lighter but
<webczat>i am going to make a static gcc toolchain with uclibc and from this stage switch to glibc for the final work
<ekaitz>x86?
<webczat>well actually static gcc toolchain for x86, then static crosscompiler for x64, then native x64.
<ekaitz>o cool
<webczat>ekaitz: finally x64 but i use x86 now
<webczat>because i want freedom to compile very old packages if needed.
<webczat>in the process
<ekaitz>but you have the current commencement.scm file in guix with the process described! and live-bootstrap is working too!
<webczat>ekaitz: that's part of the journey to use as little scripts as possible. also scheme language is not that clear to me when I read it
<webczat>i mean as little scripts not from the to be compiled package. I'm partially intending to discover part of the path. and doing things like using uclibc instead of musl because why not
<ekaitz>i can help you follow
<webczat>i went to that stage without mostly using or reading guix scripts and with quite minimal instructions from here tbh.
<webczat>because it's funnier
<ekaitz>as you prefer
<ekaitz>if you need some help just ask me
<webczat>okay so my next step is to build tcc-mob. will grab your commit. when I will be hardblocked I'll probably ask
<ekaitz>i mostly rewrote most of the first staged myself in guix
<ekaitz>great
<ekaitz>you are doing good
<webczat>stage0 was the only thing i did with help of scripts, although I self discovered steps until m2-planet without a problem. too order specific to lose time to guess
<webczat>also my initial env is kernel+busybox and i don't avoid pregenerated non binaries
<webczat>or pregenerated binaries in source tree if any
<ekaitz>oh i see
<ekaitz>not kaem hehe
<webczat>ekaitz: i was forced to build kaem because of mes bootstrap. but i was not using it myself
<ekaitz>i see
<webczat>also btw, why do you patch realpath out instead of adding realpath to mes libc? is that function problematic?
<ekaitz>well, it was easier to patch it out
<ekaitz>we could add it, but we are busy :(
<ekaitz>if you want to add it... :)
<webczat>i mean destroying/throwing out is usually easier, but realpath seems not that difficult in principle. dl* seem far more involved
<webczat>ekaitz: if I ever start adding these missing things for the poor make, I might. why not
<ekaitz>stikonas has a draft for it, but i think it had some issuese
<ekaitz>i don't remember very well
<webczat>so not that easy. good to know
<ekaitz>nothing is that easy at this stage
<ekaitz>:)
<webczat>ekaitz: most of the missing functions for make kinda are. comparing with them
<webczat>nvm, where is that commit...
<webczat>have to go to sleep so want to do some steps before. or at least discover next problems
<webczat>where is the download as targz...
<ekaitz>of what? my tcc?
<webczat>wait found it probably
<ekaitz>there's only zip i think
<ekaitz>oh if you change the url works
<ekaitz> https://github.com/ekaitz-zarraga/tcc/archive/refs/heads/mob-riscv-bootstrap.tar.gz
<webczat>haha
<webczat>i got the commit you linked me to directly
<webczat>this still needs some changes in code I think even if you removed realpath
<stikonas>webczat: we just use putenv stub...
<stikonas> https://github.com/fosslinux/live-bootstrap/blob/master/steps/make-3.82/files/putenv_stub.c
<webczat>stikonas: trying to compile make failed because of no putenv symbol in mes 0.26
<webczat>aaaa
<webczat>okay
<stikonas>it should probably go to meslibc...
<webczat>so i literally turned it into setenv
<webczat>should probably work
<stikonas>but for now one of us added putenv_stub
<stikonas>it does not block anything in the bootstrpa chain
<webczat>got it
<stikonas>and eventually we switch to better libc and better make
<webczat>everyone found their own workaround it seems :P
<stikonas>webczat: still catching up with IRC backlog but musl is quite easy to build
<stikonas>at least on x86 I was able to build it with just a few patches
<stikonas>mostly disabling assembly that tcc does not support
<webczat>stikonas: so we'll see how it goes with uclibc. likely similar
<stikonas>likely for your usecase
<stikonas>for non-pregen file bootstrap musl is much better
<stikonas>it has a very simple build system with a short hand-written (not autotools) configure
<webczat>stikonas: uclibc uses kbuild. i think it's also not pregen
<stikonas>also musl is better supported by modern software
<stikonas>I think it's #2 in terms of what distros use...
<webczat>stikonas: i only need uclibc or more specifically uclibc-ng to build working gcc. my actual target is glibc
<webczat>that's why I don't care about software support, assuming gcc works with it
<stikonas>perhaps that will work for you
<stikonas>I don't have experience with glibc
<webczat>I do, but i want a static toolchain first and I don't need glibc for that.
<stikonas>generally on my systems I use glibc too, so musl is just a stepping stone
<webczat>exactly
<webczat>was wondering about klibc. probably klibc is not enough to build gcc, but curious if it can replace mes libc in some stages.
<webczat>and/or built tcc
<webczat>not going to test rn probably, but interesting
<webczat>this is some minimal libc intended to power initramfs... not like it's being used too much, but still
<webczat>or maybe it is, i just don't know. to my surprise it's probably not dead
<stikonas>well, meslibc is good enough to build really ancient gcc
<stikonas>I think 2.95.3
<webczat>stikonas: is it? that's good to know.
<stikonas>but if you want to go from tcc to gcc 4.x directly, right now you need musl
<webczat>stikonas: it's probably more about whether gcc can be compiled by tcc at all?
<stikonas>yeah, but musl binaries generally work better than meslibc
<stikonas>that info might be a bit old though
<webczat>stikonas: i am more worried about asm/linker support, not about libc
<stikonas>but when we wrote live-bootstrap we were hitting some issues with meslibc binaries
<stikonas>occasionally nonsense result, especially around floats
<stikonas>webczat: that's binutils
<webczat>ah you mean the tcc on meslibc...
<webczat>stikonas: does gcc use binutils even when using tcc to compile it?
<stikonas>well, we even had some bugs such as seq on meslibc printing something else
<stikonas>possibly zeroes
<stikonas>webczat: that's up to you
<stikonas>you can tell it to use binutils
<stikonas>in fact binutils will be picked by default
<stikonas>as that's what gcc normally uses itself
<stikonas>generally pre-binutils you need to do tricks like AR="tcc -ar" LD="tcc"
<stikonas>to get build systems to build with tcc
<stikonas>but once you have binutils, you only need CC=tcc
<stikonas>anyway, tcc is known to be able to compile gcc 4
<stikonas>when combined with musl and binutils
<stikonas>anything else is unknown, might work but more likely you'll hit problems
<stikonas>webczat: and there is no point of building tcc without binutils
<stikonas>s/tcc/gcc/
<stikonas>as gcc is just a compiler, it will only produce assembly then
<stikonas>but you want it to build binaries...
<webczat>yea
<stikonas>hence tcc -> [other non-toolchain tools] -> binutils -> gcc
<stikonas>so basically the only free variable is which binutils/gcc version you are targeting
<stikonas>and that imposes some requirements on libc
<stikonas>also binutils is basically capped to 2.30 with tcc 0.9.27
<stikonas>(not sure about mob)
<stikonas>anything newer starts using more and more advanced C stuff that doesn't work with tcc 0.9.27
<stikonas>and GCC is of course capped at 4.7.4
<stikonas>anything newer needs C++
<webczat>i broke my tcc! aaaa!
<webczat>can't find startfiles even though they exist
<stikonas>webczat: tcc -vv
<stikonas>check if paths match to where the files are installed
<webczat>too late because i've replaced the bootstrap one and now need to rebuild it
<webczat>but thanks, will use it in a while
<stikonas>also you can always run it with -nostdlib
<stikonas>and pass those crt files (and libc) manually
<webczat>mhm
<webczat>but i think they require some specific ordering?
<webczat>at least some .o files
<webczat>so if I don't compile manually it would be a problem
<webczat>thanks for help, bye. will do some more stuff and go to sleep. goodnight
<ekaitz>stikonas: https://lwn.net/SubscriberLink/962788/9b3ad884722c5310/
<ekaitz>we are famous now
<ekaitz>they mention the guix bootstrap
<ekaitz>and I appear there lol
<stikonas>oh nice!
<ekaitz>i'm pretty suprised for the amount of people that watched the talk
<ekaitz>ACTION now can sleep better today
<stikonas>well, giving a talk at fosdem does help
<stikonas>we have lots of cool stuff here
<stikonas>but maybe not always best at advertising it
<ekaitz>yeah...
<ekaitz>i should do that more
<ekaitz>in fact, i'm pretty comfortable talking in public in 3 different languages
<ekaitz>ACTION is working on the 4th but that will take long
<oriansj>ekaitz: well it is very unlikely we will get "famous" unless someone uses our work to catch a *BIG* Trusting Trust attack in the wild.
<oriansj>but it is good that they recognized your hard work