bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asyncsafe-spin.c fails to compile on Solaris 10 sparc


From: Paul Eggert
Subject: asyncsafe-spin.c fails to compile on Solaris 10 sparc
Date: Sun, 15 Nov 2020 20:08:37 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I attempted to reproduce Tom Christensen's first problem listed here:

https://lists.gnu.org/r/bug-gnulib/2020-11/msg00062.html

on Solaris 10 sparc, by running this:

./gnulib-tool --create-testdir --dir foo getumask

and then on Solaris:

./configure
make
make check

This failed as follows:

depbase=`echo asyncsafe-spin.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -D_REENTRANT -g -O2 -MT asyncsafe-spin.o -MD -MP -MF $depbase.Tpo -c -o asyncsafe-spin.o asyncsafe-spin.c &&\
mv -f $depbase.Tpo $depbase.Po
/usr/ccs/bin/as: "/tmp/ccK0uCIY.s", line 19: error: cannot use v8plus instructions in a non-v8plus target binary /usr/ccs/bin/as: "/tmp/ccK0uCIY.s", line 39: error: cannot use v8plus instructions in a non-v8plus target binary

These diagnostics come from these instructions:

         cas [%o0],%o1,%o2
         ...
         membar 2

which come from asm directives in lib/asyncsafe-spin.c. These instructions are not portable to SPARC v8 processors (32-bit only); they assume SPARC v8+ or SPARC v9.

I worked around the problem by configuring this way:

./configure CC='gcc -mcpu=v9 -m32'

to compile for SPARC v9, which is fine for my hardware (a production Sun Fire 280R with an UltraSPARC III). I doubt whether anybody outside of computer museums cares about SPARC v8 hardware any more, but it would be nice if 'configure; make' just worked on Solaris 10 sparc so perhaps the asyncsafe-spin module should add the '-mcpu=v9 -m32' options on this platform, or maybe asyncsafe-spin.c could simply omit the relevant instructions on 32-bit sparc platforms.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]