Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
146 user(s) are online (103 user(s) are browsing Forums)

Members: 4
Guests: 142

pjs, afxgroup, Maijestro, BillE, more...

Headlines

 
  Register To Post  

binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@All

So, with big and valuable help from MightyMax we were able to go till the moment that we have first _working_ native amigaos4 builds of binutils 2.40, which i test only in some "basics" tests such as:

1). creating of simple binaries
2). creating of binaries using sobjs
3). creating of .a archives
4). creating/testing bunch of test cases with all sort of different sobjs/binary and constructor/destrucotrs usage.

So far, that where we are with it, but your help as developer (not as user) is need it to betatest it too, to find out amigaos4 specific to native build bugs which or didn't happens on previous binutils from adtools and we need to recreate them, or , the bugs which you want to be fixed which wasn't fixed in old binutils as well.

Betatesting only for brave ones, and for ones who know what he do. There is first beta:

https://kas1e.mikendezign.com/aos4/bin ... _binutils_2.40_beta01.zip

It is expected that you do have latest GCC installed for being in sync (such as 11.2 or 11.3).

That how you need to test it:

1). rename your current SDK Dir to SDK_save
2). copy all the content of SDK_save to SDK dir again (so to have SDK dir with which you will play with, but having backup of it in SDK_save)
3). Unpack the content of the new binutils beta to the same directories as it in archive (i.e. to SDK/gcc/) of your SDK dir which you will use as tests.
4). reboot
5). test in the shell that you have new "as", "ld", and "ar" installed for sure, by typing in the shell "as -V", "ld -V" and "ar -V", it should show binutils 2.40 year 2023.

Now try to build your old projects with, etc.

Also, please, the ones who have skills (Joerg, Oliver, anyone else who had good skills about internals of amigaos4), plz take a look at the documentation Max and we tried to cookie up and if something is wrong about let us know plz :

https://github.com/AmigaLabs/binutils-gdb/wiki

It is really interesting reading and a try to summarize everything which wasn't ever documented anywhere about. Maybe someday it can fits into documentation or PDF of some sort once it will be good enough.

In the end of all we should thank Max working on all of this , and Joerg, Oliver and Frank for their valuable help with all of this !

Any issue you find, you can report there or directly on https://github.com/AmigaLabs/binutils-gdb/issues

Thanks!


Edited by kas1e on 2024/1/2 11:10:19
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: binutils 2.40 first native(!) beta tests !
Site Builder
Site Builder


See User information
That is a great achievement, MightyMax and Kas1e.
Thank you for all the hard work.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@kas1e

Im not home right now, but will give it a while once im able too.

Thank you very much for all the work

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Great news, well done!

Memento audere semper!
Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Recompiled FlashMandelNG 4,9 (all flavours versions) without errors.
A really fast test shows all runs ok but executables are about 10% bigger against latest SDK release (based on Walkero work).

GCC versions tested - 11,2.0 and 6.4.0

Memento audere semper!
Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
@flash

As a first report that sounds great. For the bigger files, I'm not sure where the root case for that is. If it is the ppc-amigaos specific changes, or general changes in binutils in the last years.

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Great work!

I tried the new binutils + gcc-11.3.0 + clib4 with a number of small standard C programs without any issues. I did not check if the file sizes, though.

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Thanks for the update. Unfortunately, my problem with the manual execution of the clib2 constructors and destructors still persists with the new binutils. I've posted a short sample program that demonstrates the issue here: https://forum.hyperion-entertainment.com/viewtopic.php?f=26&t=4964

I've tried to compile the sample program with gcc 11.2.0 and kas1e's latest binutils but it still crashes. The address is somewhat curious though: Grim Reaper reports the address as 0xc0defacc ....

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just can't stay away
Just can't stay away


See User information
@softwarefailure
Your _fini(void) function can't work because int j (why static?) isn't initialized to 0 and therefore __DTOR_LIST__[j+1]() may be a random memory address and not a destructor function pointer from __DTOR_LIST__[].
Additionally it may try to call one function too much, i.e. the NULL pointer from crtend.o at the end of __DTOR_LIST__[], but I'm not sure.

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Quote:

Your _fini(void) function can't work because int j (why static?) isn't initialized to 0 and therefore __DTOR_LIST__[j+1]() may be a random memory address and not a destructor function pointer from __DTOR_LIST__[]


As per the C standard, static variables are auto-initialized to 0 so it's not necessary to explicitly initialize them to 0. Nevertheless, I've just tried to initialize "j" to 0 explicitly but unsurprisingly this doesn't make a difference and the program crashes in the very same way with an instruction fault at address 0xC0DEFACC (sic!)

