Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
132 user(s) are online (112 user(s) are browsing Forums)

Members: 2
Guests: 130

Mr_byte, Amigafreak02, more...

Support us!

Headlines

 
  Register To Post  

Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
I'm trying to build the GCC 11 cross-compiler from adtools, and am stuck. AFAIK, I've installed all the dependencies. However, it's failing with the following error:
crtbegin.c:59:15note: while referencing ‘__DTOR_LIST__’
   59 
| static void (*__DTOR_LIST__[1]) (void__attribute__(( usedsection(".dtors"), aligned(sizeof(void (*)(void))) ));
      |               ^~~~~~~~~~~~~
Compiling crtend.[lib.threadsafe]
Compiling crtend.[lib.threadsafe/soft-float]
Compiling crtend.[lib.threadsafe/small-data]
Compiling crtend.[lib.threadsafe/baserel]
Compiling c.lib_rev.[obj/libc]
Compiling ctype_isalnum.[obj/libc]
In file included from ctype_headers.h:40,
                 
from ctype_isalnum.c:35:
locale_headers.h:44:10fatal errorlibraries/locale.hNo such file or directory
   44 
#include <libraries/locale.h>
      
|          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.


Yes, the AmigaOS SDK has been successfully downloaded, and I saw the SDK being unarchived.

I'm building with:
- binutils 2.23.2
- coreutils 8.27
- gcc 11

Has anyone encountered this? If so, how do I fix it?

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@Hans

Looks like I missed:
bin/gild checkout gnulib for-coreutils-8.27

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@Hans

Ugh! The build finished, but only some of the tools are there (e.g., ppc-amigaos-addr2line, ppc-amigaos-ld). The actual compiles (ppc-amigaos-gcc & ppc-amigaos-g++) are missing.

That's enough for today...

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Not too shy to talk
Not too shy to talk


See User information
@Hans

What about using Walkero's amigagccondocker Ubuntu ?

https://hub.docker.com/r/walkero/amigagccondocker

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Just popping in
Just popping in


See User information
Regarding the missing include from the SDK, this can happen if you have a broken lha installed in Ubuntu. All versions that come with Ubuntu do not work correctly.

This should be a working version, but you need to install it manually (download, ./configure, make install, ...): https://github.com/jca02266/lha

Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Just can't stay away
Just can't stay away


See User information
I've seen this before and can confirm this is caused by lhasa not being able to extract the .lha files properly when there are empty directories. As a side note, some files that used to be in base.lha are now in execsg_sdk .lha, in case anyone reading this couldn't find some files.

Here's some links about it.

https://forum.hyperion-entertainment.com/viewtopic.php?t=4767
https://github.com/fragglet/lhasa/issues/31
https://github.com/fragglet/lhasa/issues/37
https://github.com/sba1/adtools/issues/112 (1st comment)
https://github.com/sba1/adtools/pull/131
https://github.com/sba1/adtools/pull/133


Edited by MickJT on 2023/9/15 7:58:33
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Quite a regular
Quite a regular


See User information
@Hans

The easiest thing is probably do use Docker, as suggested above. Otherwise, you can clone https://github.com/3246251196/adtools_testing and, tldr:
./adt -b

There are a number of options which may be of interest, but that - alone - will create for you the Xcompiler that you originally wanted.

The script will also tell you, before building, if you will have any unmet dependency packages - including - the lack of an LHA extractor that actually works.

In a nutshell, half of adtools_testing is a wrapper around adtools and the other half is a way to build tests / add tests ready for deployment on an AmigaOne.

Options to consider are things like using the alternative clib2 by afxgroup (e.g. ./adt -b -e beta10)

You also do not need to checkout coreutils unless you are actually interested in building them, or, you are trying to create a native version of the compiler package to transfer to an AmigaOne machine. Further, coreutils 8 needs to be fixed in ADTOOLS since it will not successfully build right now.

If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@rjd324

Docker is a backup option, but I'd rather have the cross-compiler run directly instead of in a container.

Quote:
Otherwise, you can clone https://github.com/3246251196/adtools_testing and, tldr:

Thanks. I wasn't aware of that.

Quote:
You also do not need to checkout coreutils unless you are actually interested in building them, or, you are trying to create a native version of the compiler package to transfer to an AmigaOne machine. Further, coreutils 8 needs to be fixed in ADTOOLS since it will not successfully build right now.

It would be nice if such things could be in the readme...

So, I need to switch back to coreutils 5? If coreutils isn't needed, then why would it interfere with building the cross-compiler? First, I had the missing SDK headers error (despite the SDK being unarc'd), then gcc and g++ don't get built after I executed: bin/gild checkout gnulib for-coreutils-8.27

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Quite a regular
Quite a regular


