bebbo / binutils-gdb

Unofficial mirror of sourceware binutils-gdb repository. Updated daily.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git
GNU General Public License v2.0
3 stars 3 forks source link

CreatePort crashes #31

Closed alexalkis closed 1 year ago

alexalkis commented 1 year ago
#include <clib/alib_protos.h>
#include <proto/dos.h>
#include <stdio.h>

int main(int argc, char const *argv[]) {
  struct MsgPort *port;

  port = CreatePort(NULL, 0);
  if (port) {
    PutStr("Port opened ok, closing now...\n");
    DeletePort(port);
  }
  return 0;
}

Compile with: m68k-amigaos-gcc -s -noixemul -Os -o testcp testcp.c This crashes. I've narrowed down (from a big program) to CreatePort and this is a minimal source code.

The above does not crash with SAS/C.

bebbo commented 1 year ago

something broke during upgrade to 2.38 the branch amiga-2.35.2 is ok

alexalkis commented 1 year ago

Hmmm, saw that

commit 1ac3457fac45d69fa2b7c28987557ad2a6b4232e (HEAD -> master, origin/master, origin/devel1, origin/HEAD)
Author: bebbo <bebbo@bejy.net>
Date:   Sat Jan 14 11:25:57 2023 +0100

    binutils now uses the amiga-2.35.2 as default

and cleaned and rebuild. Still crashes. Do I have to invoke in a certain way on building the toolchain?

bebbo commented 1 year ago

update the repo and use make branch mod=... branch=...

git pull
make branch mod=binutils branch=amiga-2.35.2

It is already working but refreshes all modules... the change should be live soon, or use this:

pushd projects/binutils
git fetch origin amiga-2.35.2:amiga-2.35.2
git checkout amiga-2.35.2
git branch --set-upstream-to=origin/amiga-2.35.2 amiga-2.35.2
popd

plus update the .repos file manually.

bebbo commented 1 year ago

DANG! I found the cause: the binutils switched the sizes from size=2**x to size=x, thus 0->1, 1->2, 2->4. So I have to apply this to the Amiga code ...

bebbo commented 1 year ago

The main branch amiga with binutils 2.39.0 is working again. Please test. You can switch back applying:

make branch mod=binutils branch=amiga
alexalkis commented 1 year ago

yeap. everything seems to work. thanks.

i/o seems to be very slow with libnix. Also, -m68020 bombs a project. I'll try to make a test case and open a new issue or two.