[Aboriginal] GCC - messed up search dirs

Rob Landley rob at landley.net
Sun Jan 22 14:24:18 PST 2012


On 01/22/2012 09:37 AM, Paul Onyschuk wrote:
> As a side note FreeBSD is using currently pmake, which is similar to
> bmake, but has some different subtleties.  OpenBSD is also using bmake,
> it was inherited when Theo de Raadt forked off from NetBSD.  Since then
> OpenBSD bmake was maintained independently, so right now it isn't the
> same compared to NetBSD version.

This would explain why I've never heard of the package before.

However, building packages I've never heard of is a valid use case of
Aboriginal Linux: I made a build environment, you use it to do whatever
you like.  The fact it didn't work right is a bug, and I need to fix it.

I think I have a fix, which should be in the upcoming release.  If you'd
like to try it now, do this:

cat > /tmp/cpp << 'EOF'
#!/bin/bash

gcc -E "$@"
EOF
mount --bind /tmp/cpp /bin/cpp

> Second side note.  This isn't related to Aboriginal Linux, but could be
> interesting for toybox project (or not).  Some time ago MINIX project
> started replacing their userland tools with NetBSD counterparts.  It
> got me thinking if *BSD userland can be ported to Linux (uclibc based
> to be specific).  I started with OpenBSD tools, but it quickly turned
> out that those were heavily using OpenBSD libc specific features (I will
> not go into the details).

I've got to get as much of itas possible to work with bionic.  That's
going to be interesting.  I'll probably have to write my own regex engine...


> On other hand porting NetBSD tools was in most cases trivial.  Some
> informations about this effort can be found in my github repository
> [1].  This link leads to wiki page with some details about porting
> software from NetBSD, some tools can be found in the same repository.
> I used brute force, especially when it comes to macros. Also makefiles
> are ad-hoc solution.  I was going to start from scratch and make it
> right, but that never happened.

I recall a bunch of subtle incompatabilities, such as netbsd awk and the
gnu/dammit version of awk disagreeing about the index of command line
entries...

> Back to Pkgsrc.  Pkgsrc is released every quarter, which makes it
> easier to use for external projects and not only NetBSD (release timing
> and so on).  Currently pkgsrc is used also by DragonFly BSD, SmartOS
> from Joyent (Solaris based system) and there are big efforts in MINIX
> project to use it as official solution for providing third party
> software.  It isn't perfect solution, Pkgsrc has own quirks, but it
> gets job done and BSD license makes it even more attractive.

Minix has a project?

> I introduced some confusion in previous message, when speaking about
> Pkgsrc bootstrapping, so I will describe the process.  It starts with
> fetching tarball "full of makefiles" [2], typically it is unpacked
> under /usr (/usr/pkgsrc is main tree in this case).  Alternatively It
> can be unpacked under user home directory and bootstrapped without
> privileges (nice feature, because you can keep more than one Pkgsrc
> version e.g. with different settings).  I pointed out dependencies in
> previous message.

Did my above workaround fix your problem, or not?

> Then bootstrap script (it can be found under /usr/pkgsrc/bootstrap, it
> just a shell script) is used to build some common tools used by Pkgsrc,
> bmake is one of those.  Because Pkgsrc is designed to support so many
> systems, some additional tools can be built e.g. if system only
> provides old awk or sed isn't compatible enough and so on.  The same
> goes for Busybox awk (one of the tools built by bootstrap is using long
> awk script - I don't remember which one), but fix for that is trivial:
> change "need_awk" to yes on line 596 in bootstrap script.
> 
> Another side node.  I "ported" (ported is too big word to describe that
> in my opinion) some software from one to another system and I can say
> that awk is one of the biggest offenders there.  Some software provides
> GNU awk specific scripts in their build system (command line flags and
> other features).  This creates problems, when porting software to *BSD,
> because those are using "One True AWK" by Brian W. Kernighan aka
> bawk/nawk.  In most cases this is just build dependency, so it is
> easier to provide gawk than fix awk scripts in every 3rd party
> software.  Scripts written for nawk, work just fine with gawk, but not
> with Busybox awk in some cases.

I comissioned a half-dozen fixes to busybox awk over the years, and for
toybox I'm going to have to write my own.  I'll make it work according
to SUSv4 and the Linux From Scratch ./configure scripts.  I don't care
about BSD but if you want to test it there, I'll take bug reports once I
run out of my own bugs to fix in it.

But I haven't started that one yet...

> Back on track.  When it comes to CPP error, configure script used by
> bmake has some sanity checks for environment.  It checks if compiler
> and preprocessor are usable and rest is the story.  I could change
> configure script, but I don't see a point in fixing something that
> isn't broken.  I appreciate fast response and I'm looking forward for
> using Aboriginal.

I was pretty sure that gcc didn't call cpp or else the path issue would
have bit us beforenow, but I just confirmed that replacing it with a
tiny "gcc -E" wrapper script seems to work.  I'll put that in the
upcoming release.

> After writing all of this, one thing left is explanation for using
> Pkgsrc under Aboriginal.  For anything beside basic software, tracking
> dependencies can be pain in the ass.  There is no point of writing
> another system just for that, when you can use existing solution like
> Pkgsrc.

Or portage. Or rpm.  Or dpkg.  Or pacman.  Or bitbake.  Or buildroot...

> Moreover I would like to investigate if there is a easy way to
> force Pkgsrc to use only static linking.

  find root-filesystem-i586 -name "*.so*" | xargs rm

>  Pkgsrc is already used by
> MINIX in some degree and this system as of time being doesn't have
> support for shared libraries at all.
> 
> btw. I'm regular reader of your blog, keep it up. Thanks for all your
> work.  I'm subscribed to Aboriginal and to toybox mailing lists.

Yay!  Thanks.

I'm sorry if I'm not interested in the new tangent but my plate's full:
toybox is probably going to suck up my free time for the next six
months, and I still need to get the bootstrap-gentoo.hdc stuff working,
and get the Linux From Scratch build to 7.0, and I need to sparc working
the rest of the way and fix m68k and hack up an sh4 board with more than
64 megs and write a distcc clone that doesn't suck and figure out what
to do about armv8 and mips32 and if I managed all _that_ I'd dig up my
old qcc notes...

Rob

 1327271058.0


More information about the Aboriginal mailing list