Comments (21)
added
cxxglue.c
to the clib2 tooThanks! I guess that's not pushed to GitHub yet?
it's live: https://github.com/bebbo/clib2
from amiga-gcc.
Hello @Midar, there were some problems with exceptions in a previous version of Bebbo's GCC, and you can see that there was a long conversation here:
There is a attachment in that issue (Exceptions.zip) which contains some test code. Interestingly, both of the test cases inside that code are now broken.
So it seems that it's back. So which change introduced it...
from amiga-gcc.
@bebbo I looked back in the history to November last year (when I last build a working version of the compiler) and I can't see any changes that would obviously cause exceptions to stop working. The only thing that might make a difference is a change to libamiga.a. Debugging this is a bit beyond me.
from amiga-gcc.
exceptions did work on 10th of April with libnix and do work with newlib too now.
from amiga-gcc.
@bebbo the problem is that I use clib, not libnix or newlib. Do you remember what change caused the problem?
from amiga-gcc.
@bebbo the problem is that I use clib, not libnix or newlib.
Oh ... I'm so sorry.
You have to add the cxxglue.o
which can e.g. be found in libnix: /build-Linux-m68k-amigaos/libnix/lib/nix/cxxglue.o
.
Do you remember what change caused the problem?
No - I don't test the clib2 c++ combination.
The problems here seem to be caused by
- no longer adding cxxglue.o to the provided input files, now the symbol
___init_eh
is wanted. Nothing in clib2 provides that atm. - stabs/constructors were replaced with sections. clib2 got updated accordingly.
from amiga-gcc.
added cxxglue.c
to the clib2 too
from amiga-gcc.
added
cxxglue.c
to the clib2 too
Thanks! I guess that's not pushed to GitHub yet?
from amiga-gcc.
BTW @bebbo I am experimenting with using libnix instead of clib2. Can you confirm that the way to do this is to specify -mcrt=nix20 both when compiling and when linking? I want to make sure I'm doing it correctly.
I remember seeing some instructions on your GitHub page a while ago, but I can't find them now.
from amiga-gcc.
BTW @bebbo I am experimenting with using libnix instead of clib2. Can you confirm that the way to do this is to specify -mcrt=nix20 both when compiling and when linking? I want to make sure I'm doing it correctly.
I remember seeing some instructions on your GitHub page a while ago, but I can't find them now.
You always add it to compile an link once.
Ensure that it doesn't appear twice at the linking stage.
from amiga-gcc.
Thank you for the tips! I can confirm that after rebuilding with the latest amiga-gcc repo version and the new clib2, the exception handling is working again.
from amiga-gcc.
Actually I am having some trouble with getting my software to work with -mcrt=nix20. My libauto.a entry points are crashing. @bebbo you may remember this issue from last year:
We had some problem the the following code:
void OpenAslBase() attribute((constructor));
void OpenAslBase()
{
AslBase = SafeOpenLibrary("asl.library");
}
Should this be working with -mcrt=nix20? The code is crashing hard at startup and it seems that the functions like OpenAslBase() are not actually getting called - the crash happens in the C++ startup code. With -mcrt=clib2 it is working.
from amiga-gcc.
It looks like some library couldn't be opened. The init code could crash if the dos.library wasn't already opened... this is fixed now.
attribute((constructor))
does work
from amiga-gcc.
Sorry for the late response, I finally have working computer again now.
Unfortunately nothing has changed, abort() gets called immediately. The usual failure mode was that exceptions just aren't caught, but it seems in this cases just entering a try block is already aborting everything?
// Edit: @try
itself works, the abort()
is on the first @throw
. It just turned out there was a @throw
during startup already.
from amiga-gcc.
Debugged it: It's the same problem again. m68k-amiga-gcc
doesn't link in the glue any more, only m68k-amiga-g++
does. This is the same issue as a few years ago.
from amiga-gcc.
@Midar I have had similar problems in the past, due to using gcc instead of g++, so it's important to use the correct compiler front end if you are targeting C++.
Another "gotcha" that caught me out is that you have to use the same compiler switches for all .cpp files that you are building. I have one file in my support library (a BSD socket wrapper class) that uses C++ exceptions, so I was enabling exceptions just for that file, to try and make my executable smaller. But this meant that on some C++ compilers, exception handling was broken! It has to be enabled for all files to work properly.
Actually, using C++ exception handling for one single file has caused so many problems that I regret using it! Plus it has made all of my binaries larger.
from amiga-gcc.
@hitman-codehq m68k-amigaos-gcc would be the correct compiler for ObjC with exceptions, though.
from amiga-gcc.
you could have used the option -Wl,-u___init_eh
...
from amiga-gcc.
Ah, good idea! That works, excellent!
from amiga-gcc.
giving -fexceptions
to the linker via gcc does the same now.
from amiga-gcc.
Thanks, that brings it back to the old behavior - I could revert all hacks now.
from amiga-gcc.
Related Issues (20)
- Is it possible to compile Amiga Shared Libraries with this wonderfull compiler ? HOT 7
- Program will exit because of unwanted automatic LoadLibrary() with optional lib HOT 2
- aminet links and amitools on Debian and Ubuntu HOT 7
- gcc build fails on Fedora 39 HOT 1
- Unable to compile a Reaction snippet from the NDK3.2 HOT 6
- M3 Mac Book Pro Build - NDK 3.2 Patches Fail HOT 2
- gcc build fails in graphite-isl-ast-to-gimple.c HOT 2
- Question: Optional libraries... possible? HOT 2
- Checked in libamiga.a HOT 1
- @isoriano1968 - "make min" in a pristine repo (and sub project repos) seems to be OK. I'll open another issue for the oddities I noticed. HOT 1
- __divdi3 crashes on 68060 HOT 6
- gcc doesn't build on M1 macOS
- dlfcn.h is installed from clib2 but dl* functions do not exist on AmigaOS 3.x HOT 4
- gcc compile error: `isl_val_free` was not declared in this scope HOT 2
- Duplicate section has different contents HOT 17
- Update VASM (1.9a to 1.9f) HOT 3
- vbcc not building, missing a declaration of some function HOT 2
- Building amiga-gcc fails at making binutils on aarch64-linux-android HOT 1
- amiga-gcc 13.2 built executable exits with error code 121 HOT 8
- Problems with NDK3.9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amiga-gcc.