GO32v2 error while linking
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
I'm trying to cross-compile a demo program (demo/text/lines.pp in my example) from Win32 to GO32v2. I got the required binutils (i386-go32-ld.exe) and I compiled and installed the GO32v2 RTL.
When I try to compile the lines.pp demo (or any other program), I get the following error:
C:\Development\FreePascal\src\demo\text>fpc -XPi386-go32v2- -Tgo32v2 lines.pp
Free Pascal Compiler version 2.0.0 [2005/05/08] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: GO32 V2 DOS extender
Compiling lines.pp
Linking lines.exe
link.res: file not recognized: File truncated
lines.pp(75,3) Error: Error while linking
Error: C:\Development\FreePascal\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specifiy a source file to be compiled)
Now the file link.res is empty (0 bytes), and the file script.res exists and has the linker information in it.
Compiling with -s and checking the ppas.bat file shows that fpc tries to do this:
C:\Development\FreePascal\bin\i386-win32\i386-go32v2-ld.exe --script=script.res -s -o lines.exe link.res
Because link.res is empty, this doesn't work.
However, removing the "link.res" from the offending line and then running the .bat file gives me the correct executable.
Maybe fpc should check if there is actually something being written to link.res and remove it from the ld.exe command line if not.
P.S.: Script.res looks like this (it has all references to the GO32v2 RTL in it):
OUTPUT_FORMAT("coff-go32-exe")
ENTRY(start)
SECTIONS
{
.text 0x1000+SIZEOF_HEADERS : {
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\prt0.o(.text)
. = ALIGN(16);
lines.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\system.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\exceptn.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\dos.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\crt.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\go32.o(.text)
. = ALIGN(16);
C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\strings.o(.text)
*(.text)
etext = . ; _etext = .;
. = ALIGN(0x200);
}
.data ALIGN(0x200) : {
djgpp_first_ctor = . ;
*(.ctor)
djgpp_last_ctor = . ;
djgpp_first_dtor = . ;
*(.dtor)
djgpp_last_dtor = . ;
*(.data)
*(.gcc_exc)
___EH_FRAME_BEGIN__ = . ;
*(.eh_fram)
___EH_FRAME_END__ = . ;
LONG(0)
edata = . ; _edata = .;
. = ALIGN(0x200);
}
.bss SIZEOF(.data) + ADDR(.data) :
{
_object.2 = . ;
. += 24 ;
*(.bss)
*(COMMON)
end = . ; _end = .;
. = ALIGN(0x200);
}
}
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\rtl\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\unzip\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\regexpr\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\paszlib\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\pasjpeg\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\netdb\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\md5\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\gdbint\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\units\I386-G~1\")
SEARCH_DIR("C:\DEVELO~1\FREEPA~1\bin\I386-W~1\")
Additional information:
Reporter: Michael Drüing
EMail: michael at drueing dot de
Mantis conversion info:
- Mantis ID: 6111
- OS: Win32