mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 18:57:11 +01:00
* fix for older GAS assemblers that don't parse (rex64Z) "lock cmpxchg8b (%r8)" properly, as used on FreeBSD7 and up till 8.2.
git-svn-id: trunk@17060 -
This commit is contained in:
parent
5d906a8f1d
commit
f0fee289c9
@ -18,6 +18,13 @@ unit cpu;
|
||||
|
||||
interface
|
||||
|
||||
{$ifdef freebsd} // FreeBSD 7/8 have binutils version that don't support cmpxchg16b
|
||||
// Unless overridebinutils is defined (for ports usage), use db instead of the instruction
|
||||
{$ifndef overridebinutils}
|
||||
{$define oldbinutils}
|
||||
{$endif}
|
||||
{$endif}
|
||||
|
||||
uses
|
||||
sysutils;
|
||||
|
||||
@ -60,8 +67,11 @@ unit cpu;
|
||||
movq (%r9),%rax
|
||||
movq 8(%r9),%rdx
|
||||
|
||||
{$ifdef oldbinutils}
|
||||
.byte 0xF0,0x49,0x0F,0xC7,0x08
|
||||
{$else}
|
||||
lock cmpxchg16b (%r8)
|
||||
|
||||
{$endif}
|
||||
{ restore result pointer }
|
||||
popq %rcx
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user