Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Sound library MIDAS for Freepascal/GO32V2 (Announce)

posted by tkchia Homepage, 23.11.2020, 18:08
(edited by tkchia on 23.11.2020, 18:20)

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:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 442 users online (0 registered, 442 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum