Discussion:
pcc-libs on sparc64/freebsd
Kurt Lidl
2012-06-26 06:24:50 UTC
Permalink
To configure the library, I needed the following diff:

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -39,4 +39,5 @@ case "$target_os" in
case "$target_cpu" in
i386) targmach=i386 ;;
+ sparc64) targmach=sparc64 endian=big ;;
x86_64) targmach=amd64 ;;
esac

However, pcc bombs out on the first file:

***@spork-168: make
===> libsoftfloat
pcc -O -DSOFTFLOAT_FOR_GCC -I. -I./arch/sparc64 -isystem ../libpcc/include -O2 -pipe -c bits64/softfloat.c
bits64/softfloat-macros, line 571: compiler error: Cannot generate code, node 0x40850000 op TEMP
*** Error code 1

-Kurt
Kurt Lidl
2012-06-26 06:59:25 UTC
Permalink
Post by Kurt Lidl
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -39,4 +39,5 @@ case "$target_os" in
case "$target_cpu" in
i386) targmach=i386 ;;
+ sparc64) targmach=sparc64 endian=big ;;
x86_64) targmach=amd64 ;;
esac
===> libsoftfloat
pcc -O -DSOFTFLOAT_FOR_GCC -I. -I./arch/sparc64 -isystem ../libpcc/include -O2 -pipe -c bits64/softfloat.c
bits64/softfloat-macros, line 571: compiler error: Cannot generate code, node 0x40850000 op TEMP
*** Error code 1
Digging some more, I find that if I configure with 'CC=gcc', it dies
like this:

***@spork-250: make
===> libsoftfloat
gcc -O -DSOFTFLOAT_FOR_GCC -I. -I./arch/sparc64 -isystem ../libpcc/include -O2 -pipe -c bits64/softfloat.c
In file included from bits64/softfloat.c:96:
./softfloat-specialize:111: error: static declaration of 'float32_is_signaling_nan' follows non-static declaration
./arch/sparc64/softfloat.h:177: error: previous declaration of 'float32_is_signaling_nan' was here
./softfloat-specialize:211: error: static declaration of 'float64_is_signaling_nan' follows non-static declaration
./arch/sparc64/softfloat.h:215: error: previous declaration of 'float64_is_signaling_nan' was here
*** Error code 1

Stop in /homes/elves/lidl/pcc/pcc-libs/libsoftfloat.
*** Error code 1

Stop in /homes/elves/lidl/pcc/pcc-libs.

So, looking around a bit, it looks like the define that needs to be
passed for compiling on sparc64 machines is "-DSOFTFLOATSPARC64_FOR_GCC"
and not "-DSOFTFLOAT_FOR_GCC". Anyhow, if I just manually change the
define in libsoftfloat/Makefile.in that way, and then reconfigure
with 'CC=gcc', it successfully builds the libraries (using gcc).

If I attempt to build with pcc and -DSOFTFLOATSPARC64_FOR_GCC,
the compiler dies in the same way as I originally reported:

***@spork-259: make
===> libsoftfloat
pcc -O -DSOFTFLOATSPARC64_FOR_GCC -I. -I./arch/sparc64 -isystem ../libpcc/include -O2 -pipe -c bits64/softfloat.c
bits64/softfloat-macros, line 571: compiler error: Cannot generate code, node 0x408500f0 op TEMP
*** Error code 1

There's not an obvious architecture specific way of setting flags in
the Makefile.in. Any suggestions here?

-Kurt
Iain Hibbert
2012-06-26 18:06:05 UTC
Permalink
Post by Kurt Lidl
So, looking around a bit, it looks like the define that needs to be
passed for compiling on sparc64 machines is "-DSOFTFLOATSPARC64_FOR_GCC"
and not "-DSOFTFLOAT_FOR_GCC". Anyhow, if I just manually change the
define in libsoftfloat/Makefile.in that way, and then reconfigure
with 'CC=gcc', it successfully builds the libraries (using gcc).
If I attempt to build with pcc and -DSOFTFLOATSPARC64_FOR_GCC,
===> libsoftfloat
pcc -O -DSOFTFLOATSPARC64_FOR_GCC -I. -I./arch/sparc64 -isystem ../libpcc/include -O2 -pipe -c bits64/softfloat.c
bits64/softfloat-macros, line 571: compiler error: Cannot generate code, node 0x408500f0 op TEMP
*** Error code 1
There's not an obvious architecture specific way of setting flags in
the Makefile.in. Any suggestions here?
probably the configure script should add it to CPPFLAGS according to the
compiler (is it needed for !gcc ?) and architecture, rather than having it
hardcoded in the Makefile.in, but I don't know anything about the
softfloat code or if it is actually needed (SPARC64 does have a FPU
according to wikipedia?)

regards,
iain

Loading...