[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] dietlibc port to ppc64el


Thanks for your response!

On 04/03/2016 10:53 PM, Breno Leitao wrote:
> On 04/03/2016 04:36 PM, Christian Seiler wrote:
>> May be built via gbp buildpackage. If needed, I can also provide a .dsc
>> file if necessary.
> I tried to built it on my ppc64el machine using:
>   $ git clone https://anonscm.debian.org/git/collab-maint/dietlibc.git -b ports/ppc64el
>   $ gbp buildpackage 
> and I got some errors, that I pasted at [1]. Is it expected?

Yes. On some platforms (mainly i386, I think?) there's limited support for
building a shared object. The errors you see are because the shared object
+ all the other stuff related to it isn't built in the Debian package
(mainly because it didn't quite work at some point in time and nobody
has bothered to restore it since) and can thus not be installed. This is
harmless, as the Makefile uses a - sign in front of the install commands
that would copy those - and the build doesn't fail.

> Other than that, I was able to get the deb built and the diet(1) binary
> installed and I want to test it directly. But it seems that the example
> is not being built due to conflict of types in strlen()[2]. Am I doing
> something wrong?

I never checked in examples/ (never realized that directory existed), that
doesn't compile at all - same error on any platform. ;-)

> Is there another way to test it?

Well, you can just compile any number of standard programs (that don't
require external libraries) with it. Just use diet in front of gcc, e.g.

diet gcc -Wall -o hello hello.c

with hello.c being something like:

#include <stdio.h>
int main()
  puts("Hello world\n");
  return 0;

If you want to try a real world use cases, you could try building mksh
from sid with dietlibc-dev installed (you will need to update the
Build-Depends in debian/control and add ppc64el to the list if you use
an autobuilder). Then you could try running the statically linked mksh
variant (/bin/mksh-static in the package) and doing a few things in
the shell...

Warning: mksh will try to link mksh-static against something else if
dietlibc fails, so check the build logs. (There's a summary at the

You could also try to compile my package tiny-initramfs from sid with
dietlibc, but please read the docs carefully before you test it - or
only test it in a VM.

Or, you could manually compile something without external deps such as
pwgen. (apt-get source pwgen; cd pwgen-*; ./configure CC="diet gcc";
make; ./pwgen to test it.)

If there are errors compiling stuff, note that many things don't
compile with dietlibc even on amd64, for a variety of reasons that I'm
not going to get into right now. The examples I gave do compile on
amd64 and others, so if they don't work on ppc64el, that's a bug
specific to porting the library. I expect that most stuff from various
C tutorials should work with dietlibc.

Also, don't try -fPIE on anything but amd64 at the moment, that's still
extremely experimental even there. OTOH, -fstack-protector[-strong]
should work and binaries built with it should not crash.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: