[Pkg-pascal-devel] wattsi - how to fix lintian error "statically-linked-binary"
Fab Stz
fabstz-it at yahoo.fr
Sun Apr 26 08:31:07 BST 2026
Dear Peter,
> The build log from your Salsa pipeline contains several lines such as
>
> "settings.inc(43,4) Note: DWARF debug information cannot be used with smart linking on this target, switching to static linking"
>
>
> Does smart linking really make a significant difference to the exe size?
> If not, suggest drop it.
With "-XX" (smart linking), size is 2.6M (1.3M after strip)
Without it size is 4.1M (2.1M after strip)
With "-XD" (dynamic linking), size is 4.1M (2.1M after strip), but the binary is still not dynamically linked.
Same when using "-XD -Xc"
Would you consider that a significant change in binary size justifying to keep smart linking enabled?
As per the "stacially linked" issue:
With "-XD -k-shared", or "-XD -k-shared -k-Bdynamic" build fails:
Executing "/usr/bin/ld.bfd" with command line "-b elf64-x86-64 -m elf_x86_64 -shared -L. -o ../bin/wattsi -T ../bin/link837833.res -e _start"
/usr/bin/x86_64-linux-gnu-ld.bfd: ../bin/../bin/wattsi.o: relocation R_X86_64_32S against symbol `RTTI_$P$WATTSI_$$_def0000007A' can not be used when making a shared object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld.bfd: failed to set dynamic section sizes: bad value
Same as above, but with "-fPIC" -> "-XD -k-shared -k-Bdynamic -fPIC" also fails, but because of a external resource
Executing "/usr/bin/ld.bfd" with command line "-b elf64-x86-64 -m elf_x86_64 -shared -Bdynamic -L. -o ../bin/wattsi -T ../bin/link837979.res -e _start"
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux/rtl/si_prc.o: warning: relocation against `SI_PRC_$$__FPC_PROC_START' in read-only section `.text.n_si_prc_$$__fpc_dynamic_proc_start'
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux/rtl/si_prc.o: relocation R_X86_64_PC32 against symbol `FPC_SysEntry' can not be used when making a shared object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld.bfd: final link failed: bad value
With "-XD -k-shared -k-Bsymbolic" it is dynamically linked accoring to `file wattsi`, but statically linked according to `ldd wattsi`. Also, wattsi segfaults at invocation...
My feeling when I see "/usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux/rtl/si_prc.o" is that there is now way to avoid that "statically-linked-binary" "issue".
> (I fixed a similar issue on one of my packages by switching debug info to -gw4)
Thanks! That permitted to remove that DWARF notice. The repo now includes that change.
Fab
More information about the Pkg-pascal-devel
mailing list