Running out of memory when compiling in AROS linux hosted

amigamia · 1031

amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Hi Ya'll,

I am trying to compile some C code on an AROS hosted on Linux Mint. Without modifying the AROSBootstrap.conf running make starts and runs into an out of memory error:

Code: [Select]
cc1: Out of memory allocating 535296 bytes
and it's always at the same .c file.

I tried to change the conf file to allow 512MB or RAM but it crashes completely with stack trace etc.

Any clue?


deadwood

  • AROS Developer
  • Junior Member
  • *****
    • Posts: 96
    • Karma: +6/-0
Reply #1 on: June 02, 2020, 10:08:19 PM
Are you using ABIv0 (32bit) or ABIv1 (32 or 64bit?)
Since you are anyhow using Linux, why not use cross compilers and compile directly from linux?



amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #2 on: June 02, 2020, 10:40:03 PM
Are you using ABIv0 (32bit) or ABIv1 (32 or 64bit?)
Since you are anyhow using Linux, why not use cross compilers and compile directly from linux?

Hi deadwood,

I am using ABIv0(32) and I have been having all sorts of config problems from the linux side. I have installed the AROS SDK but not sure how to run a make and target it as AROS.
AROS hosted with all contrib files seems to work fine but runs into this error on the same .c file in this project.



deadwood

  • AROS Developer
  • Junior Member
  • *****
    • Posts: 96
    • Karma: +6/-0
Reply #3 on: June 02, 2020, 10:47:12 PM
Let me try to help you :)

I put together a simple script that will most of the things for you, please see this instruction:

https://github.com/deadw00d/AROS/blob/alt-abiv0/INSTALL.md

You should get a cross-compiler and linux-hosted 32bit as a result. With this cross compiler you can compile your problem. I will help you as well there.



amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #4 on: June 02, 2020, 10:54:23 PM
Hey that is great deadwood. I'll toy around this evening and let you know...


amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #5 on: June 03, 2020, 02:55:51 PM
Hi deadwood,

I was able to compile AROS and the tool chains as described in the steps. I am able to start AROS hosted but how do i go by using the cross compiler from the linux side?



deadwood

  • AROS Developer
  • Junior Member
  • *****
    • Posts: 96
    • Karma: +6/-0
Reply #6 on: June 03, 2020, 06:02:46 PM
Good , now your cross compiler is located in

<yourdirectory>toolchain-alt-abiv0-i386/i386-aros-gcc

Use it in your makefile.

You might also need to add -I<yourdirectory>/alt-abiv0-linux-i386/bin/linux-i386/AROS/Development/include to compiler parameters for it to see headers.

This should get you compiling.



amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #7 on: June 05, 2020, 11:32:08 PM
OK I finally had a chance to play with this again. I modified the makefile to use the correct compiler but like you said, I needed to probably place the location for the headers in the makefile but I am a bit lost.

Code: [Select]
/bin/sh: 1: hg: not found
make: *** No rule to make target '/Development/include/SDL/SDL_types.h', needed by 'obj/keyboard.o'.  Stop.

I did place the SDL folder from the contrib into
Code: [Select]
/home/vinny/myrepo/alt-abiv0-linux-i386/bin/linux-i386/AROS/Development/include/ but I have a feeling it's not the right location?

I'll send you the makefile so maybe you can guide me there.
Would it help if I added
Code: [Select]
/home/vinny/myrepo/alt-abiv0-linux-i386/bin/linux-i386/AROS/Development/include/ to the $PATH ?


deadwood

  • AROS Developer
  • Junior Member
  • *****
    • Posts: 96
    • Karma: +6/-0
Reply #8 on: June 06, 2020, 07:25:45 AM
Ok, we are making progress. :) There are two things you need to do now:

1) Compile contrib
2) Add AROS includes to compiler path

1)

