AROS cross-compiler that runs on Linux?

PortablE · 3075

PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
on: August 14, 2022, 12:47:24 PM
Does anyone know where I can find a version of GCC/G++ compiler for Linux that will cross-compile for AROS? 

ZeroHero used to provide one, but his website is down, and no-one seems to have saved his AROS (nor MorphOS) versions:
http://www.zerohero.se/cross/aros.html (no-longer exists)

ChrisH
--
Author of the PortablE programming language.


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #1 on: August 14, 2022, 12:56:41 PM
Hi,

If you follow these instructions: https://github.com/deadw00d/AROS/blob/alt-abiv0/INSTALL.md

You will get a local build of AROS together with local cross-compiler. For using the cross-compiler outside of AROS build-system, you need to add --sysroot switch pointing to Development directory inside of AROS build.



PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #2 on: August 16, 2022, 03:09:16 PM
Thanks for the pointer - but I was hoping for a pre-compiled version that would avoid me having to install subversion & the huge number of other dependencies needed to build AROS.  (That may not be a show-stopper, but it will at least greatly delay anything AROS-related that I do, as I don't want to have all that 'junk' installed onto my main Linux system.  Possibly I can use chroot or toolbox to keep it entirely separate, but I have not used either of them yet, and they will probably be more complicated than I hope.)

I hadn't realised that GCC/etc from the Linux-hosted version of AROS could be run outside of AROS (on Linux itself), so it seems I need to look for a pre-compiled version of the Linux-hosted AROS & it's developer tools (if that even exists).

ChrisH
--
Author of the PortablE programming language.


magorium

  • Legendary Member
  • *****
    • Posts: 632
    • Karma: +62/-0
  • Convicted non contributor
Reply #3 on: August 16, 2022, 05:05:47 PM
I hadn't realised that GCC/etc from the Linux-hosted version of AROS could be run outside of AROS (on Linux itself),
Unfortunately it can't.

Quote
... so it seems I need to look for a pre-compiled version of the Linux-hosted AROS & it's developer tools (if that even exists).
Pre compiled versions of AROS ABIv0 Linux hosted can be found at https://axrt.org/index.php?tab=download-aros

And as always has been the case you can use the contrib archive to 'obtain' the development directory which contains the /native/ AROS gcc compiler and tools.

What deadwood wrote is that when you build AROS as described that it automatically builds the AROS cross-compiler for you.

That compiler is used to build AROS itself but can be used outside the AROS build process by providing --sysroot with indicated directory to cross compile for AROS.

Quote
Thanks for the pointer - but I was hoping for a pre-compiled version that would avoid me having to install subversion & the huge number of other dependencies needed to build AROS.  (That may not be a show-stopper, but it will at least greatly delay anything AROS-related that I do, as I don't want to have all that 'junk' installed onto my main Linux system.  Possibly I can use chroot or toolbox to keep it entirely separate, but I have not used either of them yet, and they will probably be more complicated than I hope.)
I have no idea about your setup but in case you do have a development machine that has enough free ram (> 8 GB, Unfortunately I do not have an exact figure) then there is no need for a (permanent) installation.

The build instructions as indicated will build everything outside your current system setup. If your setup is able to accomplish that in ram (ramdisk) then you could zip/tarball the directories that you require/desire and re-use those at your disposal (to avoid having to build the whole AROS tree over and over again). Not an ideal solution but it might perhaps be able to address some of your concerns.

But perhaps deadwood has a quicker/better solution as I am not very familiar with AROS' build system.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #4 on: August 16, 2022, 05:18:03 PM
Not sure if it helps but I use the AROS 64bit Developer VMWare setup provided by Palone some time ago. It has all the prerequisites already installed in Ubuntu 18.04.

At first I used the VMWare Build System for compiling ABIv1 x86-64. But then I made a copy of the VM to compile AROS 68k. More recently I made two more copies - one to compile ABIv11 x86-64 & one to compile ABV0 x86.

These VM's are all running in VMWare Workstation. That way they don't clutter another workspace or interfere with each other. The Build Systems run well & sufficiently fast inside respective VM's.




AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3740
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #5 on: August 16, 2022, 05:45:12 PM
Without any doubt VMWare is the best solution to work with AROS x86, and very fast, works very well Network, Audio and Video.


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #6 on: August 17, 2022, 01:24:12 AM
Thanks for the pointer - but I was hoping for a pre-compiled version that would avoid me having to install subversion & the huge number of other dependencies needed to build AROS.  (That may not be a show-stopper, but it will at least greatly delay anything AROS-related that I do, as I don't want to have all that 'junk' installed onto my main Linux system.  Possibly I can use chroot or toolbox to keep it entirely separate, but I have not used either of them yet, and they will probably be more complicated than I hope.)

I generally use VMs for such tasks, not to clutter my main system with "temporary" things.

I hadn't realised that GCC/etc from the Linux-hosted version of AROS could be run outside of AROS (on Linux itself), so it seems I need to look for a pre-compiled version of the Linux-hosted AROS & it's developer tools (if that even exists).

There are two compilers: one is a cross-compiler that is built based on instructions above and is a Linux-native program. Second is a AROS-native compiler that comes from "contrib" and is part of distributions. I was refererring to the first compiler, the cross-compiler. AROS-native compiler won't work under Linux.



PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #7 on: August 20, 2022, 02:28:04 PM
Thanks.  I've ended-up using this guide, as there's no need to use Subversion/etc
https://github.com/apiraino/aros_guide

Although it doesn't tell you to install "libpng-dev" (which is needed).  Then it fails trying to download gnu mpc, so it was necessary to edit "tools/crosstools/mmakefile", and add this path in the right place: https://ftp.gnu.org/gnu/mpc

I'm now trying to work-out how to convince the build scripts to use sensible (non-machine-specific) paths for the cross-compiler tools & include files...

ChrisH
--
Author of the PortablE programming language.


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #8 on: August 21, 2022, 12:28:43 AM
Just a note - there is no longer a need to use Subversion, sources are now on Github.

BTW, where did you get the sources from for your local build?



PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #9 on: August 21, 2022, 03:47:14 AM
Just a note - there is no longer a need to use Subversion, sources are now on Github.
OK, but that wasn't the impression I got from the instructions saying to install these packages:
subversion git-core gcc g++ make gawk bison flex bzip2 netpbm autoconf automake libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libpng-dev gcc-multilib libsdl1.2-dev byacc python-mako libxcursor-dev cmake zsh mingw64
Quote
BTW, where did you get the sources from for your local build?
https://aros.sourceforge.io/nightly.php
source
Core AROS sources.
https://sourceforge.net/projects/aros/files/nightly/20190520/Sources/AROS-20190520-source.tar.bz2/download

ChrisH
--
Author of the PortablE programming language.


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #10 on: August 21, 2022, 12:33:26 PM
Hmm, I'll have to update instructions to remove svn.

I'd suggest using the sources from snapshots:

https://aros.sourceforge.io/snapshots.php

These are more up-to-date if you are interested in i386.



PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #11 on: August 21, 2022, 02:46:11 PM
I'd suggest using the sources from snapshots:
https://aros.sourceforge.io/snapshots.php
These are more up-to-date if you are interested in i386.
I'm not worried about being up-to-date, but how is a 2019-04-16 snapshot more recent than a 2019-05-20 nightly?

ChrisH
--
Author of the PortablE programming language.


PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #12 on: August 21, 2022, 03:42:11 PM
I believe I've now got a GCC installation which is fairly portable between Linux machines.  (Although I have another issue that currently makes thorough testing rather difficult.) 
As this wasn't so easy for an AROS & GCC compiling newbie like me to achieve, here are the main things I had to do:

First I needed to configure it with the following additional parameters:
../AROS-20190520-source/configure --target=linux-i386 --enable-debug --with-aros-toolchain-install=/usr/local/amiga/bin_aros --prefix=/usr/local/amiga/bin_aros

But that doesn't stop the resulting GCC from defaulting to looking for the AROS sysroot (includes, object files, etc) in a non-portable location.  So I then needed to edit "config/make.cfg", and change the following two assignments to be:
AROS_DIR_DEVELOPMENT := /usr/local/amiga/i386-aros
AROS_DEVELOPMENT     := $(AROS_DIR_DEVELOPMENT)


Obviously the contents of the Development folder needs to be copied to "/usr/local/amiga/i386-aros".  And there needs to be an empty folder for "/usr/local/amiga/bin_aros".

Then I could run "make".

The rather old version of AROS I am building fails to download GNU MPC, so after "make" starts compiling stuff, I needed to edit the "tools/crosstools/mmakefile" file it had created, and change the following assignment to be:
MPC_REPOSITORY := https://ftp.gnu.org/gnu/mpc

When it eventually finishes, it's worth checking the resulting executable, to ensure it doesn't contain any non-portable references:
/usr/local/amiga/bin_aros/i386-aros-g++ -v

BTW, to stop the above command reporting it was configured from the original user path I did this from, I created a symlink from /AROS to that folder, and then cd to /AROS before running "configure" & "make".
« Last Edit: August 22, 2022, 02:17:45 PM by PortablE »

ChrisH
--
Author of the PortablE programming language.


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #13 on: August 21, 2022, 11:35:21 PM
I'd suggest using the sources from snapshots:
https://aros.sourceforge.io/snapshots.php
These are more up-to-date if you are interested in i386.
I'm not worried about being up-to-date, but how is a 2019-04-16 snapshot more recent than a 2019-05-20 nightly?

The naming is confusing but this is temporary and will be fixed in future. The main difference is that using the 05-20 nightly you will build GCC 4.6.4 cross-compiler and using 04-16 snapshot you will build GCC 6.5.0.



PortablE

  • Newbie
  • *
    • Posts: 25
    • Karma: +49/-0
    • The homepage of Chris Handley
Reply #14 on: August 22, 2022, 04:04:50 PM
The naming is confusing but this is temporary and will be fixed in future. The main difference is that using the 05-20 nightly you will build GCC 4.6.4 cross-compiler and using 04-16 snapshot you will build GCC 6.5.0.
I'm giving it a go, but it looks like I'll need to do more trial & error to get something usable, and it's taking twice as long to finish compiling (I thought the previous one only failed near the end, but perhaps it was much earlier). 

Is there a way to get it to stop compiling AROS itself, so it just does the GCC stuff?

ChrisH
--
Author of the PortablE programming language.