Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling for Raspberry Pi #9

Open
JonnyTech opened this issue Jan 21, 2021 · 1 comment
Open

Compiling for Raspberry Pi #9

JonnyTech opened this issue Jan 21, 2021 · 1 comment

Comments

@JonnyTech
Copy link

Is the project able to work with ARMHF for Raspberry Pi?

Very simple test code:

program ogtest;
uses
  sysutils,onguard,ogutil;
const
  CKey:TKey=($DE,$AD,$BE,$EF,$CA,$FE,$BA,$BE,$FA,$CE,$FE,$ED,$B1,$6B,$00,$B5);
var
  regcode:TCode;
begin
  InitRegCode(CKey,'RegStr',EncodeDate(2022,12,31),regcode);
  writeln(BufferToHex(regcode,SizeOf(regcode)));
end.

Compiles OK for Linux x86-64:

Target OS: Linux for x86-64
Compiling ogtest.pp
Compiling onguard.pas
Compiling ogutil.pas
Compiling ogconst.pas
Writing Resource String Table file: ogconst.rsj
onguard.pas(949,2) Note: User defined: Make sure we have some FreeBSD and MacOSX support too at some point 
onguard.pas(954,3) Note: Local variable "RegKey" not used
onguard.pas(957,3) Note: Local variable "Drive" not used
Linking ogtest.x86_64-linux
4302 lines compiled, 0.4 sec, 688000 bytes code, 373712 bytes data
3 note(s) issued

But intel assembler and MaxStructSize errors for Linux ARMHF:

Target OS: Linux for ARMHF
Compiling ogtest.pp
Compiling onguard.pas
onguard.inc(58,3) Error: Illegal assembler style specified "INTEL"
Compiling ogutil.pas
onguard.inc(58,3) Error: Illegal assembler style specified "INTEL"
ogutil.pas(71,32) Error: Illegal expression
ogutil.pas(77,29) Error: Identifier not found "MaxStructSize"
ogutil.pas(77,66) Error: Can't evaluate constant expression
ogutil.pas(266,1) Fatal: There were 5 errors compiling module, stopping
Fatal: Compilation aborted

Does Illegal assembler style specified "INTEL" mean that it cannot work with ARM?

Also, looking for MaxStructSize in the FPC sounce (trunk) yields no results.

@JonnyTech
Copy link
Author

In onguard.inc, commenting out ASMMODE INTEL seems to compile:

{$IFDEF FPC}
 {$MODE OBJFPC}{$H+}
 {.$ASMMODE INTEL}
{$ENDIF}
Target OS: Linux for ARMHF
Compiling ogtest.pp
Compiling onguard.pas
Compiling ogutil.pas
Compiling ogconst.pas
Writing Resource String Table file: ogconst.rsj
onguard.pas(949,2) Note: User defined: Make sure we have some FreeBSD and MacOSX support too at some point 
onguard.pas(954,3) Note: Local variable "RegKey" not used
onguard.pas(957,3) Note: Local variable "Drive" not used
Linking ogtest
4299 lines compiled, 0.4 sec, 748000 bytes code, 274944 bytes data
3 note(s) issued

Is this safe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant