I have been using GCC 8.3.0. Adding __attribute__((weak)) for these symbols helped also but I decided to fallback from GCC10 to GCC8 because this SDL build is a maintenance release.
I will try to get GCC10 build working on master (SDL 2.0.16).
Thanks for your help. I will give my first impressions. At first I tested gcc10 and gcc09 without success. Too many errors even with -std=c++11 -mcrt=... I managed to get my progs compiled with gcc09 with -std=c++11 -athread=native (or something like that not sure of the syntax).
I compiled a hello prog and a more complex amiga program with sucess. I notice a problem though. In one .cc file (located in work:dir2 ) I declared an include like #include "work:dir/file.h"
I had an error during compilation File not found work:dir2/work:dir/file.h As you see, there is a bug here.
For the moment, I change the include by /work/dir/file.h in the linux way. I don't really like it.
Since a lot of months without an amiga to love, I was lost. Now I feel happiness again with a Sam Flex 800 .
I see a few days ago GCC 10.0.3 out, is it ok to ask you if you can bring that one to us as well?:)
@Yescop
Quote:
At first, I tested gcc10 and gcc09 without success. Too many errors even with -std=c++11 -mcrt=... I managed to get my progs compiled with gcc09 with -std=c++11 -athread=native (or something like that not sure of the syntax).
You _should always_ use -athread=native, if you want to compile anything with the latest GCC on OS4. At least for now, while it still not enabled by default.
Edited by kas1e on 2021/4/10 11:58:28 Edited by kas1e on 2021/4/10 11:59:10
@sTix I build 10.3.0 from sources on cross-compiler: all fine. Also, build with new cross-compiler latest SDL2 and test it together with building few games (ogles2/gl4es/warp3d based): all fine.
More of it, sizes of binaries start to be even smaller in comparison with 10.1.0 and 10.2.0, which means that some optimization takes place again in GCC 10.3.0, cool. A little bit smaller, but still.
Will use 10.3.0 since now, thanks a bunch!
ps. I see after my comment Sebastian accepts your old pool request, may be worth to pull request GCC 10.3.0 now, just in case it will be approved after month or two :)
Yes, code density seems to have gone up slightly. I would be interesting to do some performance benchmarking as well but that's a bit to ambitious for me. I just assume that newer is better.
The "other" switch i mentioned is an LD one, nothing to do wtith gcc
Quote:
--no-keep-memory ld normally optimizes for speed over memory usage by caching the symbol tables of input files in memory. This option tells ld to instead optimize for memory usage, by rereading the symbol tables as necessary. This may be required if ld runs out of memory space while linking a large executable.
Since LD is still at version 2.32.2 since gcc 5.4.0 i doubt this will change.
That option might have bought me some more time depending on how much memory it really would have saved.
@sTix I would like to ask one thing, which possible might be my fault, but it seems weird to me. I am developing a new application for AmigaOS 4, where I try to split the code to multiple small files. I use GCC 8 natively on AmigaOS to compile it, as well as on linux with cross compiler.
So, with GCC 8 I have not issues to compile it at all, but with your GCC 10.1.0 and 10.3.0 on linux using cross compiler I get "multiple definition" errors, like below:
src/gui.o:(.sbss+0x0): multiple definition of `ApplicationBase'
src/libshandler.o:(.sbss+0x0): first defined here
src/gui.o:(.sbss+0x4): multiple definition of `IApplication'
src/libshandler.o:(.sbss+0x4): first defined here
src/gui.o:(.sbss+0x8): multiple definition of `IntuitionBase'
src/libshandler.o:(.sbss+0x8): first defined here
src/gui.o:(.sbss+0xc): multiple definition of `IIntuition'
src/libshandler.o:(.sbss+0xc): first defined here
src/gui.o:(.sbss+0x10): multiple definition of `LabelBase'
src/libshandler.o:(.sbss+0x10): first defined here
src/gui.o:(.sbss+0x14): multiple definition of `ILabel'
src/libshandler.o:(.sbss+0x14): first defined here
collect2: error: ld returned 1 exit status
I wonder why this shows up only on GCC 10 and not with GCC 8. Also tried GCC 9 on Linux with cross compiling, and it compiles the same code just fine.
Is this something that should be looked further? Could it be a problem on the way I compile the GCC 10 from the master branch of your repo https://github.com/sodero/adtools?
@capehill Thank you so much for your reply. I will check your recommendations. The thing is that I don't define the same things in multiple places, it is happening because of inclusion of the global.h file, which has some definitions there. I am going to find a way to fix it.