Compile programs ABI v.0 hosted

nikos · 1575

magorium

  • Senior Member
  • ****
    • Posts: 253
    • Karma: +7/-0
  • Convicted non contributor
Reply #45 on: December 25, 2020, 09:29:10 PM
Yes, I did in the issue :)
https://github.com/deadw00d/AROS/issues/35
I am now able to confirm this is an issue on newer (Linux) distributions, as i tested it on a newer debian.

Apparently it seems to be an issue with regards to texinfo, being too new (backwards incompatibility).

Google turned up two different approaches:
1) downgrade textinfo on your system
2) patch gcc (patch for specific compiler versions seem to be available online)

Option 1 might be very inconvenient for your system/setup, and 2 requires a little help from our friend deadwood in that the build-system runs an extra patch over gcc ?

Other ideas/suggestions are welcome.


deadwood

  • AROS Developer
  • Senior Member
  • *****
    • Posts: 314
    • Karma: +22/-0
Reply #46 on: December 25, 2020, 09:54:35 PM
@magorium

Thanks for looking into this. This will then go away once I update gcc to newer version.



magorium

  • Senior Member
  • ****
    • Posts: 253
    • Karma: +7/-0
  • Convicted non contributor
Reply #47 on: December 25, 2020, 11:03:34 PM
@deadwood
No problem looking into it, as i wanted to test it anyway (just was not able to do it sooner  :-\ ).

afairc from the bug-report reactions it is an issue specific with the 4.x series of the compiler so indeed it should be fixed automatically with upgrading the compiler.


nikos

  • Senior Member
  • ****
    • Posts: 295
    • Karma: +8/-2
    • aspireos
Reply #48 on: December 26, 2020, 02:29:48 AM
I tried to compile VICE 3.5

I assumed that I could do this.

./configure --host=i686-aros

and then

make

It is building and everything seams to be ok but I'm pretty sure I'm building Linux files.
It is all .c .h .o files. Not any .exe

Here is the log.

https://filebin.net/7kl40i9mava3ssmd


The readme in VICE 3.1 say this:

- MorphOS
  Using the AHI or SDL sound system, the CGX graphics system, the LowLevel
  input system and the MUI GUI system.

- AROS
  Using the AHI or SDL sound system, the CGX graphics system, the LowLevel
  input system and the MUI GUI system.

These ports are still missing some dialogs and missing some features,
however, we are working on implementing them.

Building the binaries using a cross-compiler :

- AmigaOS3:   configure with --host=m68k-amigaos
- AmigaOS4:   configure with --host=ppc-amigaos
- MorphOS:    configure with --host=ppc-morphos
- Intel AROS: configure with --host=i686-aros
- PPC AROS:   configure with --host=powerpc-aros
- AROS64:     configure with --host=x86_64-aros

After the configure script is done:

make
make bindist

I also tried this:

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=i386-aros-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-pc-aros-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
option checking is yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-pc-aros
checking for i686-pc-aros-gcc... i386-aros-gcc
checking whether the C compiler works... no
configure: error: in `/home/niko/vice-emu-code/vice':
configure: error: C compiler cannot create executables
See `config.log' for more details
« Last Edit: December 26, 2020, 02:35:42 AM by nikos »



magorium

  • Senior Member
  • ****
    • Posts: 253
    • Karma: +7/-0
  • Convicted non contributor
Reply #49 on: December 26, 2020, 04:23:36 AM
It is building and everything seams to be ok but I'm pretty sure I'm building Linux files.
It is all .c .h .o files. Not any .exe
That is affirmative.

