Conversation
Notices
-
Embed this notice
Alexandre Oliva (lxo@gnusocial.net)'s status on Tuesday, 22-Nov-2022 07:40:59 JST Alexandre Oliva --with-sysroot would be the way to go indeed. you posted plenty of details of what you figured out (nice!), but not so much about what went wrong in the end, so it's hard to guess how to help. if you wanted help, that is. -
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:05 JST Sergey Bugaev In fact I'm almost positive that other cross toolchains I've worked with in the past have done just that.
But — I can't seem to be able to find the right combination of incantations. Between all the --prefix, DESTDIR, --with-sysroot, --with-byild-sysroot, --with-headers, --with-native-system-header-dir, something goes wrong. I was actually able to convince GCC to look for headers in the right place, but the libraries still escape me.
-
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:06 JST Sergey Bugaev Simply speaking, I want my toolchain to intrinsically know where to look for (system) header files and libraries — in $PREFIX/include and $PREFIX/lib respectively — so that when I set CC=$PREFIX/bin/i686-gnu-gcc the right directories are picked up automatically, just like the system compiler picks up /usr/include and /usr/lib without me having to add them explicitly.
That doesn't sound like a very strange thing to want, does it?
-
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:07 JST Sergey Bugaev Why glibc doesn't do this automatically is beyond me, but I guess this is a small thing relative to everything else here
• Now you can finally go back to GCC and build libgcc
• Now you can build glibc for real, then Hurd, then whatever else remains.Sounds like a breeze, doesn't it?
But anyways, *that* I have figured out. What I haven't is paths.
-
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:08 JST Sergey Bugaev You do this by invoking CC=gcc ./configure --host=i686-gnu $OTHER_FLAGS — i.e., we're building for the Hurd, but do your stupid checks using my host toolchain for now so that we can pretend that everything works and at least get something done today
• After this, you can actually build enough of glibc to install its headers. You'll also have to build csu/crt[1in].o & manually copy them over into the prefix, and also create a couple of empty files (include/gnu/stubs.h & the very lib/libc.so!)
-
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:09 JST Sergey Bugaev But this can be worked around in a relatively not-so-terrible way:
• You build GCC proper, without libgcc
• Then you install some Mach headers without actually compiling anything
• Then you build MIG
• Now you can kinda compile the Hurd MIG defs, if you trick the build system into letting you build anything. -
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:10 JST Sergey Bugaev For starters, there are all the circular dependencies:
• GCC includes libgcc and so depends on glibc
• glibc of course cannot be built without GCC, and it also depends on MIG, as well as Mach and Hurd headers
• MIG depends on Mach too, for types & stuff
• Mach naturally needs GCC and MIG to be built
• The Hurd needs all four — GCC, MIG, Mach, and glibc.Yay
-
Embed this notice
Sergey Bugaev (bugaevc@floss.social)'s status on Tuesday, 22-Nov-2022 07:41:12 JST Sergey Bugaev Spent most of today trying to build myself a cross toolchain —
specifically, I want to compile binaries for GNU/Hurd from my GNU/Linux box. These are both GNU systems that are well supported in the upstream GNU projects, so this should have worked flawlessly, without a single hiccup, right?
Lol no ?
-
Embed this notice