aros-development-team / AROS

Main AROS repository for active development. Contains the main Operating System components and Build System.
http://www.aros.org
Other
368 stars 60 forks source link

Unable to compile for linux-x86_64 target #627

Closed felmur closed 10 months ago

felmur commented 10 months ago

Describe the bug The repository does not compile

Steps to reproduce the behavior: git clone https://github.com/aros-development-team/AROS.git cd AROS git clone https://github.com/aros-development-team/contrib.git ./configure --target=linux-x86_64 make

Expected behaviour It will compile

Architecture Archlinux fully updated, with kernel 6.5.7-arch1-1

CPU x86_64

Additional context When I enter make it runs for about 15 minutes and then get's a compile error:

Compiling  rom/dos/displayerror.c 
Compile failed: /home/felice/AROS/bin/linux-x86_64/tools/crosstools/x86_64-aros-gcc -iquote ./ -iquote /home/felice/AROS/rom/dos/.. -iquote /home/felice/AROS/rom/dos -iquote .  -m64 -mcmodel=large -mno-red-zone -mno-ms-bitfields -O2 -fno-omit-frame-pointer -fno-common -Wno-pointer-sign -Wno-parentheses -I/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_PERSONAL -DUSE_EXEC_DEBUG -D__DOS_NOLIBBASE__ -DISODATE="2023-10-20" -DREPOTYPE="Git" -DREPOREVISION="d417493f41" -DREPOID="https://github.com/aros-development-team/AROS.git" -DDOCACHECLEAR -DAROS_CPU="x86_64" -I/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include -include /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/dos_deflibdefs.h -D__SRCFILENAME__="rom/dos/displayerror.c" -c displayerror.c -o /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/displayerror.o
In file included from /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/proto/dos.h:44:0,
                 from displayerror.c:20:
displayerror.c: In function 'Dos_81_DisplayError':
displayerror.c:72:22: error: 'MSG_STRING_REQUESTTITLE' undeclared (first use in this function)
         DosGetString(MSG_STRING_REQUESTTITLE),  /* "System Requester" */
                      ^
/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/inline/dos.h:2546:32: note: in definition of macro 'DosGetString'
     __inline_Dos_DosGetString((arg1), __DOS_LIBBASE)
                                ^~~~
displayerror.c:72:22: note: each undeclared identifier is reported only once for each function it appears in
         DosGetString(MSG_STRING_REQUESTTITLE),  /* "System Requester" */
                      ^
/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/inline/dos.h:2546:32: note: in definition of macro 'DosGetString'
     __inline_Dos_DosGetString((arg1), __DOS_LIBBASE)
                                ^~~~
displayerror.c:101:32: error: 'MSG_STRING_RETRY' undeclared (first use in this function)
     strcpy(gtPtr, DosGetString(MSG_STRING_RETRY));
                                ^
/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/inline/dos.h:2546:32: note: in definition of macro 'DosGetString'
     __inline_Dos_DosGetString((arg1), __DOS_LIBBASE)
                                ^~~~
displayerror.c:103:32: error: 'MSG_STRING_CANCEL' undeclared (first use in this function)
     strcat(gtPtr, DosGetString(MSG_STRING_CANCEL));
                                ^
/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/inline/dos.h:2546:32: note: in definition of macro 'DosGetString'
     __inline_Dos_DosGetString((arg1), __DOS_LIBBASE)
                                ^~~~
make[1]: *** [mmakefile:1217: /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/displayerror.o] Error 1
[MMAKE] make --no-print-directory TOP=/home/felice/AROS SRCDIR=/home/felice/AROS CURDIR=rom/dos TARGET=kernel-dos --file=mmakefile kernel-dos failed: 512
[MMAKE] Error: Error while running make in rom/dos: No such file or directory
make: *** [Makefile:125: all] Error 10
[felice@plasma AROS]$ 
felmur commented 10 months ago

For the sole purpose of checking for any subsequent errors, I tried to define the missing variables to continue the compilation.

A similar error, i.e. missing references for some variables, also occurs in the errorreport.c file. Variables involved:

MSG_STRING_DISK_NOT_VALIDATED
MSG_STRING_DISK_WRITE_PROTECTED
MSG_STRING_DEVICE_NOT_MOUNTED_INSERT
MSG_STRING_DEVICE_NOT_MOUNTED_REPLACE_TARGET
MSG_STRING_DEVICE_NOT_MOUNTED_REPLACE
MSG_STRING_DISK_FULL
MSG_STRING_NOT_A_DOS_DISK
MSG_STRING_NO_DISK
MSG_STRING_ABORT_BUSY
MSG_STRING_ABORT_DISK_ERROR

