Metamake builds binary that then doesn't run.

leeg · 1730

leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
on: February 25, 2020, 07:18:43 AM
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?



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #1 on: February 25, 2020, 07:45:03 AM
"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



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #2 on: February 25, 2020, 07:48:54 AM
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



leeg

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



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #4 on: February 25, 2020, 10:26:17 AM
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.



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #5 on: February 25, 2020, 12:10:49 PM
surely



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #6 on: February 26, 2020, 12:53:40 AM
hello me when I install some packages and run a build then I clean the system with apt-get clean



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #7 on: March 02, 2020, 08:16:10 AM
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.



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #8 on: March 02, 2020, 10:03:24 AM
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..