Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2026-10

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

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Flávio Etrusco

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

Reply by email

Flávio Etrusco
to Flávio Etrusco

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

-Flávio

Flávio Etrusco wrote 41 lines
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

Reply by email