Immediately afterwards, the compilation still stops due to the missing file: errorlist.h which is included by the errorlist.c file:

Compiling  rom/dos/errorlist.c 
Compile failed: /home/felice/AROS/bin/linux-x86_64/tools/crosstools/x86_64-aros-gcc -iquote ./ -iquote /home/felice/AROS/rom/dos/.. -iquote /home/felice/AROS/rom/dos -iquote .  -m64 -mcmodel=large -mno-red-zone -mno-ms-bitfields -O2 -fno-omit-frame-pointer -fno-common -Wno-pointer-sign -Wno-parentheses -I/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_PERSONAL -DUSE_EXEC_DEBUG -D__DOS_NOLIBBASE__ -DISODATE="2023-10-20" -DREPOTYPE="Git" -DREPOREVISION="d417493f41" -DREPOID="https://github.com/aros-development-team/AROS.git" -DDOCACHECLEAR -DAROS_CPU="x86_64" -I/home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include -include /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/include/dos_deflibdefs.h -D__SRCFILENAME__="rom/dos/errorlist.c" -c errorlist.c -o /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/errorlist.o
errorlist.c:10:23: fatal error: errorlist.h: No such file or directory
 #include "errorlist.h"
                       ^
compilation terminated.
make[1]: *** [mmakefile:1217: /home/felice/AROS/bin/linux-x86_64/gen/rom/dos/dos/errorlist.o] Error 1
[MMAKE] make --no-print-directory TOP=/home/felice/AROS SRCDIR=/home/felice/AROS CURDIR=rom/dos TARGET=kernel-dos --file=mmakefile kernel-dos failed: 512
[MMAKE] Error: Error while running make in rom/dos: No such file or directory
make: *** [Makefile:125: all] Error 10
[felice@plasma AROS]$ 

The name of the missing file perhaps suggests to me that this is the problem. Ideas?

Kalamatee commented 10 months ago

http://www.aros.org/documentation/developers/git.php

`Preparing the sources to build After cloning the repository(s), git must be told to initialize the submodules that are included in the cloned repository. To do this run the following command in the cloned tree

git submodule update --init --recursive`

felmur commented 10 months ago

Ok, @Kalamatee. Now, I have deleted the directory, git clone AROS, contrib and ports again, executed the commands:

git submodule update --init --recursive
./configure --target=linux-x86_64
make

But the compilation stops again, a little later than before:

Compiling bin/linux-x86_64/gen/rom/partition/partition/partition_end.c
Building AROS/Libs/partition.library ...
[MMAKE] Making workbench-devs-hostdisk-makefile in arch/all-hosted/devs/hostdisk
make[1]: Nothing to do for 'workbench-devs-hostdisk-makefile'.
[MMAKE] Making workbench-devs-hostdisk-fd in arch/all-hosted/devs/hostdisk
Generating AROS/Developer/SDK/fd/hostdisk_lib.fd
[MMAKE] Making workbench-devs-hostdisk-includes in arch/all-hosted/devs/hostdisk
Generating gen/arch/all-hosted/devs/hostdisk/hostdisk/include/hostdisk_libdefs.h
Generating gen/arch/all-hosted/devs/hostdisk/hostdisk/include/hostdisk_deflibdefs.h
[MMAKE] Making workbench-devs-hostdisk-linux in arch/all-linux/hostdisk
Makedepend arch/all-linux/hostdisk/geometry.c ...
Compiling arch/all-linux/hostdisk/geometry.c
Compile failed: /home/felice/AROS/bin/linux-x86_64/tools/crosstools/x86_64-aros-gcc -iquote /home/felice/AROS/arch/all-linux/hostdisk/ -iquote /home/felice/AROS /arch/all-hosted/devs/hostdisk -iquote /home/felice/AROS/arch/all-linux/hostdisk -iquote . -m64 -mcmodel=large -mno-red-zone -mno-ms-bitfields -O2 -fno-omit-frame-pointer -fno-common -Wno-pointer-sign -Wno-parentheses -I/home/happy/AROS /arch/all-unix/devs/hostdisk -I/home/felice/AROS/arch/all-hosted/devs/hostdisk -isystem /home/felice/AROS/bin/linux-x86_64/gen/include -isystem /usr /include -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include-fixed -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_PERSONAL -DHOST_OS_linux -DHOST_OS_ -I/home/felice/AROS/bin/linux-x86_64/gen/arch/all-hosted/devs/hostdisk/hostdisk -include /home/felice/AROS/bin/linux-x86_64 /gen/arch/all-hosted/devs/hostdisk/hostdisk/include/hostdisk_deflibdefs.h -D__SRCFILENAME__="arch/all-linux/hostdisk/geometry.c" -c /home/felice/AROS/arch/all-linux /hostdisk/geometry.c -o /home/felice/AROS/bin/linux-x86_64/gen/arch/all-hosted/devs/hostdisk/hostdisk/arch/geometry.o
In file included from /home/felice/AROS/arch/all-linux/hostdisk/geometry.c:21:0:
/home/felice/AROS/arch/all-hosted/devs/hostdisk/hostdisk_host.h:6:2: warning: #warning hostdisk.device functionality is not implemented on this platform [-Wcpp]
  #warning hostdisk.device functionality is not implemented on this platform
   ^~~~~~~
