Discussion:
tried to compile uClibc, then dietlibc
LHB Jr
2011-10-24 20:01:57 UTC
Permalink
HI
Enjoying pcc, I tried to compile uClibc, but ran into problem after
problem. Evidently, uClibc was written by the makefile master of the
universe and the build code was inscrutable, , so I tried my hand at
dietlibc. This attemp was met with some success. The static build, I
got to work, had to strip out all lot of directives, but it did seem
to compile and link. Now I'm trying to compile and link it as a shared
library, what are the PCC equivalent to -fPIC and -shared ? After
objdump, they seem to work like gcc, but I want to make sure my
options are right for pcc.

LHB
Thorsten Glaser
2011-10-24 20:29:57 UTC
Permalink
Post by LHB Jr
universe and the build code was inscrutable, , so I tried my hand at
dietlibc. This attemp was met with some success. The static build, I
Fefe says you must compile dietlibc itself with gcc, but can then
use it with any other compiler.
Post by LHB Jr
to compile and link. Now I'm trying to compile and link it as a shared
library, what are the PCC equivalent to -fPIC and -shared ? After
Shared dietlibc is broken anyway. Don’t bother.
It’s also not used by the maintainer.

bye,
//mirabilos
--
Yay for having to rewrite other people's Bash scripts because bash
suddenly stopped supporting the bash extensions they make use of
-- Tonnerre Lombard in #nosec
Szabolcs Nagy
2011-10-24 20:58:22 UTC
Permalink
Post by LHB Jr
Enjoying pcc, I tried to compile uClibc, but ran into problem after
problem. Evidently, uClibc was written by the makefile master of the
universe and the build code was inscrutable, , so I tried my hand at
dietlibc. This attemp was met with some success. The static build, I
got to work, had to strip out all lot of directives, but it did seem
to compile and link. Now I'm trying to compile and link it as a shared
if you try to build a libc for linux then i had success with musl
i could compile musl with pcc easily

http://www.etalabs.net/musl/

(iirc the only modification i made is s/-lgcc/-lpcc/ in the rule
that builds the shared libc.so

some tweaks may be needed if you build old bsd code with pcc+musl
(eg it only defines quad_t and a few other non-posix bsd things
if _GNU_SOURCE is defined, you can either fix that in musl headers
or in the bsd src code)

oh and pcc does not provide alloca so you have to
CFLAGS+=-Dalloca=__builtin_alloca
when you build something with alloca in it)
Post by LHB Jr
library, what are the PCC equivalent to -fPIC and -shared ? After
objdump, they seem to work like gcc, but I want to make sure my
options are right for pcc.
i was able to use pcc to compile musl libc.so and use it in a sandbox

i stopped playing with it after finding various pcc code generation
issues (some of them are fixed now, but last time i still could not
compile openssl with pcc so that all tests pass)
LHB Jr
2011-10-24 21:15:12 UTC
Permalink
I never heard of musl. I just gitted it. Thanks for the tip.

As for the shared on dietlibc, I see that it isn't too organized, so
maybe I'll play with mus which looks like it's got it's act straight.

What about the inline assembly, is that going to cause problems? I
was wondering about that last night.

-----Original Message-----
From: Szabolcs Nagy <***@port70.net>
To: LHB Jr <***@aol.com>
Cc: pcc-list <pcc-***@ludd.ltu.se>
Sent: Mon, Oct 24, 2011 4:58 pm
Subject: Re: tried to compile uClibc, then dietlibc
Post by LHB Jr
Enjoying pcc, I tried to compile uClibc, but ran into problem after
problem. Evidently, uClibc was written by the makefile master of the
universe and the build code was inscrutable, , so I tried my hand at
dietlibc. This attemp was met with some success. The static build, I
got to work, had to strip out all lot of directives, but it did seem
to compile and link. Now I'm trying to compile and link it as a shared
if you try to build a libc for linux then i had success with musl
i could compile musl with pcc easily

http://www.etalabs.net/musl/

(iirc the only modification i made is s/-lgcc/-lpcc/ in the rule
that builds the shared libc.so

some tweaks may be needed if you build old bsd code with pcc+musl
(eg it only defines quad_t and a few other non-posix bsd things
if _GNU_SOURCE is defined, you can either fix that in musl headers
or in the bsd src code)

oh and pcc does not provide alloca so you have to
CFLAGS+=-Dalloca=__builtin_alloca
when you build something with alloca in it)
Post by LHB Jr
library, what are the PCC equivalent to -fPIC and -shared ? After
objdump, they seem to work like gcc, but I want to make sure my
options are right for pcc.
i was able to use pcc to compile musl libc.so and use it in a sandbox

i stopped playing with it after finding various pcc code generation
issues (some of them are fixed now, but last time i still could not
compile openssl with pcc so that all tests pass)
Szabolcs Nagy
2011-10-24 22:15:41 UTC
Permalink
Post by LHB Jr
I never heard of musl. I just gitted it. Thanks for the tip.
As for the shared on dietlibc, I see that it isn't too organized,
so maybe I'll play with mus which looks like it's got it's act
straight.
What about the inline assembly, is that going to cause problems? I
was wondering about that last night.
pcc understands gcc style inline asm

(many gcc extensions work with pcc
a notable exception is "({ expr; })"
statement expressions)

Loading...