Development Plan

deadwood · 2594

salvo

  • Legendary Member
  • *****
    • Posts: 1581
    • Karma: +20/-4
  • Peace an Love
    • TinyAros
Reply #45 on: January 07, 2022, 01:23:45 AM
I thought it was written correctly I never learned English ;D

TinyAros and shop  http://tinyaros.flazio.com
HP Z400 Workstation, Intel Xeon W3565 3.20 Ghz, 8 Gb Ram, SSD 120 Gb, HD 500 Gb, Quadro nvs 295 256 Mb Gallium Ready


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +100/-0
Reply #46 on: January 07, 2022, 08:02:34 AM
@deadw00d
It is of futile importance but on your axrt downloadpage it is spelled desription (but should read description)

Fixed, thank :)



muibase

  • Newbie
  • *
    • Posts: 26
    • Karma: +65/-0
Reply #47 on: January 20, 2022, 06:51:19 AM
Next, link to releases (bottom of page): https://axrt.org/index.php?tab=download-aros

I have been trying to compile MUIbase for x86_64-v11 and (after some changes [mostly ULONG -> IPTR]) everything compiles without serious warnings, but the resulting binary does not start.

I am using the https://www.axrt.org/download/aros/v11/AROS-20211231-1-linux-x86_64-system.tar.bz2 release, and built the corresponding toolchain using the instructions from https://github.com/deadw00d/AROS/blob/master/INSTALL.md.

I tracked it down to global variables that somehow get missing in the binary.  Here is an example.

The following compiles and runs as expected:
Code: [Select]
#include <stdio.h>
int main(void)
{
    printf("Hello world\n");
    return 0;
}


But when adding a global variable like this:
Code: [Select]
#include <stdio.h>

// I love global variables, in particular when they are called 'i' ;-)
int i;

int main(void)
{
    printf("Hello world\n");
    i = 0;
    return 0;
}

The binary doesn't start.  The output in the CLI window is: "hello: file is not executable" and the Linux terminal where I booted AROS from prints "[ELF Loader] COMMON symbol 'i'".

Thus, somehow the linker removed the global symbol 'i'.  Any idea what is wrong?

Here is the command I used to compile (I made symbolic links from /usr/local to the directories where I unpacked and compiled v11):
/usr/local/aros-sdk/toolchain-core-x86_64/x86_64-aros-gcc --sysroot /usr/local/aros-sdk/SDK-core-x86_64 -o hello hello.c



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +100/-0
Reply #48 on: January 20, 2022, 07:14:20 AM
I think the solution is either to initialize the global variable to 0 OR to add -fno-common switch to the compilers comand line.

I looked up the history and it seems this change has been made to make older gcc versions (like 6.5.0) behave the same as the gcc 10 and up.



muibase

  • Newbie
  • *
    • Posts: 26
    • Karma: +65/-0
Reply #49 on: January 20, 2022, 07:56:14 AM
Thanks, that worked!  MUIbase now also runs on x86-64-v11.

Is there a way on AROS to detect whether AROS is compiled for i386 or x86-64?  It yes, it would allow to pre-select the right binary in the Installer script.



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +100/-0
Reply #50 on: January 20, 2022, 08:50:52 AM
Glad it worked :)

About your question, I see two ways:

1) aros.library (http://www.aros.org/documentation/developers/autodocs/aros.php) ArosInquireA with AI_ArosArchitecture tag. You get get a pointer to string like "linux-x86_64" or "pc-x86_64". You can grab CPU archictecture from there.
2) There is ABI environment variable you can read. Value of 0 most likely means it is i386 (however there was once ABIv0 for arm as well). Version of 11 means most likely x86_64 (though my builds of amiga-m68k also have version 11).



muibase

  • Newbie
  • *
    • Posts: 26
    • Karma: +65/-0
Reply #51 on: January 20, 2022, 09:12:29 AM
Env:ABI sounds good to me since that is easily accessible from within an Installer script.  It is okay if it isn't right all the time since it will only be used for pre-selecting the binary to install and the user can still change it.



muibase

  • Newbie
  • *
    • Posts: 26
    • Karma: +65/-0
Reply #52 on: January 20, 2022, 09:17:29 AM
Here is another question.  How do I correctly implement a function that takes variable number of arguments on AROS?