That is because the vice scripts are already telling you that:
Code: [Select]
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-pc-aros
checking for i686-pc-aros-gcc... i386-aros-gcc
checking whether the C compiler works... no
See `config.log' for more details
The system you build on is a 64-bit linux pc and that the host system you wish to build for is i686-pc-aros. Then tries to find/locate the compiler to be able to accomplish that task... and tells you it failed in locating the (correct) compiler ("checking whether the C compiler works... no")

You can check that yourself by opening a terminal and entering the following command:
Code: [Select]
i686-pc-aros-gccor
Code: [Select]
i386-aros-gccAnd in case that returns some output other than "command not found" then you should be good to go.

Where you actually have your cross-compiler located, i have no idea (but you should be able to know where it is  ;) ). If you know where it is located now all that is left for you to do is to make sure the vice build system knows that as as well (*).

If you have been able to correct that, then you would most probably run into the next issue, and am guessing that would be that the vice configure/make scripts are unable to locate some AROS related (source)files.

(*) There are several approaches possible. If you wish to keep the cross compiler separated from your system then you can have a look at the examples that are for example given here: https://stackoverflow.com/questions/10435816/configuring-for-a-compiler-different-than-the-default-while-running-configure
« Last Edit: December 26, 2020, 04:43:40 AM by magorium »



deadwood

  • AROS Developer
  • Senior Member
  • *****
    • Posts: 314
    • Karma: +22/-0
Reply #50 on: December 26, 2020, 07:16:07 AM
@nikos and @magorium

I listed paths to cross compiler, includes and libraries in last post on previous page.



nikos

  • Senior Member
  • ****
    • Posts: 295
    • Karma: +8/-2
    • aspireos
Reply #51 on: December 26, 2020, 11:55:57 AM
Thanks Magorium and Deadwood  :)

I get it.



el-topo

  • Newbie
  • *
    • Posts: 8
    • Karma: +1/-0
Reply #52 on: December 27, 2020, 09:27:28 AM
@deadwood
No problem looking into it, as i wanted to test it anyway (just was not able to do it sooner  :-\ ).

afairc from the bug-report reactions it is an issue specific with the 4.x series of the compiler so indeed it should be fixed automatically with upgrading the compiler.

Thanks to your tip about a possible solution I did some searching too and found a suggestion that you can remove texinfo from the system during the compile. When the compiler can't find texinfo it skips building the docs and continue with the rest. When the compile was finished I put texinfo back again :)

So that is a workaround if one encounters this problem.



nikos

  • Senior Member
  • ****
    • Posts: 295
    • Karma: +8/-2
    • aspireos
Reply #53 on: December 27, 2020, 08:38:56 PM
I have to change --sysroot to sysroot= as the configure did not like that, but seams -L is also a problem?

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=/home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc sysroot=home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development -L /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib
configure: error: unrecognized option: `-L'
Try `./configure --help' for more information
niko@niko-Latitude-D520 ~/vice-emu-code/vice $

This is what I got when I removed everything after .........Development

https://pastebin.com/s1qTGpTd
« Last Edit: December 27, 2020, 08:45:27 PM by nikos »



salvo

  • Legendary Member
  • *****
    • Posts: 898
    • Karma: +12/-4
  • Invalid Civil
Reply #54 on: December 27, 2020, 09:10:38 PM
I did not understand the string to be given to compile a program having a development environment, I will try to do something like some porting if I can :)

TinyAros MagicWB on Laptop MSI X-600, Intel Core 2 Duo 1,8 Ghz, 3 Gb Ram, SSD Samsung 860 Evo 240 Gb, Nvidia 8400m GS 15" Vesa, WifI Atheros AR5006EG

http://tinyaros.flazio.com/home


deadwood

  • AROS Developer
  • Senior Member
  • *****
    • Posts: 314
    • Karma: +22/-0
Reply #55 on: December 27, 2020, 09:14:44 PM
I have to change --sysroot to sysroot= as the configure did not like that, but seams -L is also a problem?

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=/home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc sysroot=home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development -L /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib
configure: error: unrecognized option: `-L'
Try `./configure --help' for more information
niko@niko-Latitude-D520 ~/vice-emu-code/vice $

This is what I got when I removed everything after .........Development

https://pastebin.com/s1qTGpTd

Skip the -L option for now. If it at least compiles, you can hack the Makefile at the end to add the -L parameter



nikos

  • Senior Member
  • ****
    • Posts: 295
    • Karma: +8/-2
    • aspireos
Reply #56 on: December 27, 2020, 09:39:20 PM
I have to change --sysroot to sysroot= as the configure did not like that, but seams -L is also a problem?

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=/home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc sysroot=home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development -L /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib
configure: error: unrecognized option: `-L'
Try `./configure --help' for more information
niko@niko-Latitude-D520 ~/vice-emu-code/vice $

This is what I got when I removed everything after .........Development

https://pastebin.com/s1qTGpTd

Skip the -L option for now. If it at least compiles, you can hack the Makefile at the end to add the -L parameter

Without the -L parameter I get this.

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=/home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc sysroot=home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-pc-aros-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
option checking is yes
checking build system type... Invalid configuration `/home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib': machine `/home/niko/alt-abiv0-linux-i386-d/bin/linux' not recognized
configure: error: /bin/bash ./config.sub /home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development/lib failed
niko@niko-Latitude-D520 ~/vice-emu-code/vice $

https://pastebin.com/HPi7BXGL

Edit: It is obvious that the last line after -d have to be removed.

niko@niko-Latitude-D520 ~/vice-emu-code/vice $ ./configure --host=i686-pc-aros CC=/home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc sysroot=home/niko/alt-abiv0-linux-i386-d/bin/linux-i386/AROS/Development
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-pc-aros-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
option checking is yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-pc-aros
checking for i686-pc-aros-gcc... /home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc
checking whether the C compiler works... no
configure: error: in `/home/niko/vice-emu-code/vice':
configure: error: C compiler cannot create executables
See `config.log' for more details
niko@niko-Latitude-D520 ~/vice-emu-code/vice $

Edit:

What is this?

gcc error -V >&5

