Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
17 user(s) are online (11 user(s) are browsing Forums)

Members: 0
Guests: 17

more...

Support us!

Headlines

 
  Register To Post  

Weird errors in GCC 11.2.0 from AOS4 SDK
Just popping in
Just popping in


See User information
Hi everyone,

I hope this is the correct board for my question. After I update my SDK with the latest version and set GCC 11.2.0 as default I get weird errors when compiling my project.

Sometimes (not always) it throws errors for not finding <iostream> in one class - but in all other classes it compiles normally including <iostream>. This error happens occasiionally and it always refers to a different class.

If these errors are not happening then it complains about near endless errors regarding things like:
(.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.0+0x58): undefined reference to __gthread_active_p'
ld: Dwarf Error: found dwarf version '
0', this reader only handles version 2, 3 and 4 information

but this also does not happen everytime.

I added -gstabs to my CFLAGS as well as -fno-threadsafe-statics - but no change.

It is really acting randomly and incomprehensible. Any idea what might be wrong here? Is the 11.2.0 version within the SDK instable? So far I used GCC 2.4.3 (IIRC) from the previous SDK. That one compiled everything fine without any problems. I got the hint to use -lpthread but that did not work either.

I meanwhile tested all versions of GCC which are in the latest SDK. The only one which does not throw such errors is 6.4.0 - but that one throws different errors:
src/WizardGroundsC.cc:200undefined reference to `std::__throw_bad_array_new_length()' o/WindowC.o: In function `std::_Rb_tree_iterator<std::pair<int const, GadgetC*> >&& std::forward<std::_Rb_tree_iterator<std::pair<int const, GadgetC*> > >(std::remove_reference<std::_Rb_tree_iterator<std::pair<int const, GadgetC*> > >::type&)': /DH1/Prog/SDK/gcc/include/c++/11.2.0/bits/stl_pair.h:(.text._ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiP7GadgetCEEE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiP7GadgetCEEE8allocateEjPKv]+0x68): undefined reference to `std::__throw_bad_array_new_length()' o/PlayerC.oIn function `std::vector<BuildingC*, std::allocator<BuildingC*> >::end()': /DH1/Prog/SDK/gcc/include/c++/11.2.0/bits/alloc_traits.h:(.text._ZN9__gnu_cxx13new_allocatorIP9BuildingCE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorIP9BuildingCE8allocateEjPKv]+0x64): undefined reference to `std::__throw_bad_array_new_length()' o/PlayerManagerC.o: In function `PlayerManagerC::~PlayerManagerC()'src/PlayerManagerC.cc:9undefined reference to `std::__throw_bad_array_new_length()' o/MenusC.o: In function `MenusC::~MenusC()': src/MenusC.cc:10: undefined reference to `std::__throw_bad_array_new_length()' o/MenusC.o:src/MenusC.cc:67more undefined references to `std::__throw_bad_array_new_length()' follow make: *** [bin/WizardGrounds] Error 1


Maybe I stick with that version and try to fix things. But as said version 2.4.3 did compile everything fine.
No clue what I still can try to get one of the later GCC versions working.

Thank you in advance for your help.

Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Home away from home
Home away from home


See User information
@Reth
Are you sure you have -athread=native and -lpthread in your string ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Just popping in
Just popping in


See User information
I only had -lpthread but that throwed a linker error. -athread=native I did not yet try (but -fno-threadsafe-statics).

Need to try that.

Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Amigans Defender
Amigans Defender


See User information
Are you using g++ when linking? Otherwise if you are using gcc you have to add -lstdc++

i'm really tired...
Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Home away from home
Home away from home


See User information
@Reth
Quote:
It is really acting randomly and incomprehensible. Any idea what might be wrong here?
Try using a much larger stack size in the shell, newer versions of GCC may need more stack than old ones.

Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Just popping in
Just popping in


See User information
Thank you all!

@afxgroup:
I am using g++.

@joerg:
I have stacksize 1000000 in the icon of Codebench + 1000000 stacksize set within the Codebench settings.

Adding
-athread=native
finally did the job! - Thanks @kas1e!


I still get some warnings though regarding newlib. Will post the output in a bit.

OK, hier it is:
/SDK/newlib/lib/libc.a(stub_wcsftime.o): warningnewlib.library 53.68 required for wcsftime() /SDK/newlib/lib/libc.a(stub_getwc.o): warningnewlib.library 53.65 required for getwc() /SDK/newlib/lib/libc.a(stub_ungetwc.o): warningnewlib.library 53.65 required for ungetwc() /SDK/newlib/lib/libc.a(stub_putwc.o): warningnewlib.library 53.65 required for putwc()


Not sure which part of my code (or some of the libs) do access these functions - and strangely enough I have version 53.80 of newlib.library installed.


Edited by Reth on 2025/4/20 17:07:21
Edited by Reth on 2025/4/20 17:12:51
Go to top
Re: Weird errors in GCC 11.2.0 from AOS4 SDK
Home away from home
Home away from home


See User information
@Reth
Quote:
I still get some warnings though regarding newlib. Will post the output in a bit.

OK, hier it is:
/SDK/newlib/lib/libc.a(stub_wcsftime.o): warningnewlib.library 53.68 required for wcsftime() ...

Not sure which part of my code (or some of the libs) do access these functions - and strangely enough I have version 53.80 of newlib.library installed.
I added such warning whenever I added new functions to newlib.library, and removed them again as soon as the min. required version was publicly relased.
You have version 53.80 and of course it's working with that version, but not all users of your software may have it, for example if they are still using AmigaOS 4.0, or an old version of AmigaOS 4.1 without having installed all updates of it.
If you get such newlib warnings simply add in the ReadMe of your software that newlib.library version 53.68 or newer is required to use it.

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