As to why "j" is declared static, no idea. As I said in the thread over at the Hyperion forums I took this code straight from clib2. It's the standard clib2 constructor/destructor (de)initialization code so I don't think there's anything wrong with it.

According to afxgroup's reply on the Hyperion forums it's a bug in the binutils which don't NULL-terminate the ctor/dtor lists on linking, thereby causing invalid ctors/dtors getting called. That's why I was hoping the latest binutils would fix the issue but it's still there :(

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just can't stay away
Just can't stay away


See User information
@softwarefailure
Quote:
As to why "j" is declared static, no idea. As I said in the thread over at the Hyperion forums I took this code straight from clib2.
If you take any function from the clib2 sources you can be 80% sure it has a serious bug
That was one of the reason it was replaced more than 20 years ago by newlib...

Quote:
According to afxgroup's reply on the Hyperion forums it's a bug in the binutils which don't NULL-terminate the ctor/dtor lists on linking, thereby causing invalid ctors/dtors getting called
That's utter nonsense, unlike for .init/.fini it's not the job of binutils to terminate the .ctors/.dtors array with a NULL pointer, you have to do it yourself (it's of course automatically done when using the standard C library startup and linker script)
crtbegin.c/o or in your case child.c/o:
static void (*__CTOR_LIST__[1]) (void__attribute__(usedsection(".ctors")) = (void *)~0;
static 
void (*__DTOR_LIST__[1]) (void__attribute__(usedsection(".dtors")) = (void *)~0;
crtend.c/o:
static void (*__CTOR_LIST__[1]) (void__attribute__(usedsection(".ctors")) = NULL;
static 
void (*__DTOR_LIST__[1]) (void__attribute__(usedsection(".dtors")) = NULL;

If you don't link with crtend.o, or custom code with the same contents, as last object file that's the reason for the missing NULL-termination of .ctors/.dtors.

Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
Oh man, thanks a lot, you're my personal hero. Looks like amigans.net is the place to turn to now when having problems with the SDK. I've been on this for months and asked several people and was repeatedly told even by SDK team members that it's binutils fault and "there is nothing you can do about it at moment" and they were working on new binutils. But apparently all I need to do is manually including crtbegin.o and crtend.o on the link line. So I'm linking like this now:

gcc -nostartfiles -athread=single -mcrt=clib2 -o test crtbegin.o obj1.o obj2.o obj3.o objN.o crtend.o


This works nicely so once again thanks a lot for your help!

Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@all

So, i tested a full ScummVM build with binutils 2.40 and while it compiles fines it somehow breaks at linker stage:


LINK     scummvm
Development
:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libpng16.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libpng16.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libvpx.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libvpx.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libz.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libz.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libssl.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libssl.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libcrypto.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /SDK/local/newlib/lib/libcrypto.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 3 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 4 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 5 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 6 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libstdc++.so: .dynsym local symbol at index 7 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libssp.so: .dynsym local symbol at index 2 (>= sh_info of 2)
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: /Development/Coding/SDK/gcc/bin/../lib/gcc/ppc-amigaos/11.3.0/../../../libssp.so: .dynsym local symbol at index 3 (>= sh_info of 2)


The binary gets linked but crashes (right now, maybe it silently exits if i tweak the code a bit, need to test, but there is definitely something wrong)

sorry

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@Raziel

Confirmed with a fresh build and minimum engines...ld has a bug in it's 2.40 incarnation

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
@Raziel

Did you even re compile all the used libraries, like libvpx.so ?

And if you start the program, do you get a GR, and if yes, can you give me the generated stacktrace?

Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@MigthyMax

I need to recompile *all* used dependancies???
Those are third party libraries, i didn't even know where to start...some of them are pretty old already


Here you go...
Crash log for task "scummvm"
Generated by GrimReaper 53.19
Crash occured in module  at address 0x00000000
Type of crash
ISI (Instruction Storage Interruptexception
Alert number
0x80000003

Register dump
:
GPR (General Purpose Registers):
   
0D8D9CFDC 52958FF0 6B70366B 54B619FC 54B619FC 00000000 00000040 00000003 
   8
00000000 00000000 52959064 52959050 0000079C 4FFA0758 57EF08F0 00000001 
  16
6D930CD0 DFAE1600 61EAA010 00000000 52959DA8 76581794 00000008 57EF08E0 
  24
00000001 57EF08D0 00000000 00000000 02B40000 57ED6A10 4FF97890 52958FF0 


FPR 
(Floating Point RegistersNaN Not a Number):
   
0:             -nan    -3.48083e+307    -1.28658e+308    -1.28658e+308 
   4
:    -1.28658e+308       4.5036e+15       4.5036e+15       4.5036e+15 
   8
:              224             2206       4.5036e+15              256 
  12
:                1     2.60908e-304                0                0 
  16
:                0                0                0                0 
  20
:                0                0                0                0 
  24
:                0                0                0                0 
  28
:                0                0                0               -

FPSCR 
(Floating Point Status and Control Register): 0x82004000


SPRs 
(Special Purpose Registers):
           
Machine State (msr) : 0x4000B030
                Condition 
(cr) : 0x58F90000
      Instruction Pointer 
(ip) : 0x00000000
       Xtended Exception 
(xer) : 0x57EA1134
                   Count 
(ctr) : 0x00570001
                     Link 
(lr) : 0x00000000
            DSI Status 
(dsisr) : 0x85027002
            Data Address 
(dar) : 0x58F90A44



680x0 emulated registers
:
DATA00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
ADDR
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
FPU0
:                0                0                0                0 
FPU4
:                0                0                0                0 



Symbol info
:
Instruction pointer 0x00000000 belongs to module "" (HUNK/Kickstart)

Stack trace:
    
0x00000000 symbol not available
    
[common/streamdebug.cpp:1137scummvm:_ZN6Common10BaseStringIcE7cStrLenEPKc()+0x3c (section 12 0xC89130)
    [
backends/platform/sdl/sdl.cpp:72scummvm:_ZN6Common6StringC1EPKc()+0x48 (section 12 0x94C4)
    [
backends/platform/sdl/sdl.cpp:511scummvm:_ZN11OSystem_SDL7initSDLEv()+0x78 (section 12 0x6510)
    
scummvm:_ZN11OSystem_SDL4initEv()+0x4c (section 12 0x51DC)
    
scummvm:_ZN15OSystem_AmigaOS4initEv()+0x9c (section 12 0x105B8)
    [
backends/platform/sdl/amigaos/amigaos-main.cpp:74scummvm:main()+0x25c (section 12 0x1024C)
    
native kernel module newlib.library.kmod+0x00002614
    native kernel module newlib
.library.kmod+0x00003340
    native kernel module newlib
.library.kmod+0x00003864
    scummvm
:_start()+0x1e0 (section 12 0x3288)
    
native kernel module dos.library.kmod+0x0002a458
    native kernel module kernel
+0x00059e04
    native kernel module kernel
+0x00059e7c

PPC disassembly
:
 
fffffff8XXXXXXXX   illegal address
 fffffffc
XXXXXXXX   illegal address
 00000000
XXXXXXXX   illegal address
 00000004
XXXXXXXX   illegal address
 
00000008: XXXXXXXX   illegal address

System information
:

CPU 
 Model
P.ASemi PWRficient PA6T-1682M VB1 
 CPU speed
1800 MHz 
 FSB speed
900 MHz 
 Extensions
altivec 

Machine 
 Machine name
AmigaOne X1000 
 Memory
2097152 KB 
 Extensions
bus.pci bus.pcie

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: binutils 2.40 first native(!) beta tests !
Just popping in
Just popping in


See User information
@Raziel

Quote:
I need to recompile *all* used dependancies???


No, I just was wondering if you did.

Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@MigthyMax

Phew, you got me sweating there

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@Max
On the http://sourceware.org/bugzilla/show_bug.cgi?id=25135 , binutil's authors point out it was an issue in binutils in 2019, and were then fixed. I assume it should be in 2.40 as well , as it were released in 2022-12-31 ?

They also point out this kind of warnings are harmless, and have no impact on creating a binary, so, maybe crash in the binary Raziel have is different inssue, not related to those warnings (through, still strange , why he still have them, if it was fixed in 2019?)

@Raziel
Can you double-check if you indeed use all the new binutils (and ld, and all other stuff) ? Do you run it from makefile how, like "ld" , or like "ppc-amigaos-ld" ? And if so, if you run it from pure amigaos4 shell, or from "sh" in amigaos shell ? What i mean, can you mimic the same environemnt , and then in it type "ld -V" , "as -V" and "ar -V" , so we will 100% sure that all of the binaries takes by Scummvm's path are taken of the proper-new versions ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: binutils 2.40 first native(!) beta tests !
Home away from home
Home away from home


See User information
@kas1e

There *is* indeed still a problem inside ScummVM, which I haven't had the chance to test thoroughly yet.

I will do so once I get back home.

I'll also try to give feedback on all your pointers, then.

There is a slim chance that the 2.40 based binary, instead of crashing immediately, simply exited and in turn caused the crash mentioned above, but either way, it shouldn't crash or exit in the first place.

Please bear with me while I don't have access to my gear.

And thank you all for taking the time

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
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-2023 The XOOPS Project