bebbo / libnix

libnix (v4): a C link library for AmigaOS/m68k
15 stars 9 forks source link

Opening devices as libraries #50

Closed BSzili closed 2 years ago

BSzili commented 2 years ago

It appears that commit 5067886af7ae43496ac84639e6a9d6a884ee777e accidentally re-enabled opening devices as libraries if there's a global library base declared in the program. This was previously fixed in b70d5808975b28fe2db9c4ee6ced22734c81f504. To reproduce it you can declare a global base for any device, and the program will fail to start. For example devtest.c

#include <exec/devices.h>
struct Device *TimerBase;
int main(void)
{
    return 0;
}

It can be built with m68k-amigaos-gcc -noixemul -m68020 -o devtest devtest.c Running it will exit with timer.device failed to load. This is likely related to issue #17.

BSzili commented 2 years ago

77be2d9 fixed it, thanks!