This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Help! asm problems with 2.95 and 2.7.2
- To: "'help-gcc at gnu dot org'" <help-gcc at gnu dot org>
- Subject: Help! asm problems with 2.95 and 2.7.2
- From: Andrew Lees <andrewl at acay dot com dot au>
- Date: Sat, 31 Mar 2001 22:58:44 +1000
- Organization: Diamond Consulting Services
Hello,
I am trying to construct a cross compiler from intel-glibc2.1 to intel-libc5
for embedded system construction, with both host and target using 2.2.14
linux kernels. I have tried both gcc-2.95 and gcc-2.7.2. In both cases I
get errors when compiling the libc5 library, specifically compiling some
cases of syscall* for the *shared* library build only. The static library
compiles fine. I have confirmed that the compiler option causing the problem
is -fPIC. Optimisation options have no effect. The error messages with both
compiler versions is a variant of:
__adjtime.c: In function `adjtimex':
__adjtime.c:67: fixed or forbidden register was spilled.
This may be due to a compiler bug or to impossible asm
statements or clauses.
The code actually being compiled is:
inline static
int adjtimex ( struct timex * ntx ) { long __res; __asm__ __volatile
("int $0x80" : "=a" (__res) : "0" (124 ),"b" ((long)( ntx ))); do { if
((unsigned long)( __res ) >= (unsigned long)(-125)) { (*__errno_location ())
= -( __res ); __res = -1; } return ( int ) ( __res ); } while (0) ; } ;
The error occurs when the inline is used in the calling function.
The error message given above was from 2.7.2. 2.95.2 is specific that
register bx is the problem, yet it is not being used in an output context,
nor is it marked as clobbered in the asm macro. The asm macro used is that
from the 2.2.14 kernel rather than that originally provided with the libc5
tree - it seems safer to use the up-to-date syscall macros.
This occurs when using the first version of the cross (compiled with
glibc2.1).
I have read the FAQ re asm register problems, (hence the attempt with 2.7.2)
but that doesn't seem to apply directly to this problem.
The problem occurs even if the syscall1 macro is extracted from the code
where it is currently used and placed inside a trivial function with no other
register variables.
Any suggestions for a fix? It seems strange that gcc won't compile syscall
code.
Thanks for any help,
Andrew Lees.