WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Build Distribution for Maintaining the Famous GCC 4.7  (Read 476 times)

Offline mocore

  • Hero Member
  • *****
  • Posts: 626
  • ~.~
Build Distribution for Maintaining the Famous GCC 4.7
« on: August 16, 2024, 09:03:54 PM »


 https://fosdem.org/2024/schedule/event/fosdem-2024-2690-build-distribution-for-maintaining-the-famous-gcc-4-7/

Quote
We would like to present a build description (for the JustBuild build system), used to patch and bootstrap a GCC version 4.7 on a minimal x86_64 Linux system, which only needs a POSIX shell, coreutils, and a C library (GNU, musl) installed.
To achieve this, the bootstrap process starts by building Busybox, GNU Make, and Binutils from scratch before those are used to bootstrap GCC 4.7.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 823
Re: Build Distribution for Maintaining the Famous GCC 4.7
« Reply #1 on: August 17, 2024, 09:05:51 AM »
Hm, if I remember correctly, Aboriginal Linux (method by Rob Landley) -- https://github.com/landley/aboriginal -- was the original, first and truly try to re-build a Linux with minim tools, from sources: Kernel + shell (busybox, toybox) + compiler (gcc 4.2)+ lib (libc, musl). The problem (GNU license) was the compiler/linker (GCC) did not stop to use non-standard extensions (to build the kernel), so the project was stopped.

FYI: CachyOS (compiled for architecture x86-64-v3/4, with -O3) has now a libcstd.so of 26+ MB; craziness for a merely 4%-10% speed on SOME specific apps (mostly compression, multi-threading, etc).
« Last Edit: August 17, 2024, 09:09:15 AM by nick65go »

Offline mocore

  • Hero Member
  • *****
  • Posts: 626
  • ~.~
Re: Build Distribution for Maintaining the Famous GCC 4.7
« Reply #2 on: August 17, 2024, 12:49:38 PM »
The problem (GNU license) was the compiler/linker (GCC) did not stop to use non-standard extensions (to build the kernel), so the project was stopped.
dont suppose you happen to remember where you got this gist from?

i'd assume http://lists.landley.net/pipermail/aboriginal-landley.net/ would be most likely

this (Migrating aboriginal->mkroot list.) gives the impression http://lists.landley.net/pipermail/aboriginal-landley.net/2018-February/002624.html

it continued @ https://github.com/landley/mkroot - http://lists.landley.net/listinfo.cgi/mkroot-landley.net

... https://github.com/landley/mkroot/commit/6f72e3bacfdc4abb746a18f1a9d7610d53deae94
http://lists.landley.net/pipermail/toybox-landley.net/2019-August/010810.html
Quote
[Toybox] I merged mkroot.
and now continues @ https://github.com/landley/toybox/tree/master/mkroot



Offline nick65go

  • Hero Member
  • *****
  • Posts: 823
Re: Build Distribution for Maintaining the Famous GCC 4.7
« Reply #3 on: August 17, 2024, 03:27:28 PM »
The main subject/ interest was that gcc 4.7 is the LAST compiler that can be build with only C and without C++. Personaly I dislike how "they" did it (too many tools to compile/trust first, like MAKE).

It should start wit the MINIMUM packages. A normal (or security concerned) singular person could NOT have enough time/knowlegde to AUDIT mastodonts (huge pile of code) like KERNEL or GCC compiler. What remains is then the basic LIB (libc) -- or musl libc (is smaller). But even those libs are big to audit. Plus the kernel compilation could recently ask for not-necessary auxiliary tools like make/perl/bc/rust whatever.

So the only piece that a common user could control is the SHELL (busybox or toybox). This was the key to boot-strap a NEW linux (a new kernel RE-compiled from 4 packages: minimal old KERNEL + gcc + libc + shell). Rob Landley at least provided this base, build without using  neither perl, nor bc, etc. He did not used LFS (linux From Scratch) method. So he reduced attach surface (numer of initial tools) to build a trustfull base. AND provided to all of us the tar-ball (with kernel + root + compiler) to start our journey from scratch.

Because if the initial tools (lets say perl) is "compromised" then the initial build base is then compromised. Yes, I know GCC will try to compile itself again from itself as a safe check. It does not matter if is busybox, or toybox, or anything else. It all resumes to: (you) trust (them) the trusty. The smaller the base tools -- the better. With "rust" tommorow in kernel, gcc/lwm depending on C++ .. just pray/hope that all will still be good (I do not).
« Last Edit: August 17, 2024, 03:31:16 PM by nick65go »

Offline mocore

  • Hero Member
  • *****
  • Posts: 626
  • ~.~
Re: Build Distribution for Maintaining the Famous GCC 4.7
« Reply #4 on: August 18, 2024, 02:48:03 PM »
ahh think i found the reference (dooh) https://landley.net/aboriginal/ ::)

 :-\
Bootstrapping debian would be nice, but I'm not sure anybody under the
age of 40 still cares about non-Android Linux? Heck, even most of the
android developers are using windows and mac hosts.


... interesting that https://landley.net/aboriginal/history.html
mentions
Quote
ck in the late 90's, before linksys routers came out, I installed several masquerading gateways by putting Red Hat on old leftover 386 machines. This involved removing as many packages as possible from the base install, both to get the size down (to fit it on old hard drives) and to reduce the security exposure of all the daemons Red Hat ran by default (including a print server and an NFS server exposed to the world, for no readily apparent reason).


seams to capture the spirit of the age

reduction of *extra* MB and features
.... the world it appears in this respect has gon far AF in the other direction  :-[



I joined the Automated Linux From Scratch mailing list in hopes I could find (or help create) an official script to use, but they were all talk and no code. (Everybody had their own automation script, but the project wanted to create something big like Gentoo and seemed to think that publishing a simple script implementing the existing Linux From Scratch instructions was beneath them. So everybody had their own script, none of which were "official".)

wow  :-X
« Last Edit: August 18, 2024, 03:06:25 PM by mocore »

Offline mocore

  • Hero Member
  • *****
  • Posts: 626
  • ~.~
Re: Build Distribution for Maintaining the Famous GCC 4.7
« Reply #5 on: August 29, 2024, 08:29:55 AM »

fwiw , some links ( for comparison) 

 https://distrowatch.com/table.php?distribution=tinycore

 http://tinycorelinux.net/5.x/x86/tcz/gcc.tcz.info

Quote
                This extension contains:
                gcc-4.7.2 - GPLv2 - http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2