LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2018, 01:59 PM   #1
Michele13
LQ Newbie
 
Registered: May 2018
Distribution: Debian Jessie 8.10 (x86_64)
Posts: 26

Rep: Reputation: 0
Smile Toolchain and System Bootstrapping: Any alternatives to the standard GNU components?


Hello everyone.

I know that my threads seem a little weird, techical and complicated, sometimes I'm afraid to be mistaken for troll.

A little flashback
When I was a kid I always wanted to build my operative system from scratch, my linux distro, to be more precise.. I've discovered Linux From Scratch but I was too lazy or young to understand all these commands obscure and hard to understand.

A couple of years ago, after having gained a lot of experience with various distros such as Slackware, Slax, Slitaz, Debian, Ubuntu and Puppy Linux, I decided to dive inside that book and I became addicted to it.
The most interesting part was Chapter 5: Constructing a Temporary System as it taught me how to build a indipendent temporary system isolated from the host.

Then I've learned about cross-compiling and musl-libc from clfs-embedded.

Now for the central part of the topic

One of the things that I didn't like about LFS and cross-compilers is that building the GNU toolchain (especially GCC) takes a lot of time and it's big.

Are there any alternatives to the GNU tools? (Glibc, GCC, Binutils)

I only need a C compiler and a C Library that is able to rebuild itself and is able to compile the following things:
  • binutils (or an equivalent package that provides ld, as, ar, ranlib, etc )
  • the Linux Kernel (bzImage, headers and modules)
  • busybox
  • python? - this is not extremely required, one Programming language is enough.
Can you also explain me how to make a cross-compiler that works using that tools? I'm already struggling with this and that

The targets of the cross-compiler should be i486 and ARMv6 with soft floating point. For the i486 architecture I could figure out myself how to do it. Every kind of help that you will give me is appreciated.

Thanks for your patience

Last edited by Michele13; 05-27-2018 at 02:01 PM.
 
Old 05-28-2018, 07:16 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
GCC is big. There's llvm. Glibc is big. There's uclibc. But beside X, they're insignificant, and beside X apps, they're tiny. Use Binutils, or use a different OS. There are minimal and arm based versions of various distros.

LLVM & Uclibc suck, in various ways. No compiler has the range of languages that GCC has. Uclibc PRESUMES you're ok with an en_US locale, and it sucks compiling awkward stuff. Choose a minimal distro. Not to be ignored is damnsmalllinux.

If you're doing an arm based distro yourself, FBBG. Follow the book. Tell us exactly what you are doing and people can help more.
 
Old 05-28-2018, 08:04 AM   #3
Michele13
LQ Newbie
 
Registered: May 2018
Distribution: Debian Jessie 8.10 (x86_64)
Posts: 26

Original Poster
Rep: Reputation: 0
Basically, I'm a geek, I like playing with Linux and with devices that are running using a Linux kernel (Can you see where this is going?). I usually like playing with command-line tools, I like to cross-compile them statically and install them on my mobile: I've cross-compiled (using a musl-libc + gcc + binutils) cross-compiler rsync, Python 2, Python 3, GNU Make, proot (I've used the script inside the package for that) and Busybox. However now I would like to install a C compiler inside my terminal and use it to build software from my phone instead of requiring a PC.

I know that there are APKs out there that allow me to install debian inside my mobile with (or without) root but I would like to build my tools from scratch.

I know a couple of compilers that are tiny and can rebuild themselves such as TCC but it's not enough to build common software such as a C library, and then we have PCC..These are small projects that can be build. Other alternatives?

How do you build that cross-compiler?

Quote:
Originally Posted by business_kid View Post
But beside X, they're insignificant, and beside X apps, they're tiny.
What do you mean?

Last edited by Michele13; 05-28-2018 at 08:17 AM. Reason: Forgot to add something to the post
 
Old 05-28-2018, 10:33 PM   #4
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
This is what you're looking for.

What you're basically asking for is from scratch OS development and not from scratch Linux development. There are smaller, less featured toolchains out there but, don't expect much past C99 and don't expect i18n support. That first link is the most extensive free info on the subject I've found since the days of 8 bit CPUs. Unlike the past, it's hardly done (OS Dev) outside of big corps and universities these days. The hardware vendors have become shameful greedy scrooges that no longer give away things like BIOS source and schematics to the everyday customer. Instead its binary blobs, NSA backdoors and NDAs if you can actually get on their developer lists.

Last edited by Luridis; 05-28-2018 at 10:54 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems installing GCC GNU toolchain saoirse Linux - Software 1 08-21-2012 08:59 PM
LXer: GNU ARM toolchain embedded development on Linux LXer Syndicated Linux News 0 05-22-2009 06:11 AM
GNU ToolChain for ARM, Linux 2.6.14-2/binutil-2.16/gcc 4.0.2/glibc-2.3.5 kumar_bst Linux - Software 0 01-22-2008 04:59 AM
Cross compiling GNU toolchain. pwrichards Linux - Newbie 0 11-30-2007 07:41 AM
Gnu toolchain upgrade AphoxemaG Linux - Software 0 01-12-2007 03:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration