Discussion:
Pcc on arm linux
marco caminati
2012-11-26 00:13:44 UTC
Permalink
Hello!

I can easily build musl libc on a Linux x86 machine only having busybox, pcc, as and ar installed. 

It would be wonderful being able to do the same on a Linux arm-v6 system.


Any hope? How much work would it be needed to achieve that?


Thanks

PS:

This way, e.g., I could bootstrap a nimble toolchain on a minimal Core
Linux environment, which has recently been ported on overwhelmingly
widespread allwinner-based devices:

http://forum.tinycorelinux.net/index.php/topic,13827.0.html 
Anders Magnusson
2012-11-26 07:40:11 UTC
Permalink
Good morning,

the ARM target is not heavily tested, and I think it needs a little more
work to be useful.

I haven't tried it myself for quite some time so I cannot say anything
about recent state,
but I assume it won't be much work to make it really usable.

-- Ragge
Post by marco caminati
Hello!
I can easily build musl libc on a Linux x86 machine only having busybox, pcc, as and ar installed.
It would be wonderful being able to do the same on a Linux arm-v6 system.
Any hope? How much work would it be needed to achieve that?
Thanks
This way, e.g., I could bootstrap a nimble toolchain on a minimal Core
Linux environment, which has recently been ported on overwhelmingly
http://forum.tinycorelinux.net/index.php/topic,13827.0.html
marco caminati
2012-12-15 12:48:45 UTC
Permalink
----- Messaggio originale -----

Da: Anders Magnusson <***@ludd.ltu.se>
A: marco caminati <***@yahoo.it>
Cc: "pcc-***@ludd.ltu.se" <pcc-***@ludd.ltu.se>
Inviato: Lunedì 26 Novembre 2012 7:40
Oggetto: Re: Pcc on arm linux
Post by Anders Magnusson
Good morning,
the ARM target is not heavily tested, and I think it needs a little more
work to be useful.
I haven't tried it myself for quite some time so I cannot say anything
about recent state,
but I assume it won't be much work to make it really usable.
-- Ragge
Thanks for your answer.
Yes, at least the three builtin_xxx functions are missing, as in mips.
Using stubs, I can build a usesless :) pcc.
Is there any documentation about how to implement those?

Alternatively, I managed to native build on arm linux various old pcc sources: all have problems when
used to build musl:

090731: no support for inline assembly

20120326: /tmp/ctm.CsLXca: Assembler messages:
/tmp/ctm.CsLXca:3: Error: bad expression
/tmp/ctm.CsLXca:3: Error: junk at end of line, first unrecognized character is `0'

20120701: src/aio/aio_readwrite.c, line 63: compiler error: 0x651a80) op 75 slipped through

Maybe I could find a version after 090731 with assembly support and try: any suggestion?

Thanks
Isaac Dunham
2012-12-16 21:14:46 UTC
Permalink
On Sun, 16 Dec 2012 20:11:30 +0000 (GMT)
Hmm...
Do you mean that 20120701 can be built for ARM/linux, but can't compile musl on arm?
Yes.
I'm pretty sure that it could build musl on x86, though I don't think I tried that exact commit.
Be aware that with any pcc short of current, you will need to at least
-apply the cpp #pragma patch, or patch musl to remove all #pragmas following whitespace.
According to error messages, that is not the problem.
Yes, but it will be an issue if you get far enough.
(FYI, the commit/patch that fixed this is revision 1.105 of
pcc/cc/cpp/token.c, committed November 29)
-if you want libc.so, modify the Makefile/config.mak to add
-D__PIC__ (I think!) to the options
for building shared objects.
I am trying first the easy case: only static libraries. I will try enabling dynamic libraries and applying your patch.
You sound more knowledgeable than me in this stuff: have you tried yourself compiling pcc and then musl?
I've used pcc to compile musl, but only on x86.
I suspect there's a backend issue that you found, since the line indicated on the last error is just "return 0;"

Has anyone tried FreeBSD/arm (I think that's the only ARM port supported right now) recently?
I'm interested in pcc on arm/linux too, for the sake of a self-hosting  chroot on my phone.
Yes, having a pcc being able to compile musl would be VERY nice.
BTW, how come you sent this your answer in private? Maybe the list could have something useful to say...
Regards,
Marco
Oops. I just hit "Reply"...
--
Isaac Dunham <***@lavabit.com>
Loading...