Thanks grischka! With re-ordered sections linux-2.4.37.11 compiles/links and boots again. Too i re-tested recent commit f0cd0fbe1b0b0465c87f9507299b468a0b208cf7 against a complete(!) system set of builds that i zipped into ~500 ebuilds here, fully supported by tcc for x86 already. Fully supporting tcc with crossdev/portage was a hell of a hackjob.
And I was bug-hunting and bisecting various tcc versions, kernel versions and patchsets for month to salvage Linux-2.4 compilation with tcc (the section layout issue wasn't the only one), without any known-good working baseline up until recently. FYI: That is, for regression testing tcc which would have prevented me wasting weeks of bisecting, it is now possible: - to regularly compile/link/boot linux-2.4 x86 - and a complete set of ~500 packages that i can support with tcc already (removed all direct and transitive c++ dependencies, among other patches) With plans to emit a complete i486-tcc-linux-musl.iso distribution to work with, I've already spotted other minor regressions. I'll try to fix and/or report those as best as i can, and will announce on the mailing list once the tcc-linux distribution is available. Furthermore i cannot support dynamic-linking with tcc yet, because musl-libc libc.so dynamic loader crashes when compiled/linked with tcc (bootstrappable.org got some patches for musl-libc for support with tcc statically linked); Hence i have to re-bundle what's currently maintained for tcc without ebuilds/portage/crossdev (python needs dynamic linking and fails with tcc), statically linked. Once the distribution is ready and available as a stable(!) baseline i'll summarize ISSUES, so these can be re-produced and verified against it easily without duplicate efforts. Grischka, if that's ok and doesn't cause too much confusion, i would appreciate if efforts are coordinated to avoid future regressions that required bi-secting accross more than 100 commits; for example release tag for 0.9.27 dates back 7 years already, and 0.9.28 seems not sufficiently stabilized yet. Anyway, too i am planning to converge and re-integrate the tcc-toolchain system profile that i got with bootstrappable.org That is, currently i cannot publish yet, since it is too much cleanup work remaining to finalize a complete i486-tcc-linux-musl.iso distribution to work and test with, and i rather keep tcc synced to latest HEAD for this ;) Regards. aggi On 2024-11-13 14:00, grischka via Tinycc-devel wrote: > On 13.11.2024 00:41, Vad Rulezz wrote: > > I'll look into it, having ability to build/boot linux is a nice thing. > > > > I think the issue is may be the sections ordering while linking. Well, > > maybe something else too, but it't unlikely there is a lot of brokiness.. > > To have executable code come first in the "vmlinux" non-elf binary > you can try this: > > in tccelf.c:sort_sections(): > if (s->sh_flags & SHF_EXECINSTR) > - k = 0x70; > + k = 0x30; > > Currently (with k=0x70) it would put ro-data first. > > -- grischka > > > > > > > Vad Rulezz > > > > On 11/13/24 2:24 AM, Michael Ackermann via Tinycc-devel wrote: > >> This one from seyko2 is a good start for AoT compiling/linking linux-2.4: > >> https://github.com/seyko2/tccboot > >> FYI, for 16bit real-mode bootcode assembly binutils-as is needed, > >> 32bit compiling/assembly/linking is handled nicely by tcc. > >> and i've mentioned the latest commit-id on mob branch that i tested with. > >> > >> Myself too had tested tccboot JiT, which i succeeded with once with some > >> updated > >> tcc mob branch version linked against, but didn't test any further, not > >> yet. > >> tccboot is available from bellard.org > >> > >> anyway, the regression on tcc mob branch seems rather severe, although it's > >> disclosed by kernel compilation for x86 only, i suspect it potentially > >> affects > >> various other test-cases and architectures. > >> > >> On 2024-11-13 00:56, Vad Rulezz wrote: > >>> Hello Michael, > >>> > >>> On 11/12/24 10:27 PM, Michael Ackermann via Tinycc-devel wrote: > >>>> The revert/backout diff that i could confirm that tcc succeeds > >>>> compiling/linking > >>>> kernel with is attached. > >>> > >>> Can you share a script or somewhat detailed instructions on how to build > >>> linux kernel with TCC? > >>> > >>> > >>> Vad Rulezz > >>> > >>> _______________________________________________ > >>> Tinycc-devel mailing list > >>> Tinycc-devel@nongnu.org > >>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel > >> > >> > >> _______________________________________________ > >> Tinycc-devel mailing list > >> Tinycc-devel@nongnu.org > >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel > >> > > > > _______________________________________________ > > Tinycc-devel mailing list > > Tinycc-devel@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > > _______________________________________________ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel --
signature.asc
Description: Digital signature
_______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel