Recent

Author Topic: ctypes on arm-linux  (Read 5481 times)

Stygian

  • Jr. Member
  • **
  • Posts: 90
ctypes on arm-linux
« on: May 10, 2017, 08:12:36 pm »
Hello Everyone,

Is this any way to use ctypes on arm-linux? I checked the file, but all gray(no compatible cpu). Or i have to do the dirty job on my own?

Edit:
I found this wiki: http://wiki.freepascal.org/Pascal_for_C_users

Is this do the job?

Regards,
Sty
« Last Edit: May 10, 2017, 09:03:51 pm by Stygian »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: ctypes on arm-linux
« Reply #1 on: May 10, 2017, 09:54:07 pm »
Is this any way to use ctypes on arm-linux? I checked the file, but all gray

ctypes is supported just fine and part of any standard FPC distribution. Something else must be wrong,
but for that I don't have enough information. Do you have ctypes.o and ctypes.ppu in the RTL subdirectory of
your $PREFIX/lib/fpc/$FPCVERSION/units/$FPCTARGET path?


Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: ctypes on arm-linux
« Reply #2 on: May 11, 2017, 06:48:32 am »
There must be something else wrong indeed. ctypes is used for loads of bindings that otherwise should also be missing.
I suspect your installation is wrong.
Specialize a type, not a var.

Stygian

  • Jr. Member
  • **
  • Posts: 90
Re: ctypes on arm-linux
« Reply #3 on: May 12, 2017, 09:47:03 am »
Dear All,

I checked the corresponding folder and only .pp-s there(There is a message box jumping up, telleing me it will link on another place). Can i just copy the folders from my Windows OS based install into my arm-linux based install?

It's a pain reinstall lazarus on the Orange PI A20.

Thanks,
Stygian

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: ctypes on arm-linux
« Reply #4 on: May 12, 2017, 09:50:19 am »
No. The source code is OK to copy, but arm binaries are completely different from win32/win64. Maybe you tried that before? That explains a lot....
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: ctypes on arm-linux
« Reply #5 on: May 12, 2017, 10:59:53 am »
Copying sources will only work if you don't use any units already compiled with ctypes. And many unit on *nix use ctypes.

You can try, but I think it is better to bite the bullet and cleanup that install

Stygian

  • Jr. Member
  • **
  • Posts: 90
Re: ctypes on arm-linux
« Reply #6 on: May 12, 2017, 11:37:55 am »
Dear All,

I did not tried to copy them before, nor now. I used the wiki help to mach pascal with the corresponding c type

So for example:

for unsigned char I used Byte
for unsigned short int I used Word

Regards,
Sty.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: ctypes on arm-linux
« Reply #7 on: May 12, 2017, 11:48:36 am »
Note that modern FPC versions have a complete set of (u)int8/16/32/64 in system afaik.

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: ctypes on arm-linux
« Reply #8 on: May 12, 2017, 12:23:03 pm »
Yes, all common signed and unsigned types are covered as Pascal types.
« Last Edit: May 12, 2017, 12:24:38 pm by Thaddy »
Specialize a type, not a var.

Stygian

  • Jr. Member
  • **
  • Posts: 90
Re: ctypes on arm-linux
« Reply #9 on: May 12, 2017, 12:24:10 pm »
Dear All,

You are right. There are a complete set of ints in the systemh.inc file. If i get home, I'll check if i have the same on my Orange PI install.

Regards,
Sty

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: ctypes on arm-linux
« Reply #10 on: May 12, 2017, 12:26:04 pm »
I'll check if i have the same on my Orange PI install.
You will. Otherwise re-install.
If that is a problem I can package up my RPi3 install.
Specialize a type, not a var.

Stygian

  • Jr. Member
  • **
  • Posts: 90
Re: ctypes on arm-linux
« Reply #11 on: May 12, 2017, 06:41:52 pm »
Dear All,

I checked it on my arm-linux install, and the systemh.inc file is there, and working.

Regards,
Sty

 

TinyPortal © 2005-2018