Hi, I'm trying to compile the r17057 on FreeBSD x86_64 and I'm getting this error:
fpc/rtl/units/x86_64-freebsd/cpu.s:40: Error: no such instruction: `cmpxchg16b (%r8)
Any hint?

Mailing lists / fpc-devel / 2011-02
15 messages · 6 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi, I'm trying to compile the r17057 on FreeBSD x86_64 and I'm getting this error:
fpc/rtl/units/x86_64-freebsd/cpu.s:40: Error: no such instruction: `cmpxchg16b (%r8)
Any hint?
Hi, I'm trying to compile the r17057 on FreeBSD x86_64 and I'm getting this error:
fpc/rtl/units/x86_64-freebsd/cpu.s:40: Error: no such instruction: `cmpxchg16b (%r8)
Any hint?
It seems you should upgrade your assembler/binutils? (No idea how to to do that on BSD).
In our previous episode, Alexander Klenin said:
Binutils 2.15 is the lastest binutils under GPLv2. FreeBSD does not accept GPLv3 code into the base system afaik.
It will have to be ifdefed or written out with db.
Can sb with a x86_64 linux objdump the generated file and post the relevant fragment on the list? Thanks.
Marco van de Voort wroteBinutils 2.15 is the lastest binutils under GPLv2.
Binutils 2.17 was the last GPLv2 version of binutils, and it supports cmpxchg16b.
Jonas
In our previous episode, Jonas Maebe said:
> Binutils 2.15 is the lastest binutils under GPLv2. Binutils 2.17 was the last GPLv2 version of binutils, and it supports cmpxchg16b.
Ok. Then I don't know why they are , I got that answer then (at the Fosdem LLVM talk), but didn't check it further. I'll ask around.
But anyway, 8.2 is days old, so migrating to 2.17 is for now not an option, and the "db" solution will have to be implemented anyway.
I upgraded to the latest binutils from /usr/ports/devel/binutils (it's ver 2.21), then compiled FPC 2.5.1, but I got the same error.
In our previous episode, Jonas Maebe said: Ok. Then I don't know why they are , I got…
FWIW, I had to do something similar in i386/mmx.pp (femms instruction) in the past due to AS version available for OS/2 at that time.
Tomas
In our previous episode, Tomas Hajny said:
Yes. But that is about way older binutils. OpenBSD had some too before 3.4 (when they were a.out)
I asked around, and FreeBSD 9 will migrate to 2.17.50 (+patches). But they usually don't change toolchains much within stable versions, and FreeBSD7 is supported till 2013, so FreeBSD8 even longer probably, so we will have to live with it. Luckily it is a freakish instruction with only one occurance. x86_64 is FreebSD8 plus (I have no idea how it fares on -7, it might be that it just works and that the porter did it)
I upgraded to the latest binutils from /usr/ports/devel/binutils (it's ver 2.21), then…
In our previous episode, Leonardo M. Ram? said:
I upgraded to the latest binutils from /usr/ports/devel/binutils (it's ver 2.21), then compiled FPC 2.5.1, but I got the same error.
I assume that means they are installed into local? Did you make sure they are actually used (e.g. by using -s) ?
If you do, and they are not, try passing -FD/usr/local/lib ?
Thanks for pointing that out, I was using 2.15, and in /usr/local I have 2.21.
Leonardo M. Ramé
http://leonardorame.blogspot.com
In our previous episode, Leonardo M. Ram? said:
Thanks for pointing that out, I was using 2.15, and in /usr/local I have 2.21.
If you can compile it now, please post the result of
objdump -d cpu.o (the InterlockedCompareExchange128 part).
Thanks. (this is also in fixes, and needs to be fixes asap because of 2.4.4)
I successfully compiled it with this command: gmake clean all OPT="-FD/usr/local/bin"
Here's the dump:
cpu.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <CPU_INTERLOCKEDCOMPAREEXCHANGE128SUPPORT$$BOOLEAN>: 0: 8a 04 25 00 00 00 00 mov 0x0,%al
7: c3 retq
0000000000000008 <CPU_INTERLOCKEDCOMPAREEXCHANGE128$INT128REC$INT128REC$INT128REC$$INT128REC>: 8: 55 push %rbp
9: 48 89 e5 mov %rsp,%rbp
c: 48 83 ec 10 sub $0x10,%rsp
10: 53 push %rbx
11: 51 push %rcx
12: 49 8b 18 mov (%r8),%rbx
15: 49 8b 48 08 mov 0x8(%r8),%rcx
19: 49 89 d0 mov %rdx,%r8
1c: 49 8b 01 mov (%r9),%rax
1f: 49 8b 51 08 mov 0x8(%r9),%rdx
23: f0 49 0f c7 08 rex64Z lock cmpxchg8b (%r8) 28: 59 pop %rcx
29: 48 89 01 mov %rax,(%rcx)
2c: 48 89 51 08 mov %rdx,0x8(%rcx)
30: 5b pop %rbx
31: c9 leaveq
32: c3 retq
33: 0f 1f (bad)
35: 44 00 00 add %r8b,(%rax)
Leonardo M. Ramé
http://leonardorame.blogspot.com
In our previous episode, Leonardo M. Ram? said:
Thanks, fixed.
In our previous episode, Tomas Hajny said: Yes. But that is about way older binutils.…
Good reason to fix the elf64 writer for FreeBSD :)?