[Toybox] GNU autotools are not working
Brian Mayer
bleemayer at gmail.com
Sun Nov 3 11:24:51 PST 2024
This time I sent it correctly to the list!
Hi Rob, thank you for taking the time to answer this.
Sorry my previous email was a bit obtuse, let me give you more context.
Please note that I'm being simplistic here, I plan to add features
like using tcc to build the rest of the system, and itself, now I'm
just using my host machine for this.
Speaking of which, my host is arch linux, glibc, gcc, and gnu tools,
I'm using a simple script to compile the filesystem.
I am trying to create an ultra simple meta-distro. The idea is to
provide the minimum working system that the user can use to build
their things on.
So I want toybox, a libc, a shell and a c compiler in it, make is a
good addition because most software depends on it. The url for
the project is:
https://terminal.pink/lin0/tree/index.html
Sorry about the certificate, I'm working on it.
In order to do this I started with musl. Compiled it, musl ships a
musl-gcc wrapper that simply uses a spec file to tell gcc to use the
musl libraries and all,
which is basically doing what is described here:
> Modulo glibc's dependencies (perl!) are sad enough that this time around
> a musl-libc gcc toolchain was my first pass to establish a baseline, but
> http://lists.landley.net/pipermail/toybox-landley.net/2024-September/030526.html
> strongly implies that it's working fine. Plus, you know, alpine existing. :)
So for the rest of the project I'm using this compiler, next I build
tcc, linux, toybox and mksh. All are ok and work fine, I booted to
this system after all this.
>> I tested the c compiler and it works,
>
> Define "works". It took years for people to build linux-kernel with
> llvm, there was a whole PROJECT for it, which has mostly gone the way of
> uclinux.org (declared victory and disbanded). And I specifically mean
> "the kernel",
> https://www.cnx-software.com/2012/07/16/ellcc-multi-target-cross-compiler-based-on-clang-and-llvm-compiler-infrastructure/
> was about trying to get userspace to work...
Works means it is able to generate valid elf programs and shared libs
that the musl's ld loader can run.
I didn't test compiling the kernel with it, but now I'm curious, I'm
gonna use the compiled tcc to compile the rest of the system in my
following versions.
> Don't ask me why gnu/they don't gnu/emit the gnu/failures to stderr.
> That would make too much sense, they need gnu/hazing rituals to keep out
> the unwashed masses I guess.
And a ton of extensions to make things non compliant...
> Doing toybox _and_ tcc at the same time seems a bit extreme, in general
> changing multiple variables at once makes experimental results WAY
> harder to parse. Hence the invention of laboratory conditions. :)
nahh
> You might also want to coordinate with
> http://lists.landley.net/pipermail/toybox-landley.net/2024-September/030526.html
> (which is another reply window I have open but haven't managed to scrape
> up the spoons for yet).
Cool, thanks.
> (I have "writing a new make" on my toybox todo list,
That would be awesome, I also tried building bmake (BSD Make) but it
also needs me to
run ./configure, so I ended up in the same place.
> but hit burnout
> this year. Sometime between moving from TX to MN this spring, getting
> flooded here on the list by a well-meaning developer who just took the
> fun out of everything, getting covid YET AGAIN (still sucks), having yet
> to find a proper coffee shop setup here in minneapolis (workspace is
> important), and the looming return out outright fascism, I've spent the
> past few months kinda spinning my wheels...)
I am so sorry about this, hope you get back on track soon.
>> so it may be something related
>> to how GNU autotools interact with toybox or the compiler.
>
> Do you mean you built gmake with tinycc, and the rest of the $PATH being
> debian or similar?
I'm trying to build make on the resulting system (toybox, mksh & tcc).
>> The errors are hard to follow, but it seems to be related with the
>> confdefs.h and .c files, after a lot of sed and cat commands.
>> The idea is to bootstrap the build tools, i.e. compile make without
>> make or other tools that depend on make.
>
> Ok, I'll bite. How do you compile make without make? (Do they provide a
> shell script, like toybox's https://landley.net/toybox/faq.html#hermetic
> or what?)
Fortunately, the make tarball comes with a bootstrap script that,
supposedly, builds make without make.
I guess the gnu tools must start somewhere...
But it runs ./configure as a first step, which is where I'm stuck.
> That "can't create temporary file" looks like the first error. Which is
> not a string that exists in toybox (where we'd almost certainly say
> "temp" to save 5 bytes :) but presumably is configure responding to a
> command failure? Again, check config.log.
The contents of config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:669: checking for a BSD compatible install
configure:722: checking whether build environment is sane
configure:779: checking whether make sets ${MAKE}
configure:825: checking for working aclocal
configure:838: checking for working autoconf
configure:851: checking for working automake
configure:864: checking for working autoheader
configure:877: checking for working makeinfo
configure:902: checking host system type
configure:923: checking whether make sets ${MAKE}
configure:952: checking for gcc
configure:982: checking for cc
configure:1065: checking whether the C compiler (cc ) works
configure:1081: cc -o conftest conftest.c 1>&5
tcc: error: undefined symbol 'main'
configure: failed program was:
This tcc error I was able to reproduce by trying to compile an empty file.
Thank you for all the links and directions, I'm reading them with parsimony.
Cheers,
Brian
More information about the Toybox
mailing list