reproducible on both Sifive Unmatched board and qemu riscv64 environment. * QA Notice: The following files contain runtime text relocations * Text relocations force the dynamic linker to perform extra * work at startup, waste system resources, and may pose a security * risk. On some architectures, the code may not even function * properly, if at all. * For more information, see: * * https://wiki.gentoo.org/wiki/Hardened/HOWTO_locate_and_fix_textrels * * Please include the following list of files in your report: * TEXTREL usr/lib64/ocaml/str.cmxs * TEXTREL usr/lib64/ocaml/unix.cmxs * TEXTREL usr/bin/ocamllex.opt * TEXTREL usr/bin/ocamlopt.opt * TEXTREL usr/bin/ocamlc.opt * TEXTREL usr/bin/ocamldoc.opt * TEXTREL usr/bin/ocamlcmt * TEXTREL usr/bin/ocamlobjinfo.opt * TEXTREL usr/bin/ocamlmktop.opt * TEXTREL usr/bin/ocamlmklib.opt * TEXTREL usr/bin/ocamloptp.opt * TEXTREL usr/bin/ocamlcp.opt * TEXTREL usr/bin/ocamlprof.opt * TEXTREL usr/bin/ocamldep.opt QA Notice: Unrecognized ELF file(s): RISCV;/usr/lib/debug/usr/lib64/ocaml/profiling.o.debug RISCV;/usr/lib/debug/usr/lib64/ocaml/compiler-libs/optmain.o.debug RISCV;/usr/lib/debug/usr/lib64/ocaml/compiler-libs/main.o.debug RISCV;/usr/lib/debug/usr/lib64/ocaml/std_exit.o.debug RISCV;/usr/lib64/ocaml/profiling.o RISCV;/usr/lib64/ocaml/std_exit.o RISCV;/usr/lib64/ocaml/compiler-libs/optmain.o RISCV;/usr/lib64/ocaml/compiler-libs/main.o Reproducible: Always
Created attachment 753886 [details] build log
Created attachment 753890 [details] emerge --info
This could be fixed temporally by append-ldflags "-Wl,-z,notext like 32 bits arches, but the case for riscv64 is different from bug #773226. According to upstream, ocaml supports generating PIC on riscv64. > scanelf -qT str.cmxs ... str.cmxs: (memory/data?) [r_offset=0x10F58] r_type=3 in (optimized out: previous camlStr__frametable) [closest_prev_sym=0xEED8] str.cmxs: (memory/data?) [r_offset=0x10F68] r_type=3 in (optimized out: previous camlStr__frametable) [closest_prev_sym=0xEED8] str.cmxs: (memory/data?) [r_offset=0x10F80] r_type=3 in (optimized out: previous camlStr__frametable) [closest_prev_sym=0xEED8] ... r_type=3 is R_RISCV_RELATIVE Also, previously (portage tree is on around 2021.10.09), many tests failed with "warning: creating DT_TEXTREL in a PIE". But now no test failures appear with current portage tree.
Created attachment 765628 [details, diff] ocaml-4.12.1-fix-textrel-riscv.patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85fb0c39c57aae6d7795b6ee1259d53ecfebd882 commit 85fb0c39c57aae6d7795b6ee1259d53ecfebd882 Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2022-02-25 19:58:12 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2022-02-25 19:58:12 +0000 dev-lang/ocaml: fix TEXTREL on 4.12.1 Closes: https://bugs.gentoo.org/825282 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> .../files/ocaml-4.12.1-fix-textrel-riscv.patch | 46 ++++++++++++++++++++++ dev-lang/ocaml/ocaml-4.12.1.ebuild | 1 + 2 files changed, 47 insertions(+)