FPC Compiler Relocation Bug for win 32bit
Summary
Hello,
I was testing the Win32 with debug info on my project, and the compiler crashed internally. I only get it to crash when compiling with debug info. I think it crashes when it tries to do relocations.
I tested with the FPC Trunk version and fixes-3.2.
System Information
- Operating system:Windows 11
- Processor architecture:x86 32bit
- Compiler version:trunk and fixes-3.2
- Device:Computer
Steps to reproduce
Download the repo; there's a Debug_windows_32 build mode in the demo.
Example Project
You can download the repo here: https://github.com/Coldzer0/ImGui-Pascal
What is the current bug behavior?
The compiler crashes.
What is the expected (correct) behavior?
Do relocation properly without crashing, I think ^_^
Relevant logs and/or screenshots
Compile Project, Mode: Debug_windows_32, OS: win32, CPU: i386, Target: E:\github\Pascal-imGUI\ImGui-Pascal\PasImGui_SDL2_OpenGL3_Demo\Win32\ImGui_SDL2_OpenGL3_Demo_debug.exe: Exit code 1, Errors: 1
Verbose: Free Pascal Compiler version 3.3.1-13529-g9ba9e886ae [2023/11/29] for i386
Verbose: Copyright (c) 1993-2023 by Florian Klaempfl and others
Verbose: Target OS: Win32 for i386
Verbose: Compiling ImGui_SDL2_OpenGL3_Demo.dpr
Verbose: Compiling E:\github\Pascal-imGUI\ImGui-Pascal\src\PasImGui.Utils.pas
ImGui_SDL2_OpenGL3_Demo.dpr(39,3) Verbose: Unit "Math" not used in ImGui_SDL2_OpenGL3_Demo
Verbose: Compiling resource E:\github\Pascal-imGUI\ImGui-Pascal\PasImGui_SDL2_OpenGL3_Demo\lib\i386-win32\ImGui_SDL2_OpenGL3_Demo.or
Verbose: Linking E:\github\Pascal-imGUI\ImGui-Pascal\PasImGui_SDL2_OpenGL3_Demo\Win32\ImGui_SDL2_OpenGL3_Demo_debug.exe
ImGui_SDL2_OpenGL3_Demo.dpr(449,1) Error: Compilation raised exception internally
Verbose: Compilation aborted
Debug: An unhandled exception occurred at $0000000100279996:
Debug: EAccessViolation: Access violation
Debug: $0000000100279996 DORELOCATIONFIXUP, line 1435 of ogcoff.pas
Debug: $000000010006D968 FIXUPRELOCATIONS, line 3893 of ogbase.pas
Debug: $000000010005C896 RUNLINKSCRIPT, line 2088 of link.pas
Debug: $000000010005CD07 MAKEEXECUTABLE, line 2160 of link.pas
Debug: $0000000100210680 PROC_PROGRAM, line 2589 of pmodules.pas
Debug: $0000000100046B99 COMPILE, line 411 of parser.pas
Debug: $000000010001B47A COMPILE, line 291 of compiler.pas
Debug: $0000000100001AED main, line 308 of pp.pas
Debug: $0000000100002746 MAIN_WRAPPER
Debug: $0000000100013F70 EXE_ENTRY, line 83 of x86_64/cpuwin.inc
Debug: $00000001000018D0 _FPC_MAINCRTSTARTUP, line 107 of sysinit.pp
Debug: $00007FFFA0CA257D
Debug: $00007FFFA1B2AA58
Debug:
Verbose: F:\FPCross\fpc\bin\x86_64-win64\ppcross386.exe returned an error exitcode
Edited by Coldzer0