« Last Edit: December 28, 2020, 01:03:11 AM by nikos »



magorium

  • Senior Member
  • ****
    • Posts: 253
    • Karma: +7/-0
  • Convicted non contributor
Reply #57 on: December 28, 2020, 05:30:37 AM
I have to change --sysroot to sysroot= as the configure did not like that, but seams -L is also a problem?
In your previous post you wrote that you got it. Apparently you still do not entirely got the message  :)

The configure script seems to want to take 3 parameters by default "--build, --host, --target"

The sysroot option, as well as the -L option are flags that you need to pass on to the (gcc) compiler in order to override whatever nonsense vice config/makefile is producing by default (simply because you use a stand-alone cross-compiler, and vice config/make has no knowledge about that).

In order to pass flags to the compiler you need to set the cflags (or cppflags) environment variable, just as you did for cc.

In case the vice scripts are overriding your custom flags as well , then file a bug-report to their developers website (unless they provide other means to set those flags in a custom way and that are taken into consideration during config/make).

If all that still fails, then afaik the only other option is to do their bidding and mess up your buildystem by providing links to their so wanted i686 compiler, but then pointing towards your i386 named executables). Of course these (file)links then also need to be located inside your path so they can be accessed from everywhere on your system. That is considered bad practising though.

For a list of options that you can pass to the compiler or you wish to know more information about, see https://gcc.gnu.org/onlinedocs/gcc/Option-Index.html#Option-Index

(hint: try to lookup the --sysroot and -L options so that you are able to understand what they are suppose to do).
« Last Edit: December 28, 2020, 05:48:54 AM by magorium »



magorium

  • Senior Member
  • ****
    • Posts: 253
    • Karma: +7/-0
  • Convicted non contributor
Reply #58 on: December 28, 2020, 08:24:02 AM
@deadwood
No problem looking into it, as i wanted to test it anyway (just was not able to do it sooner  :-\ ).

afairc from the bug-report reactions it is an issue specific with the 4.x series of the compiler so indeed it should be fixed automatically with upgrading the compiler.

Thanks to your tip about a possible solution I did some searching too and found a suggestion that you can remove texinfo from the system during the compile. When the compiler can't find texinfo it skips building the docs and continue with the rest. When the compile was finished I put texinfo back again :)

So that is a workaround if one encounters this problem.
Ah, splendid. No idea why i was not ale to think out of the box like that. I am able to confirm that this works splendidly.  :) Thank you for that.

In case wishing to address it more appropriately: apparently you can pass MISSING=texinfo to the gcc configure command. That way you would not have to un/re-install texinfo.

Of course that does require an additional check when to parse this option, e.g. >= texinfo5 (as the the backwards compatibility seems to be  introduced with version 5).

Ah well, just as much use your workaround for the moment in anticipation on the new compiler  :)


nikos

  • Senior Member
  • ****
    • Posts: 295
    • Karma: +8/-2
    • aspireos
Reply #59 on: December 28, 2020, 10:56:13 AM
I have to change --sysroot to sysroot= as the configure did not like that, but seams -L is also a problem?
In your previous post you wrote that you got it. Apparently you still do not entirely got the message  :)

The configure script seems to want to take 3 parameters by default "--build, --host, --target"

The sysroot option, as well as the -L option are flags that you need to pass on to the (gcc) compiler in order to override whatever nonsense vice config/makefile is producing by default (simply because you use a stand-alone cross-compiler, and vice config/make has no knowledge about that).

In order to pass flags to the compiler you need to set the cflags (or cppflags) environment variable, just as you did for cc.

In case the vice scripts are overriding your custom flags as well , then file a bug-report to their developers website (unless they provide other means to set those flags in a custom way and that are taken into consideration during config/make).

If all that still fails, then afaik the only other option is to do their bidding and mess up your buildystem by providing links to their so wanted i686 compiler, but then pointing towards your i386 named executables). Of course these (file)links then also need to be located inside your path so they can be accessed from everywhere on your system. That is considered bad practising though.

For a list of options that you can pass to the compiler or you wish to know more information about, see https://gcc.gnu.org/onlinedocs/gcc/Option-Index.html#Option-Index

(hint: try to lookup the --sysroot and -L options so that you are able to understand what they are suppose to do).

Thank you :)
I will try to figure it out. I'm very much afraid it will go nowhere, but I do not give up just yet ;)

Does it matter that my build gcc is 7.5 and AROS use gcc version 4.6.4?

I know it worked building AROS so I guess not.
It stops here.

Thread model: single
gcc version 4.6.4 (GCC)
configure:4509: $? = 0
configure:4498: /home/niko/toolchain-alt-abiv0-i386/i386-aros-gcc -V >&5
i386-aros-gcc: error: unrecognized option '-V'
i386-aros-gcc: fatal error: no input files
compilation terminated.
« Last Edit: December 28, 2020, 11:37:18 AM by nikos »