Metamake builds binary that then doesn't run.

leeg · 459

leeg

  • Newbie
  • *
    • Posts: 20
    • Karma: +0/-0
on: February 25, 2020, 02:18:43 PM
Hi,

I've got a program that I know builds and runs if I compile it in AROS using gcc directly, and I'm trying to set it up for building in-tree. To save describing too much, the project is here: https://github.com/iamleeg/Amiga-Smalltalk

I took the 'local-helloworld' example from https://aros.sourceforge.io/documentation/developers/app-dev/introduction.php and edited it to build the source files in my project. What I see is that if I make this project within the AROS tree, I get a binary in bin/linux-x86_64/AROS/local/AmigaSmallTalk/AmigaSmalltalkTests, but that binary cannot be run in AROS. `file` tells me it is a:

Quote
ELF 64-bit LSB relocatable, x86-64, version 1 (AROS Research Operating System), not stripped

and nm tells me that all of the symbols from my source files are there. However if I launch the program from the AROS shell, it says "file is not executable". I have tried using protect +e, but that doesn't change the outcome. How can I diagnose this?



salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #1 on: February 25, 2020, 02:45:03 PM
"OT" I forgot there is this script for linux that configures the whole cross environment for you

http://archives.aros-exec.org/share/development/cross/gimmearos.zip

Tiny Aros


salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #2 on: February 25, 2020, 02:48:54 PM
I use ubuntu 14.04 (32bit) to compile, but I don't know about programming, currently the compilations have been successful but I refer to the scripts that write the dev

Tiny Aros


leeg

  • Newbie
  • *
    • Posts: 20
    • Karma: +0/-0
Reply #3 on: February 25, 2020, 04:21:07 PM
Thanks, I'm using Ubuntu 18.04 (64-bit), and building hosted x86-64 AROS binaries.



leeg

  • Newbie
  • *
    • Posts: 20
    • Karma: +0/-0
Reply #4 on: February 25, 2020, 05:26:17 PM
I should make it clear that when I followed the local-HelloWorld example, that worked fine, so it's something in my changes (or my sources) that doesn't work.



salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #5 on: February 25, 2020, 07:10:49 PM
surely

Tiny Aros


salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #6 on: February 26, 2020, 07:53:40 AM
hello me when I install some packages and run a build then I clean the system with apt-get clean

Tiny Aros


leeg

  • Newbie
  • *
    • Posts: 20
    • Karma: +0/-0
Reply #7 on: March 02, 2020, 03:16:10 PM
I realised my problem: I had a global variable that wasn't initialised. It was being linked as an undefined reference (a Common symbol, in nm's lexicon). I don't know why this causes the executable to fail on AROS when it works on other operating systems, but the solution I applied was to make the variable file-scope, so that it doesn't make it to the link editor.



salvo

  • Legendary Member
  • *****
    • Posts: 569
    • Karma: +8/-0
  • Invalid Civil
Reply #8 on: March 02, 2020, 05:03:24 PM
I recently compiled the odyssey browser using ready-to-use scripts one of these was used to set up the development environment before dumping the source tree, contrib etc..

Tiny Aros