Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-02

Error compiling trunk on FreeBSD

15 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

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?

Reply by email

Leonardo M. Ramé

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?

Reply by email

Alexander Klenin
to Leonardo M. Ramé
Leonardo M. Ramé wrote 5 lines
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).

Alexander S. Klenin

Reply by email

Marco van de Voort
to Alexander Klenin

In our previous episode, Alexander Klenin said:

Show quoted text 8 lines
On Tue, Mar 1, 2011 at 03:07, Leonardo M. Ram? wrote: > 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?

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.

Reply by email

Marco van de Voort
to Jonas Maebe

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.

Reply by email

Leonardo M. Ramé
to Marco van de Voort
Show quoted text 16 lines
From: Marco van de Voort > > 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.

Reply by email

Tomas Hajny
to Marco van de Voort: In our previous episode, Jonas Maebe said: Ok. Then I don't know why they are , I got…
Marco van de Voort wrote 13 lines
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.

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

Reply by email

Marco van de Voort
to Tomas Hajny

In our previous episode, Tomas Hajny said:

Show quoted text 10 lines
> 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. 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.

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)

Reply by email

Marco van de Voort
to Leonardo M. Ramé: 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 ?

Reply by email

Leonardo M. Ramé
to Marco van de Voort
Show quoted text 16 lines
From: Marco van de Voort Subject: Re: [fpc-devel] Error compiling trunk on FreeBSD To: "FPC developers' list" Date: Wednesday, March 2, 2011, 11:04 AM 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

Reply by email

Marco van de Voort
to Leonardo M. Ramé

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)

Reply by email

Leonardo M. Ramé
to Marco van de Voort
Show quoted text 17 lines
From: Marco van de Voort Subject: Re: [fpc-devel] Error compiling trunk on FreeBSD To: "FPC developers' list" Date: Wednesday, March 2, 2011, 11:31 AM 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

Reply by email

Marco van de Voort
to Leonardo M. Ramé

In our previous episode, Leonardo M. Ram? said:

Show quoted text 5 lines
objdump -d cpu.o???(the InterlockedCompareExchange128 part). Thanks. (this is also in fixes, and needs to be fixes asap because of 2.4.4)

Thanks, fixed.

Reply by email

Florian Klaempfl
to Marco van de Voort: In our previous episode, Tomas Hajny said: Yes. But that is about way older binutils.…
Marco van de Voort wrote 21 lines
In our previous episode, Tomas Hajny said: >> 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. > > 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. 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)

Good reason to fix the elf64 writer for FreeBSD :)?

Reply by email