Recent

Author Topic: Asm errors when compiling BGRABitmap for OpenBSD i386  (Read 3425 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
Asm errors when compiling BGRABitmap for OpenBSD i386
« on: August 13, 2023, 06:05:47 pm »
Quote
Verbose: Assembling bgraanimatedgif
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s: Assembler messages:
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:442: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:460: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:478: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:496: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:699: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:732: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:765: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:798: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
Verbose: Compiling bgracolorint.pas
Verbose: Assembling bgracolorint
bgracolorint.pas(364,0) Error: Error while assembling exitcode 1
bgracolorint.pas(364,0) Verbose: There were 2 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: /home/user/fpcupdeluxe/fpcupdeluxe32/fpc/bin/x86_64-linux/ppcross386 returned an error exitcode

FPC 3.2-fixes. Ubuntu 20.04 x64, cross compiling for OpenBSD i386. Lazarus 3.99.
aren't these FPC bugs?
« Last Edit: August 15, 2023, 12:28:09 pm by AlexTP »

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
Re: Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #1 on: August 13, 2023, 06:26:50 pm »
Error: /home/user/cuda/bgrabitmap/bgrabitmap/lib/i386-openbsd-gtk2-3.2.3/bgracolorint.s:442: Error: no instruction mnemonic suffix given and no register operands; can't size instruction

line 442 in .s file is:

Code: Pascal  [Select][+][-]
  1.         imul    (%esi)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11434
  • FPC developer.
Re: Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #2 on: August 14, 2023, 08:51:53 am »
No these are from the assembler. some clang-as problem, probably.

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
Re: Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #3 on: August 15, 2023, 10:17:27 am »
Yes, OpenBSD has the little different assembler program, as noted on the Github issue.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11434
  • FPC developer.
Re: [Closed] Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #4 on: August 15, 2023, 10:56:07 am »
The error message looks sane  the imul has no suffix (like imull to indicate 32-bit or -q for 64-bit).

It wouldn't be a bad thing if FPC generated slightly stricter, so might be worth a bugreport

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
Re: [Closed] Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #5 on: August 15, 2023, 11:30:18 am »
No,  the reason is code in bgracolorint.pas: it has the 'imul'.
Code: Pascal  [Select][+][-]
  1. operator*(const color1, color2: TColorInt65536): TColorInt65536;
  2. {$ifdef BGRACOLORINT_USEASM} {$asmmode intel} assembler;
  3.   asm
  4.     push edx
  5.     push ebx
  6.     push esi
  7.     mov ebx, Color1
  8.     mov esi, Color2
  9.     //ecx = @result
  10.  
  11.     mov eax, [ebx] //r
  12.     imul [esi]
  13.  


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11434
  • FPC developer.
Re: [Closed] Asm errors when compiling BGRABitmap for OpenBSD i386
« Reply #6 on: August 15, 2023, 11:55:56 am »
Yeah, but in intel mode.  ATT and Intel mode are parsed and then reassembled for assembler output again (which is why you can use pascal identifiers!)

So it is still a bug in the ATT output IMHO

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
« Last Edit: August 15, 2023, 03:02:25 pm by AlexTP »

 

TinyPortal © 2005-2018