Freepascal + MAC OS X Catalina + AROS SDK

amigamia · 1828

amigamia

  • Administrator
  • Member
  • *****
    • Posts: 134
    • Karma: +49/-0
    • AROS World
on: July 19, 2020, 10:11:05 AM
Hello AROS Dwellers,

I am trying to setup FreePascal on my OS X Catalina (10.15.3) so I can cross-compile code for AROS. Freepascal for OS X is installed and it has the capability of cross compile with -Taros -Pi386 command switches. The AROS units have been placed in the correct locations and copied them from ALB42 version of Freepascal for AROS.

The compilation runs now but now I have an error during the linking process, which lead me to the missing AROS SDK.

I downloaded the AROS SDK and during the execution of ./AROS-SDK-Install it complained it had objcopy missing (Xcode and Xcode command line tools are installed and updated). To make this long story short, I ended up downloading the GNU Binutils source code and compiled it. objcopy was installed and it passed the ./AROS-SDK-Install.

However, this is where it stopped:

Checking objdump... OK.
Checking objcopy... OK.
Checking ranlib... OK.
Checking strip... OK.
Checking whether ld supports the ELF format... FAILED.
Ld doesnt support the ELF executable format. You need to configure the binutils so that they can work on ELF objects.


Binutils has an ld as well and I managed to compile it but it won't install. Has anyone had any success installing the AROS SDK on a MAC. OS  X, Catalina to be precise?

Any suggestion is much appreciated. Thanks for any help in advance.


magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 632
    • Karma: +62/-0
  • Convicted non contributor
Reply #1 on: July 19, 2020, 05:05:55 PM
Hi amigamia,


I have no experience with your setup, so have to go a bit on the guessing side of things.


First thing that comes to mind is to ask if you have patched your binutils ? e.g. AROS elf isn't supported out of the box and there are patches in AROS source-tree that need to be run over the binutils sources first, before you compile them.


Because of that it is also (or at least should) that ld isn't invoked directly by the Free Pascal compiler, rather the collect-aros executable is (which on its turn invokes ld)


According to www.aros.org Mac seems to be a valid host (http://www.aros.org/documentation/developers/compiling.php).


If all fails, there is the option to use fpcupdeluxe, but I doubt DonAlfredo has got things working 100% for mac. In which case you might be subject to trail and error to be able to get things fixed. https://github.com/LongDirtyAnimAlf/fpcupdeluxe


amigamia

  • Administrator
  • Member
  • *****
    • Posts: 134
    • Karma: +49/-0
    • AROS World
Reply #2 on: July 20, 2020, 10:55:20 AM
Thanks Magorium,

I'll take your suggestions and try. As for patching the binutils, do you know the process mentioned anywhere?

I know OS X is supported for developing for AROS but that documentation may be a little old and referring to older versions of the OS. Catalina seems to bring a whole new set of features, security updates and with it, a whole new set of problems.

In any case, I'll keep trying.


magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 632
    • Karma: +62/-0
  • Convicted non contributor
Reply #3 on: July 20, 2020, 12:14:58 PM
I'll take your suggestions and try. As for patching the binutils, do you know the process mentioned anywhere?
I don't think it is literally mentioned in a document or something like that.

The GimmeAros script builds the binutils for me out of the box (actually the build-system of AROS does but GimmeAros just makes it a bit easier to setup).

However, since I had to make some manual adjustments I've written some scripts to manually patch them as I wanted a quick method to build the binutils for use with Free Pascal.

I can dig up those scripts if wanted (windows based), but all that actually does is download the patches and required sources and invoking the patch command.

More can be read here as well:
- https://github.com/deadw00d/AROS/tree/alt-abiv0/tools/collect-aros
- https://repo.or.cz/AROS-Contrib.git/tree/HEAD:/gnu/binutils
(or use any of the other repositories out there that suits your needs, the ones mentioned above were quickest for me to locate the correct directories).

If you know how to build the binutils on your Mac then there should not be a real issue with patching the sources before you perform the actual build.

The hardest part would probably be to find a version of the binutils for your Mac that is supported by AROS.

Quote
I know OS X is supported for developing for AROS but that documentation may be a little old and referring to older versions of the OS. Catalina seems to bring a whole new set of features, security updates and with it, a whole new set of problems.
Yes, i am aware that every new MacOS version brings in a whole new set of problems. The Free Pascal developers have to deal with that each and every new release of Mac OS as well, which usually gets done on base of trial and error. Especially the bundling and other security measures seem to be a nightmare.

Quote
In any case, I'll keep trying.
As long as you are able to spend/waste some time on it, then eventually it should be possible to get things going. Some binutils shouldn't be able to disturb that for you.

Just keep posting in case you run into issues. It can only serve as a (good) reminder for yourself as well as other people wanting to give it a whirl.

Just to make sure, I feel more comfortable with Free Pascal related issues but at least I can share what I do know about AROS in the general sense.