/home/felice/AROS/arch/all-linux/hostdisk/geometry.c: In function 'Host_DeviceGeometry':
/home/felice/AROS/arch/all-linux/hostdisk/geometry.c:35:26: error: dereferencing pointer to incomplete type 'struct HostInterface'
      ret = hdskBase->iface->ioctl(file, HDIO_GETGEO, &geo);
                           ^~
/home/felice/AROS/arch/all-linux/hostdisk/geometry.c: In function 'deviceProbe':
/home/felice/AROS/arch/all-linux/hostdisk/geometry.c:88:19: error: storage size of 'st' isn't known
      struct stat64 st;
                    ^~
make[1]: *** [mmakefile:150: /home/felice/AROS/bin/linux-x86_64/gen/arch/all-hosted/devs/hostdisk/hostdisk/arch/geometry.o] Error 1
[MMAKE] make --no-print-directory TOP=/home/felice/AROS SRCDIR=/home/felice/AROS CURDIR=arch/all-linux/hostdisk TARGET=workbench-devs-hostdisk-linux --file=mmakefile workbench-devs-hostdisk-linux failed: 512
[MMAKE] Error: Error while running make in arch/all-linux/hostdisk: No such file or directory
make: *** [Makefile:125: all] Error 10

Any Ideas?

Kalamatee commented 10 months ago

don't build inside the source directory - build outside of the source tree.

Kalamatee commented 10 months ago

see http://www.aros.org/documentation/developers/compiling.php#building-aros-in-different-directories

felmur commented 10 months ago

Thanks @Kalamatee, but I had already managed to compile Aros for linux-x86_64 outside the source directory, as you recommended. I tried running it last night and it worked perfectly. Now I will continue my learning and study of this fantastic operating system. Thank you very much. Greetings.

felmur commented 10 months ago

Hello Nick @Kalamatee,

In 2 days I compiled and recompiled AROS + CONTRIB + PORTS. I used your advice:

git clone https://github.com/aros-development-team/AROS.git
cd AROS
git submodule update --init --recursive

git clone https://github.com/aros-development-team/contrib.git
cd contrib
git submodule update --init --recursive
cd ..

git clone https://github.com/aros-development-team/ports.git
cd ports
git submodule update --init --recursive
cd ..
cd ..

makedir linux-x86_64
cd linux-x86_64

../AROS/configure --target=linux-x86_64

make
make contrib
make ports

While AROS compiles fine with target=linux-x86_64, I had problems with some applications under contrib and ports. For some it was necessary to manually download the sources and place them in the "linux-x86_64/bin/Sources" directory, because the remote sites were not responding or the package was no longer available at that link.

For others, as errors remained in the compilation, I removed the relevant folders and the compilation went well (ports/game/[arx | koules | wormwars], ports/graphics/grafx2, ports/text/annotate).

In the end, the operating system is compiled and works, with one exception: all the binary files produced by the compilation of contrib/gcc are NOT executable (even if the related "e" flag is regularly set) or corrupt. In the latest compilation, this happens:

I tried and tried to recompile gcc with: make contrib-gnu-gcc but the situation remains unchanged.

So I tried deleting everything and starting all over again 3 times, without the result changing.

Ideas?

I attach the image of my current desktop.

Regards https://fel.hopto.org/test/aros.png