Discussion:
Notes on trying to compile pcc on Solaris 11/i386 with Sun Studio...
Roland Mainz
2012-08-10 20:29:32 UTC
Permalink
I did a quick&&dirty attempt to build pcc-20120810 with Sun Studio
12.1 on Solaris 11/AMD64 (attached as "build_pcc.sh.txt" and
"buildlog.log.txt" is the hacked build script and build log from that
1. A small patch is needed since there is no /usr/lib/ld.so, so far
Solaris 11 only has /usr/lib/ld.so.1 ... the patch is embedded in the
"build_pcc.sh.txt" script
2. The pcc/pcc-libs makefiles seem to require GNU make (e.g. I get
extra build failures if I don't use gmake) ... is that intended ?
-- snip --
/home/test001/pcc/bin/suncc99 -O -I. -DTARGET_LITTLE_ENDIAN=1
-Dos_sunos -isystem ../libpcc/include -c _alloca.c
cc: Warning: option -y passed to ld
"_alloca.c", line 40: asm statement illegal outside function
cc: acomp failed for _alloca.c
gmake[1]: *** [_alloca.o] Error 2
gmake[1]: Leaving directory `/home/test001/pcc/pcc-libs-20120810/libpcc'
gmake: *** [all] Error 2
-- snip --
Based on the header comments... is that file really used for Unix-like systems ?
-- snip --
"../../arch/i386/macdefs.h", line 169: warning: macro redefined: EAX
"../../arch/i386/macdefs.h", line 170: warning: macro redefined: EDX
"../../arch/i386/macdefs.h", line 171: warning: macro redefined: ECX
"../../arch/i386/macdefs.h", line 172: warning: macro redefined: EBX
"../../arch/i386/macdefs.h", line 173: warning: macro redefined: ESI
"../../arch/i386/macdefs.h", line 174: warning: macro redefined: EDI
"../../arch/i386/macdefs.h", line 175: warning: macro redefined: EBP
"../../arch/i386/macdefs.h", line 176: warning: macro redefined: ESP
-- snip --
This is an issue with the Solaris 11 headers, i.e.
/usr/include/sys/regset.h which defines these symbols for it's own
usage.
Not an critical error... best guess is to trample these with |#undef
EAX| etc. (unlikely that Oracle will fix this... I've lost hope on
that... ;-( )
5. There are _lots_ of warnings related to "warning: initializer does
not fit or is out of range" in buildlog.log ... please check whether
these are real errors. Based on my experience these are usually
sources of nasty and hard-to-find bugs
I forgot one issue:
I worked-around the issue with "_alloca.c" by replacing it with an
empty file... the pcc-libs build then succeeds...
... but pcc is still unable to compile the "hello world" application:
-- snip --
+ cat
+ 1> x.c 0<< \EOF
#include <stdlib.h>
#include <stdio.h>

int main(int ac, char *av[])
{
puts("hello world chicken");
return EXIT_SUCCESS;
}
EOF
+ pcc x.c -o ./x
ld: fatal: entry point symbol '__start' is undefined
ld terminated with status 1
-- snip --

... any idea what causes this issue ?

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) ***@nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
ольга крыжановская
2012-08-11 16:04:53 UTC
Permalink
Where is the first mail with the "buildlog.log.txt" and "build_pcc.sh.txt"?

Olga
Post by Roland Mainz
I did a quick&&dirty attempt to build pcc-20120810 with Sun Studio
12.1 on Solaris 11/AMD64 (attached as "build_pcc.sh.txt" and
"buildlog.log.txt" is the hacked build script and build log from that
1. A small patch is needed since there is no /usr/lib/ld.so, so far
Solaris 11 only has /usr/lib/ld.so.1 ... the patch is embedded in the
"build_pcc.sh.txt" script
2. The pcc/pcc-libs makefiles seem to require GNU make (e.g. I get
extra build failures if I don't use gmake) ... is that intended ?
-- snip --
/home/test001/pcc/bin/suncc99 -O -I. -DTARGET_LITTLE_ENDIAN=1
-Dos_sunos -isystem ../libpcc/include -c _alloca.c
cc: Warning: option -y passed to ld
"_alloca.c", line 40: asm statement illegal outside function
cc: acomp failed for _alloca.c
gmake[1]: *** [_alloca.o] Error 2
gmake[1]: Leaving directory `/home/test001/pcc/pcc-libs-20120810/libpcc'
gmake: *** [all] Error 2
-- snip --
Based on the header comments... is that file really used for Unix-like systems ?
-- snip --
"../../arch/i386/macdefs.h", line 169: warning: macro redefined: EAX
"../../arch/i386/macdefs.h", line 170: warning: macro redefined: EDX
"../../arch/i386/macdefs.h", line 171: warning: macro redefined: ECX
"../../arch/i386/macdefs.h", line 172: warning: macro redefined: EBX
"../../arch/i386/macdefs.h", line 173: warning: macro redefined: ESI
"../../arch/i386/macdefs.h", line 174: warning: macro redefined: EDI
"../../arch/i386/macdefs.h", line 175: warning: macro redefined: EBP
"../../arch/i386/macdefs.h", line 176: warning: macro redefined: ESP
-- snip --
This is an issue with the Solaris 11 headers, i.e.
/usr/include/sys/regset.h which defines these symbols for it's own
usage.
Not an critical error... best guess is to trample these with |#undef
EAX| etc. (unlikely that Oracle will fix this... I've lost hope on
that... ;-( )
5. There are _lots_ of warnings related to "warning: initializer does
not fit or is out of range" in buildlog.log ... please check whether
these are real errors. Based on my experience these are usually
sources of nasty and hard-to-find bugs
I worked-around the issue with "_alloca.c" by replacing it with an
empty file... the pcc-libs build then succeeds...
-- snip --
+ cat
+ 1> x.c 0<< \EOF
#include <stdlib.h>
#include <stdio.h>
int main(int ac, char *av[])
{
puts("hello world chicken");
return EXIT_SUCCESS;
}
EOF
+ pcc x.c -o ./x
ld: fatal: entry point symbol '__start' is undefined
ld terminated with status 1
-- snip --
... any idea what causes this issue ?
----
Bye,
Roland
--
__ . . __
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
--
, _ _ ,
{ \/`o;====- Olga Kryzhanovska -====;o`\/ }
.----'-/`-/ ***@gmail.com \-`\-'----.
`'-..-| / http://twitter.com/fleyta \ |-..-'`
/\/\ Solaris/BSD//C/C++ programmer /\/\
`--` `--`
Anders Magnusson
2012-08-15 19:45:21 UTC
Permalink
Hi,
Hi!
----
I did a quick&&dirty attempt to build pcc-20120810 with Sun Studio
12.1 on Solaris 11/AMD64 (attached as "build_pcc.sh.txt" and
"buildlog.log.txt" is the hacked build script and build log from that
1. A small patch is needed since there is no /usr/lib/ld.so, so far
Solaris 11 only has /usr/lib/ld.so.1 ... the patch is embedded in the
"build_pcc.sh.txt" script
The linker and its location seems to be different on the various
versions of Solaris.
Due to the manpage /usr/lib/ld.so is used for a.out (SunOS4?), and
ld.so.1 for elf.
The 64-bit loader is supposed to be in /usr/lib/64/ on Sparc, is the
same true for amd64?
2. The pcc/pcc-libs makefiles seem to require GNU make (e.g. I get
extra build failures if I don't use gmake) ... is that intended ?
No, the makefiles should be for any make. Which error did you get?
-- snip --
/home/test001/pcc/bin/suncc99 -O -I. -DTARGET_LITTLE_ENDIAN=1
-Dos_sunos -isystem ../libpcc/include -c _alloca.c
cc: Warning: option -y passed to ld
"_alloca.c", line 40: asm statement illegal outside function
cc: acomp failed for _alloca.c
gmake[1]: *** [_alloca.o] Error 2
gmake[1]: Leaving directory `/home/test001/pcc/pcc-libs-20120810/libpcc'
gmake: *** [all] Error 2
-- snip --
Based on the header comments... is that file really used for Unix-like systems ?
Alloca exists ~everywhere and is a quite useful function, but pcc should not
emit calls to alloca anymore, so I think that file can be removed. I'll
check that.
-- snip --
"../../arch/i386/macdefs.h", line 169: warning: macro redefined: EAX
"../../arch/i386/macdefs.h", line 170: warning: macro redefined: EDX
"../../arch/i386/macdefs.h", line 171: warning: macro redefined: ECX
"../../arch/i386/macdefs.h", line 172: warning: macro redefined: EBX
"../../arch/i386/macdefs.h", line 173: warning: macro redefined: ESI
"../../arch/i386/macdefs.h", line 174: warning: macro redefined: EDI
"../../arch/i386/macdefs.h", line 175: warning: macro redefined: EBP
"../../arch/i386/macdefs.h", line 176: warning: macro redefined: ESP
-- snip --
This is an issue with the Solaris 11 headers, i.e.
/usr/include/sys/regset.h which defines these symbols for it's own
usage.
Not an critical error... best guess is to trample these with |#undef
EAX| etc. (unlikely that Oracle will fix this... I've lost hope on
that... ;-( )
Hm. Yes, undef would do it for now.
5. There are _lots_ of warnings related to "warning: initializer does
not fit or is out of range" in buildlog.log ... please check whether
these are real errors. Based on my experience these are usually
sources of nasty and hard-to-find bugs
Will check, thanks.

-- Ragge

Loading...