Discussion:
Building pcc on OpenBSD/powerpc
Reinhold Straub
2011-07-08 13:07:38 UTC
Permalink
PCC can't be built with gcc on OpenBSD/powerpc:

./configure
First make:
********************************************************
../../arch/powerpc/local.c: In function 'clocal':
../../arch/powerpc/local.c:449: error: 'btattr' undeclared (first use in this function)
../../arch/powerpc/local.c:449: error: (Each undeclared identifier is reported only once
../../arch/powerpc/local.c:449: error: for each function it appears in.)
../../arch/powerpc/local.c: At top level:
../../arch/powerpc/local.c:839: error: 'inval' redeclared as different kind of symbol
./pass1.h:310: error: previous declaration of 'inval' was here
*** Error code 1

Stop in /home/hyazinth/pcc/cc/ccom (line 119 of Makefile).
********************************************************

So let's delete inval (powerpc/local.c:839) and replace
line 449 btattr[p->n_type].atypsz == btattr[l->n_type].atypsz) {
by
tsize(p->n_type, p->n_df, p->n_ap) ==
tsize(l->n_type, l->n_df, l->n_ap)) {

(Probably this should be done in /mips/local.c as well.)


Second make:
********************************************************
../../arch/powerpc/local.c: In function 'zbits':
../../arch/powerpc/local.c:872: error: lvalue required as left operand of assignment
../../arch/powerpc/local.c:874: error: invalid operands to binary <<
../../arch/powerpc/local.c:876: error: lvalue required as left operand of assignment
../../arch/powerpc/local.c:885: error: lvalue required as left operand of assignment
../../arch/powerpc/local.c: In function 'infld':
../../arch/powerpc/local.c:918: error: lvalue required as left operand of assignment
../../arch/powerpc/local.c:919: error: lvalue required as left operand of assignment
../../arch/powerpc/local.c:922: error: invalid operands to binary >>
*** Error code 1

Stop in /home/hyazinth/pcc/cc/ccom (line 119 of Makefile).
********************************************************

Since functions 'zbits' and 'infld' are defined in ccom/init.c, let's delete those and 'static int inbits', too.

(Probably this should be done in pdp10/local.c as well.)


Third make:
*******************************************************
symtabs.o(.sdata+0x0): In function `defalign':
./symtabs.c:422: multiple definition of `lastloc'
code.o(.sdata+0x0):../../arch/powerpc/code.c:559: first defined here
symtabs.o(.text+0x19c): In function `locctr':
./symtabs.c:379: undefined reference to `setseg'
symtabs.o(.text+0x1fc):./symtabs.c:377: undefined reference to `setseg'
symtabs.o(.text+0x27c):./symtabs.c:398: undefined reference to `setseg'
*** Error code 1

Stop in /home/hyazinth/pcc/cc/ccom (line 168 of Makefile).
*******************************************************

Now delete line 42 'int lastloc' in powerpc/code.c

The function 'setseg' is missing here. Tentatively, I copied setseg from i386/code.c to powerpc/code.c lastloc

Now PCC builds!

pcc -v
pcc 1.1.0.DEVEL 20110708 for powerpc-unknown-openbsd4.9


(Possibly the function defalign should be declared in powerpc/code.c)


Regards,
Reinhold Straub


--

Loading...