Re: [fpc-pascal] Separate debug info for release builds

2024-11-04 Thread Henry Vermaak via fpc-pascal
On Fri, 1 Nov 2024 at 21:22, Nikolay Nikolov via fpc-pascal wrote: > Because Free Pascal doesn't support smartlinking+debug info on most > platforms. The only exception is macOS, where it is actually supported. Do you know why it's not supported? What are the barriers to supporting it? It's qui

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Nikolay Nikolov via fpc-pascal
On 11/1/24 7:14 PM, Henry Vermaak via fpc-pascal wrote: On Fri, 1 Nov 2024 at 16:12, Henry Vermaak wrote: On Fri, 1 Nov 2024 at 15:49, Martin Frb via fpc-pascal wrote: Another factor could be that debug info affects smartlinking. Or leaves symbols for the linker in sections that are shared

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Henry Vermaak via fpc-pascal
On Fri, 1 Nov 2024 at 16:12, Henry Vermaak wrote: > On Fri, 1 Nov 2024 at 15:49, Martin Frb via fpc-pascal > wrote: > > Another factor could be that debug info affects smartlinking. Or leaves > > symbols for the linker in sections that are shared with non-debug info. > > This seems to be the pro

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Henry Vermaak via fpc-pascal
On Fri, 1 Nov 2024 at 15:49, Martin Frb via fpc-pascal wrote: > Another factor could be that debug info affects smartlinking. Or leaves > symbols for the linker in sections that are shared with non-debug info. This seems to be the problem. I think adding -g turns off smartlinking, which then blo

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Henry Vermaak via fpc-pascal
On Fri, 1 Nov 2024 at 15:16, Martin Frb via fpc-pascal wrote: > On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote: > I may not have all the factors, but O- O1 and O2 are not debug info, but > optimization. > So they generate different code, and that leads to different exe sizes. I understa

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Martin Frb via fpc-pascal
On 01/11/2024 16:16, Martin Frb via fpc-pascal wrote: On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote: When I add -Xg, the compiler writes the debug info into a separate .dbg file and adds a .gnu_debuglink section so the debugger can find the info. So far so good (and simpler than havin

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Martin Frb via fpc-pascal
On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote: When I add -Xg, the compiler writes the debug info into a separate .dbg file and adds a .gnu_debuglink section so the debugger can find the info. So far so good (and simpler than having the use objcopy). The size of the binary is much lar

[fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Henry Vermaak via fpc-pascal
When I add -Xg, the compiler writes the debug info into a separate .dbg file and adds a .gnu_debuglink section so the debugger can find the info. So far so good (and simpler than having the use objcopy). The size of the binary is much larger than building without debug info, though. E.g. with -O