Commit 9355e703 breaks msdos targets
Summary
System Information
- **Operating system: msdos
- **Processor architecture:i8086
- **Compiler version: trunk
- Device:
Steps to reproduce
At linking, there is this failure:
muller@cfarm422:~/pas/check$ !400
ppc8086 -CX -XX -Wmtiny tw41092
Free Pascal Compiler version 3.3.1-17499-g79b240ec81 [2025/02/24] for i8086
Copyright (c) 1993-2025 by Florian Klaempfl and others
Target OS: MS-DOS 16-bit real mode
Compiling tw41092.pp
tw41092.pp(9,8) Warning: Conversion between ordinals and pointers is not portable
tw41092.pp(9,14) Warning: Variable "B" does not seem to be initialized
tw41092.pp(5,3) Note: Local variable "A" is assigned but never used
Linking tw41092.exe
tw41092.pp(10,1) Error: Undefined symbol: ..@d22 (first seen in system0s1041.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d48 (first seen in system0s1041.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d47 (first seen in system0s1041.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d49 (first seen in system0s1045.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d86 (first seen in system0s1392.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d64 (first seen in system0s1388.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d34 (first seen in system0s611.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d33 (first seen in system0s611.s))
tw41092.pp(10,1) Error: Undefined symbol: ..@d55 (first seen in system0s1111.s))
tw41092.pp(10,1) Fatal: There were 9 errors compiling module, stopping
Fatal: Compilation aborted
Example Project
This just uses latest test source.
What is the current bug behavior?
See above.
What is the expected (correct) behavior?
Should successfully compile.
Relevant logs and/or screenshots
muller@cfarm422:~/pas/trunk/fpcsrc$ git diff 9355e703d7f^ 9355e703d7f
diff --git a/compiler/ncgcon.pas b/compiler/ncgcon.pas
index 6e30dbda8d..81853d229e 100644
--- a/compiler/ncgcon.pas
+++ b/compiler/ncgcon.pas
@@ -134,7 +134,7 @@ tfloatkey = record
{ :-(, we must generate a new entry }
if not(assigned(lab_real)) then
begin
- current_asmdata.getglobaldatalabel(lastlabel);
+ current_asmdata.getlocaldatalabel(lastlabel);
entry^.Data:=lastlabel;
lab_real:=lastlabel;
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
Possible fixes
lastlabel
and other labels changed in that commit need to be global if create_smartlink_library
is true
.
Possible fix, which nedds to be iterated over all similar changes:
if create_smartlink_library then
current_asmdata.getglobaldatalabel(lastlabel)
else
current_asmdata.getlocaldatalabel(lastlabel);