musl/arch/i386/bits
Rich Felker 5bd0ab8af6 work around nasty gcc bug in the i386 syscall asm
when the "r" (register) constraint is used to let gcc choose a
register, gcc will sometimes assign the same register that was used
for one of the other fixed-register operands, if it knows the values
are the same. one common case is multiple zero arguments to a syscall.
this horribly breaks the intended usage, which is swapping the GOT
pointer from ebx into the temp register and back to perform the
syscall.

presumably there is a way to fix this with advanced usage of register
constaints on the inline asm, but having bad memories about hellish
compatibility issues with different gcc versions, for the time being
i'm just going to hard-code specific registers to be used. this may
hurt the compiler's ability to optimize, but it will fix serious
miscompilation issues.

so far the only function i know what compiled incorrectly is
getrlimit.c, and naturally the bug only applies to shared (PIC)
builds, but it may be more extensive and may have gone undetected..
2012-04-04 00:37:33 -04:00
..
alltypes.h.sh add float_t and double_t to math.h 2012-02-15 21:47:55 -05:00
endian.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
errno.h fix missing ENOTSUP error code 2011-03-11 09:50:54 -05:00
fcntl.h fix O_SYNC definition, cleanup fcntl.h 2011-04-14 22:06:30 -04:00
fenv.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
float.h fix DECIMAL_DIG definitions 2012-03-21 12:42:48 -04:00
ioctl.h cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
ipc.h numerous fixes to sysv ipc 2011-04-13 16:45:43 -04:00
limits.h move all limits that don't vary out of bits/limits.h, into main limits.h 2011-06-25 15:38:00 -04:00
mman.h namespace fixes for sys/mman.h 2011-04-20 15:55:58 -04:00
msg.h numerous fixes to sysv ipc 2011-04-13 16:45:43 -04:00
posix.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
reg.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
setjmp.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
shm.h numerous fixes to sysv ipc 2011-04-13 16:45:43 -04:00
signal.h cleanup redundancy in bits/signal.h versions 2011-09-19 20:02:12 -04:00
socket.h cleanup more bits cruft (sysmacros and socket) 2011-09-18 16:34:13 -04:00
stat.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
statfs.h fix the definition of struct statvfs to match lsb abi 2011-09-19 23:35:48 -04:00
stdarg.h split off arch-specific stdarg.h stuff 2011-02-15 05:06:15 -05:00
stdint.h preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00
syscall.h work around nasty gcc bug in the i386 syscall asm 2012-04-04 00:37:33 -04:00
termios.h various legacy and linux-specific stuff 2011-03-18 21:52:26 -04:00
user.h cleanup/debloat i386 user.h 2011-09-22 15:35:57 -04:00
wchar.h fix the type of wchar_t on arm; support wchar_t varying with arch 2011-09-19 17:39:51 -04:00