See User information
You probably did not specify the "gcc-cross" target when invoking make. In that case, adtools assumes you want to build a cross compiler *and* a native compiler. The native compiler attempts to package everything up ready for an SDK release and so also uses coreutils.

If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@rjd324

Quote:
You probably did not specify the "gcc-cross" target when invoking make.

Nope. I did specify the gcc-cross target. And, there's no way to build the OS4 native compiler without ppc-amigaos-gcc and ppc-amigaos-g++...

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Quite a regular
Quite a regular


See User information
Fine. I think Coreutils is a red-herring anyway. Your initial error is complaining during the build of clib2 due to the use of a subpar version of LHA.

In summary,

- Use a known working version of LHA and use adtools repo
- or, use adtools_testing with ./adt -b
- and know that coreutils 8 should not be used for now

If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@rjd324

Quote:
Fine. I think Coreutils is a red-herring anyway. Your initial error is complaining during the build of clib2 due to the use of a subpar version of LHA.

I doubt that's the problem. I installed lhasa, as per the instructions in the adtools readme. I can also literally see it unarchiving the SDK's archives in the output printed to the terminal. The files were there.

However, the above doesn't matter, because that error went away after I executed: bin/gild checkout gnulib for-coreutils-8.27

After that, "make -C native-build gcc-cross" completed without error, but ppc-amigaos-gcc and ppc-amigaos-g++ were missing. At least, I didn't see an error at the time.

Quote:
- or, use adtools_testing with ./adt -b
- and know that coreutils 8 should not be used for now

I'll try the last one first. Might need to delete everything and start from scratch.

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Quite a regular
Quite a regular


See User information
lhasa _does not work_ for later version of the SDK. It will not report an error either, it will just not correctly extract.

You should notice that the ReadMe.md has updated since last night too.

If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@rjd324

Quote:
lhasa _does not work_ for later version of the SDK. It will not report an error either, it will just not correctly extract.

Good to know, albeit annoying.

Quote:
You should notice that the ReadMe.md has updated since last night too.


It hasn't been merged back into the main adtools repository yet. That still says:

"The building should succeed, if all dependencies are met (e.g., libgmp-dev, libmpc-dev, libmpfr-dev, lha | lhasa)."

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Site Builder
Site Builder


See User information
@Hans
The other thing you can do with my docker images is to run it, and by having a mounted volume, copy /opt/ppc-amigaos and /opt/sdk into your host machine and use them like if you had them compiled on your system. The docker images use Ubuntu, so it should be compatible.

If you want to compile it yourself, at:
https://github.com/walkero-gr/AmigaGCC ... cripts/compile-adtools.sh

you can find a script I use to do the compilation of the adtools, and at:
https://github.com/walkero-gr/AmigaGCC ... /main/base/os4/Dockerfile

you can see what exactly I set up in the system, before I use the script above.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@all

I have now successfully built the GCC 11 cross-compiler. Thanks for your help.

Building GCC 5 failed, though, with compiler error such as:
adtools/gcc/repo/gcc/graphite-interchange.c:443:19error‘isl_space_add_dims’ was not declared in this scopedid you mean ‘isl_set_add_dims’?
  
443 |   isl_space *d2 isl_space_add_dims (d1isl_dim_inn);


I tried building it because I need a compiler that still supports the P1022's SPE. Trying GCC 6 now...

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
... and GCC 6 is failing in a similar manner:
code]graphite-isl-ast-to-gimple.c:2903:16: error: ‘isl_id_alloc’ was not declared in this scope; did you mean ‘isl_vec_alloc’?
2903 | isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
| ^~~~~~~~~~~~
| isl_vec_alloc
[/code]

Any idea on what broke? What do I have to do to make this work?

EDIT: This seems to be caused by an external dependency:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248674

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
I got past the ISL problem by using the patch in the link I shared above. Now it's failing while building clib2 with:
native-build/gcc-cross-build-6.4.0/gcc/as: 106exec: -mppcnot found


This is when assembling crt0.S

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Trouble building GCC 11 cross-compiler on Ubuntu
Home away from home
Home away from home


See User information
@all

I've managed to get gcc 6 built too by using the SDK's clib2. The adtools project is suffering from a bit of bitrot, with things that used to work breaking.

Ideally we'd just use the latest GCC. Unfortunately, support for the SPE was deprecated in GCC 8, and removed in GCC 9. So, we need version GCC 7 or older.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project