[fpc-devel] Error building FPC main in Fedora 44 ("read-only segment has dynamic relocations", in linking pas2js)

Flávio Etrusco flavio.etrusco at gmail.com
Thu Oct 29 19:22:24 CET 2026


FWIW I worked around the problem temporarily by passing "-z notext" to
the linker
in fpmake.pp

-Flávio

Em ter., 20 de out. de 2026 às 14:19, Flávio Etrusco
<flavio.etrusco at gmail.com> escreveu:

>
> Hi all,
>
> Is this a known bug? Any directions to investigate this?
>
> Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64 (downloaded
> from SourceForge, IIRC)
> Output:
> (...)
> Start compiling package utils-pas2js for target x86_64-linux.
>       Compiling pas2js/units/x86_64-linux/BuildUnit_utils_pas2js.pp
>       Compiling ./pas2js/dirw.pp
>       Compiling ./pas2js/httpcompiler.pp
>       Compiling pas2js/pas2js.pp
>       Linking pas2js/bin/x86_64-linux/pas2js
>       Compiling pas2js/pas2jslib.pp
>       Linking pas2js/bin/x86_64-linux/libpas2jslib.so
> The installer encountered the following error:
> External command "/mnt/(...)/fpc-dev/compiler/ppcx64  -Tlinux
> -FEpas2js/bin/x86_64-linux
>   (-Fu...) -Fupas2js/. -Fl/usr/lib/gcc/x86_64-redhat-linux/16 -Ur -Xs
> -O2 -n -Cg -Fl/usr/lib/gcc/x86_64-redhat-linux/16 -dx86_64 -dRELEASE
> -viq pas2js/pas2jslib.pp" failed with exit code 256. Console output:
> Target OS: Linux for x86-64
> Compiling pas2js/pas2jslib.pp
> Linking pas2js/bin/x86_64-linux/libpas2jslib.so
> /usr/bin/ld.bfd: /mnt/(...)/fpc-dev/rtl/units/x86_64-linux/system.o:
> aviso: relocation in read only section
> ".rodata.n_VMT_$SYSTEM_$$_TOBJECT"
> Error: Error while linking
> Fatal: There were 1 errors compiling module, stopping
> Fatal: Compilation aborted
> /usr/bin/ld.bfd: error: read-only segment has dynamic relocations
>
>
> Should pas2js not be compiled with -Cg? Is my system.o not compiled
> with -Cg/$PIC? Is some code writing to "writable consts" and
> shouldn't?
> Thanks in advance.
>
> -Flávio


More information about the fpc-devel mailing list