Clone this repostitory (https://github.com/deadw00d/contrib) into directory named 'contrib' and then checkout branch alt-abiv0
Copy the contrib directory into /home/vinny/myrepo/AROS directory
Then:
Code: [Select]
cd /home/vinny/myrepo/alt-abiv0-linux-i386/
make contrib

2)

Change:

Code: [Select]
ALL_CFLAGS += -std=c99 -I./src -DTARGET_$(PLATFORM) $(EXTRA_CFLAGS) $(SDL_CFLAGS) $(CFLAGS)

Into

Code: [Select]
ALL_CFLAGS += -std=c99 -I./src -I/home/vinny/myrepo/alt-abiv0-linux-i386/bin/linux-i386/AROS/Development/include/ -DTARGET_$(PLATFORM) $(EXTRA_CFLAGS) $(SDL_CFLAGS) $(CFLAGS)



amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #9 on: June 08, 2020, 05:01:28 AM
Thanks deadwood! I tried to compile contrib but got some errors along the way. I actually ended up installing Icaros Desktop 2.2.8 on my Dell Latitude D520 and copying the source code of the popular game Open Tyrian. At first it compiled and with the strip command it kept running with "Out of memory". Removed the strip option and it compiled again but this time the game actually started!. It crashed on Icaros after a few menu selections but it played OK on AROS hosted on my Linux computer. It still needs to be properly compiled and errors checked, although when compiled for Linux it plays just fine. Without further ado I give you Open Tyrian (C Conversion of Tyrian 2.1) for AROS i386 ABIv0.



deadwood

  • AROS Developer
  • Junior Member
  • *****
    • Posts: 96
    • Karma: +6/-0
Reply #10 on: June 08, 2020, 07:11:36 AM
Well done :)



amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #11 on: June 08, 2020, 03:17:15 PM
I have uploaded it in The AROS Archives but I guess it won't show up until an admin approves it?


magorium

  • Member
  • ***
    • Posts: 151
    • Karma: +2/-0
  • Convicted non contributor
Reply #12 on: June 08, 2020, 07:10:48 PM
Hi amigamia,


Your file is there, thx.


You can press the uploads link (all the way up at the top, somewhere in the middle) and read that besides your upload, that there are a few others "waiting for approval".  ;)


It sometimes takes a little time for them files to get the approval stamp.


salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #13 on: June 08, 2020, 09:00:16 PM
ok works fine for me

Tiny Aros


amigamia

  • Newbie
  • *
    • Posts: 36
    • Karma: +2/-0
    • AROS World
Reply #14 on: June 09, 2020, 08:02:54 PM
Thanks deadwood! I tried to compile contrib but got some errors along the way. I actually ended up installing Icaros Desktop 2.2.8 on my Dell Latitude D520 and copying the source code of the popular game Open Tyrian. At first it compiled and with the strip command it kept running with "Out of memory". Removed the strip option and it compiled again but this time the game actually started!. It crashed on Icaros after a few menu selections but it played OK on AROS hosted on my Linux computer. It still needs to be properly compiled and errors checked, although when compiled for Linux it plays just fine. Without further ado I give you Open Tyrian (C Conversion of Tyrian 2.1) for AROS i386 ABIv0.

Hi deadwood, I am still trying to fix the make contrib error. This i what I get after cloning, check the branch, copying into the location and running make contrib:

Code: [Select]
[MMAKE] Building AROS.contrib
[MMAKE] Read vars...
[MMAKE] Scanning dirs...
/home/vinny/myrepo/AROS/contrib/MultiMedia/libs/flac/mmakefile.src:In instantiation of fetch_and_build_gnu_development, line 18
Syntax error in arguments: nlsflag=no xflag=no


[MMAKE] /home/vinny/myrepo/alt-abiv0-linux-i386/bin/linux-x86_64/tools/genmf.py /home/vinny/myrepo/AROS/config/make.tmpl --listfile /tmp/genmfsEiCRS  failed: 256
[MMAKE] Error: Error regenerating makefile: No such file or directory
Makefile:203: recipe for target 'contrib' failed
make: *** [contrib] Error 10