Here is a sample program:
Code: [Select]
#include <stdio.h>
#include <stdarg.h>
#include <libraries/mui.h>
#include <proto/muimaster.h>
#include <proto/intuition.h>
#include <proto/exec.h>

#define VARARGS68K __stackparm

struct Library *MUIMasterBase = NULL;

static void VARARGS68K ask(Object *app, const char *fmt, ...)
{
    va_list va;

    va_start(va, fmt);
    MUI_Request(app, NULL, 0, "Requester", "*Ok", fmt,
            (APTR)va->overflow_arg_area);
    va_end(va);
}

int main(void)
{
    MUIMasterBase = OpenLibrary((STRPTR)MUIMASTER_NAME, 0);
    if (MUIMasterBase == NULL) {
        printf("No MUI\n");
        return 10;
    }

    Object *app = ApplicationObject, End;

    ask(app, "6 * 7 = %d", 42);

    MUI_DisposeObject(app);

    CloseLibrary(MUIMasterBase);

    return 0;
}

When running this on x86-64-v11 I get the funny result: "6 * 7 = 22160"  :(



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +100/-0
Reply #53 on: January 20, 2022, 09:48:25 AM
@muibase

Moved to another thread:
https://ae.amigalife.org/index.php?topic=852.0



salvo

  • Legendary Member
  • *****
    • Posts: 1581
    • Karma: +20/-4
  • Peace an Love
    • TinyAros
Reply #54 on: January 20, 2022, 09:34:59 PM
Thanks, that worked!  MUIbase now also runs on x86-64-v11.

Is there a way on AROS to detect whether AROS is compiled for i386 or x86-64?  It yes, it would allow to pre-select the right binary in the Installer script.

Thank you steffen

TinyAros and shop  http://tinyaros.flazio.com
HP Z400 Workstation, Intel Xeon W3565 3.20 Ghz, 8 Gb Ram, SSD 120 Gb, HD 500 Gb, Quadro nvs 295 256 Mb Gallium Ready


deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +100/-0
Reply #55 on: February 12, 2022, 02:34:12 PM
Hi,

It looks like we are having Free Pascal compiler working on ABIv11 as well as several useful applications ported. :) See this link:

https://blog.alb42.de/2022/02/07/aros64-again-this-time-abi-11/
https://blog.alb42.de/2022/02/07/the-100-useless-aros-distribution-0-3/

Thanks go to ALB42.



salvo

  • Legendary Member
  • *****
    • Posts: 1581
    • Karma: +20/-4
  • Peace an Love
    • TinyAros
Reply #56 on: February 12, 2022, 06:09:32 PM
yes good :)

TinyAros and shop  http://tinyaros.flazio.com
HP Z400 Workstation, Intel Xeon W3565 3.20 Ghz, 8 Gb Ram, SSD 120 Gb, HD 500 Gb, Quadro nvs 295 256 Mb Gallium Ready


AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 1512
    • Karma: +45/-1
  • AROS One
    • AROS One
Reply #57 on: February 12, 2022, 06:57:17 PM
Hi,

It looks like we are having Free Pascal compiler working on ABIv11 as well as several useful applications ported. :) See this link:

https://blog.alb42.de/2022/02/07/aros64-again-this-time-abi-11/
https://blog.alb42.de/2022/02/07/the-100-useless-aros-distribution-0-3/

Thanks go to ALB42.

A few days ago I tried to start it from VM but it doesn't seem to work, I don't like Host systems so I didn't try other modes.


miker1264

  • Legendary Member
  • *****
    • Posts: 1224
    • Karma: +80/-2
Reply #58 on: February 12, 2022, 07:51:45 PM
Hi,

It looks like we are having Free Pascal compiler working on ABIv11 as well as several useful applications ported. :) See this link:

https://blog.alb42.de/2022/02/07/aros64-again-this-time-abi-11/
https://blog.alb42.de/2022/02/07/the-100-useless-aros-distribution-0-3/

Thanks go to ALB42.

A few days ago I tried to start it from VM but it doesn't seem to work, I don't like Host systems so I didn't try other modes.

AROS Hosted is great. One of the benefits is using the Host file managers to copy or delete data while AROS is running. It speeds up the process.






AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 1512
    • Karma: +45/-1
  • AROS One
    • AROS One
Reply #59 on: February 12, 2022, 11:16:35 PM
Yes I know miker but as said I'm not really excited about a Host system.