Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Aug 2023 12:35:41 +0200
From:      Felix Palmen <zirias@freebsd.org>
To:        ports@freebsd.org, emulation@freebsd.org
Subject:   Re: Building a Linuxulator userland from source
Message-ID:  <i3kr2kukjwgw2xvjlzgshwe72bjpnln4lvl7prhk77nelzidm6@2g56zi3ku7ec>
In-Reply-To: <xcztahm3vu3bjghjqqxuoy2xabyjmyfq22jw6mkaaaqo7wa36s@fdq7dlvpuhlk>
References:  <xcztahm3vu3bjghjqqxuoy2xabyjmyfq22jw6mkaaaqo7wa36s@fdq7dlvpuhlk>

next in thread | previous in thread | raw e-mail | index | archive | help

--tbpcagcbr4fpg652
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Felix Palmen <zirias@freebsd.org> [20230818 08:23]:
> I just reached a state where I can build a working Linux-native GNU
> toolchain (binutils, glibc, gcc) for C and C++ on aarch64, amd64 and
> i386. From here on, it should be simpler, there are already two ports in
> my branch (archivers/linux-bzip2 and archivers/linux-xz) using that
> native toolchain for building.

Just a little update on this, I *did* start building some "base"
userland now. What seems to work so far is GNU bash and coreutils,
including quite some libs used (gmp, acl, attr, libcap, openssl,
ncurses, readline).

I already had two metaports in my branch, linux_base-dirs (which will
just create and own the absolute minimum directory structure in
${LINUXBASE}) and linux-toolchain (which pulls in everything needed to
compile C and C++).

Now, I added a third metaport: "linux_base". This is incomplete of
course, it's where I want to collect all the bits and pieces for a
"base" Linuxulator userland as RUN_DEPENDS.

If anyone would like to already do some testing at this stage, please be
aware that I not only rebase my feature branch, but also rewrite it
while rebasing (to fix issues I encounter), and of course there won't be
any PORTREVISION bumps. Therefore, the safest thing to do is to remove
all linux*.pkg files from your poudriere repositories before trying a
newer version of the branch. The lxcross*.pkg packages can probably be
kept, I don't expect having to fix anything there.

Finally, I managed to sort out at least one of the open issues:

> - Building the final linux-gcc ports, I get weird error messages
>   directly to poudriere's terminal (they do NOT appear in the build
>   log!) like this:
>     ELF interpreter /usr/lib/ld-linux.so.2 not found, error 2
>   I have no idea where this comes from, so far I couldn't identify any
>   negative effect though.

I still don't know how/why it happened, but I now did what most Linux
distributions seem to do nowadays ... add symlinks in linux_base-dirs:

| /bin -> usr/bin
| /sbin -> usr/sbin
| /lib -> usr/lib
| /lib64 -> usr/lib64

There's just some "convincing" needed for glibc to install *all* files
below /usr, but all other packages now seem to "just work". So I assume
it's the only sane approach packaging some GNU/Linux userland. It
certainly makes sure the program interpreter is now also found below
/usr.

Cheers, Felix

--=20
 Felix Palmen <zirias@FreeBSD.org>     {private}   felix@palmen-it.de
 -- ports committer --                     {web}  http://palmen-it.de
 {pgp public key}  http://palmen-it.de/pub.txt
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231

--tbpcagcbr4fpg652
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iNUEABYKAH0WIQRpNhPVW79IN7ISOsxUreAGmHnyMQUCZOHsdF8UgAAAAAAuAChp
c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0Njkz
NjEzRDU1QkJGNDgzN0IyMTIzQUNDNTRBREUwMDY5ODc5RjIzMQAKCRBUreAGmHny
MfqwAPwJ1TJ5nwTjX4f467kKF8c4XgxfY9mPcPCsAQyqBoNsJAD/XSC1LfiIPRdt
df1iLihUp5NdQ0FLBhqKBxujW0n4dgs=
=QQcc
-----END PGP SIGNATURE-----

--tbpcagcbr4fpg652--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?i3kr2kukjwgw2xvjlzgshwe72bjpnln4lvl7prhk77nelzidm6>