Sound library MIDAS for Freepascal/GO32V2 (Announce)
Hello Laaca,
> However I had some difficulties with the compilation of your code.
> To be the explanation between us easier I uploaded the directory with your
> FPCMIDAS to my site:
> http://www.laaca.borec.cz/…zip
http://www.laaca.borec.cz/fpcmidas.zip ?
> The main issue I had was the error message in the linking stage. After some
> investigation I found that the problem is in duplicite definition of
> variable "_crt0_startup_flags" which is defined both in MIDAS (file
> MIDAS.C) and in deep layers of Freepascal (file V2PRT0.AS - part of the RTL
> system for GO32V2 platform).
This actually looks to me like a FreePascal bug.
It should allow the user program to override _crt0_startup_flags simply by defining it --- otherwise there is not much point in having the variable. (The variable is read really early --- at program startup time --- so it most probably should be initialized before any code runs.)
For some reason though, FreePascal defines it in the same module as the rest of the startup code in v2prt0.as. This means the linker is forced to always link in the version that is in v2prt0.as!
I think a (more) correct fix here would be to modify FreePascal to factor out the _crt0_startup_flags definition from v2prt0.as, into a separate .c or .as module. There might also be other variables in FreePascal which should be moved out similarly.
Thank you!
---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"
Complete thread:
- Sound library MIDAS for Freepascal/GO32V2 - Laaca, 22.11.2020, 18:37 (Announce)
- Sound library MIDAS for Freepascal/GO32V2 - tkchia, 23.11.2020, 18:08
- Sound library MIDAS for Freepascal/GO32V2 - marcov, 23.11.2020, 23:32
- Sound library MIDAS for Freepascal/GO32V2 - Laaca, 24.11.2020, 01:06
- Sound library MIDAS for Freepascal/GO32V2 - marcov, 23.11.2020, 23:32
- Sound library MIDAS for Freepascal/GO32V2 - tkchia, 23.11.2020, 18:08