Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.14.2: problem with linking with OCAML_NATIVE=true and OCAML_NATIVE_TOOLS=true #320

Open
kloczek opened this issue Jun 22, 2023 · 3 comments

Comments

@kloczek
Copy link

kloczek commented Jun 22, 2023

Disclaimer:
This ticket is less about some issue and more som call for help/hints. Cannot find documentation about what I'm trying to do so if it is some documentation about that or you have no time just please redirect me to that doc close this ticket.

I just started packaging ocalm modules as rpm packages and have no problem with OCAML_NATIVE=false and OCAML_NATIVE_TOOLS=false but playing OCAML_NATIVE=true and OCAML_NATIVE_TOOLS=true found that on trying to build ocamlbuild with native compiler build fails on linking on missing symbols so Probably some libraries are missing in params.
It is quite possible that I'm doing something wrong so will be appreciated for any hints.

Here is part of my rpm spec file showing what I;m trying to do

%build
%make_build configure \
        OCAMLBUILD_BINDIR=%{_bindir} \
        OCAMLBUILD_LIBDIR=%{_libdir}/ocaml \
        OCAMLBUILD_MANDIR=%{_mandir} \
        OCAMLBUILD_PREFIX=%{_prefix} \
%if %{with native_compiler}
        OCAML_NATIVE=true \
        OCAML_NATIVE_TOOLS=true \
%else
        OCAML_NATIVE=false \
        OCAML_NATIVE_TOOLS=false \
%endif
        %{nil}
%make_build \
%if %{with native_compiler}
        OCAMLC="ocamlc.opt -g" \
        OCAMLOPT="ocamlopt.opt -g"
%else
        OCAMLC="ocamlc -g" \
        OCAMLOPT="ocamlopt -g"
%endif

And here is build log:

+ cd ocamlbuild-0.14.2
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 configure OCAMLBUILD_BINDIR=/usr/bin OCAMLBUILD_LIBDIR=/usr/lib64/ocaml OCAMLBUILD_MANDIR=/usr/share/man OCAMLBUILD_PREFIX=/usr OCAML_NATIVE=true OCAML_NATIVE_TOOLS=true
/usr/bin/make -f configure.make Makefile.config
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2'
(echo "# This file was generated from configure.make"; \
echo ;\
echo "OCAML_PREFIX="; \
echo "OCAML_BINDIR=/usr/bin"; \
echo "OCAML_LIBDIR=/usr/lib64/ocaml"; \
echo "OCAML_MANDIR=/usr/share/man"; \
echo ;\
echo "EXT_OBJ=.o"; \
echo "EXT_ASM=.s"; \
echo "EXT_LIB=.a"; \
echo "EXT_DLL=.so"; \
echo "EXE="; \
echo ;\
echo "OCAML_NATIVE=true"; \
echo "OCAML_NATIVE_TOOLS=true"; \
echo "NATDYNLINK=true"; \
echo "SUPPORT_SHARED_LIBRARIES=true"; \
echo ;\
echo "PREFIX=/usr"; \
echo "BINDIR=/usr/bin"; \
echo "LIBDIR=/usr/lib64/ocaml"; \
echo "MANDIR=/usr/share/man"; \
) > Makefile.config
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2'
/usr/bin/make -f configure.make all
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2'
(echo "(* This file was generated from ../configure.make *)"; \
echo ;\
echo 'let bindir = "/usr/bin"'; \
echo 'let libdir = "/usr/lib64/ocaml"'; \
echo 'let ocaml_libdir = "/usr/lib64/ocaml"'; \
echo 'let libdir_abs = "/usr/lib64/ocaml"'; \
echo 'let ocaml_native = true'; \
echo 'let ocaml_native_tools = true'; \
echo 'let supports_shared_libraries = true';\
echo 'let a = "a"'; \
echo 'let o = "o"'; \
echo 'let so = "so"'; \
echo 'let ext_dll = ".so"'; \
echo 'let exe = ""'; \
echo 'let version = "0.14.2"'; \
) > src/ocamlbuild_config.ml
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2'
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 'OCAMLC=ocamlc.opt -g' 'OCAMLOPT=ocamlopt.opt -g'
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/const.ml
ocamllex.opt src/glob_lexer.mll
55 states, 419 transitions, table size 2006 bytes
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/loc.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/discard_printf.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_unix.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/shell.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/bool.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_config.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_where.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/digest_cache.mli
ocamllex.opt src/lexers.mll
251 states, 1051 transitions, table size 5710 bytes
4334 additional bytes used for bindings
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/exit_codes.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_specific.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/plugin.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hooks.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/main.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c bin/ocamlbuild.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_ast.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/exit_codes.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/discard_printf.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hooks.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/bool.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/slurp.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_where.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/const.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_config.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/loc.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/discard_printf.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/bool.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/exit_codes.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hooks.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/loc.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_ast.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_lexer.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/signatures.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/fda.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hygiene.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/pathname.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob.mli
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_ast.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_where.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tags.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_lexer.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_std.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/solver.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_dependencies.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/param_tags.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/log.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/configuration.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/lexers.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/display.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/command.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tools.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tags.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/report.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/flags.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/findlib.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_arch.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_utils.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/options.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/resource.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_unix.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tags.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/shell.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/param_tags.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob_lexer.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/configuration.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/log.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/slurp.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/flags.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/digest_cache.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/rule.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/fda.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/findlib.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/report.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/pathname.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/lexers.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/display.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_arch.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hygiene.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_tools.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_utils.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_compiler.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/command.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tools.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_dependencies.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/solver.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/plugin.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_std.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/options.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/resource.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/main.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_tools.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/rule.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_compiler.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_std.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_specific.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/my_unix.ml
mkdir -p tmp
ocamlc.opt -g -pack src/const.cmo src/loc.cmo src/discard_printf.cmo src/signatures.cmi src/my_std.cmo src/my_unix.cmo src/tags.cmo src/display.cmo src/log.cmo src/shell.cmo src/bool.cmo src/glob_ast.cmo src/glob_lexer.cmo src/glob.cmo src/lexers.cmo src/param_tags.cmo src/command.cmo src/ocamlbuild_config.cmo src/ocamlbuild_where.cmo src/slurp.cmo src/options.cmo src/pathname.cmo src/configuration.cmo src/flags.cmo src/hygiene.cmo src/digest_cache.cmo src/resource.cmo src/rule.cmo src/solver.cmo src/report.cmo src/tools.cmo src/fda.cmo src/findlib.cmo src/ocaml_arch.cmo src/ocaml_utils.cmo src/ocaml_dependencies.cmo src/ocaml_compiler.cmo src/ocaml_tools.cmo src/ocaml_specific.cmo src/exit_codes.cmo src/plugin.cmo src/hooks.cmo src/main.cmo -o tmp/ocamlbuild_pack.cmo
mv tmp/ocamlbuild_pack.cmi src/ocamlbuild_pack.cmi
mv tmp/ocamlbuild_pack.cmo src/ocamlbuild_pack.cmo
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/glob.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_executor.mli
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_unix_plugin.mli
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/slurp.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_plugin.mli
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/display.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c bin/ocamlbuild.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_unix_plugin.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_plugin.ml
ocamlc.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_executor.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/log.ml
ocamlc.opt -g -a -o plugin-lib/ocamlbuildlib.cma src/ocamlbuild_pack.cmo plugin-lib/ocamlbuild_plugin.cmo plugin-lib/ocamlbuild_executor.cmo plugin-lib/ocamlbuild_unix_plugin.cmo
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/lexers.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/shell.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/param_tags.ml
ocamlc.opt -g src/ocamlbuild_pack.cmo -I src man/options_man.ml -o man/options_man.byte
./man/options_man.byte > man/ocamlbuild.options.1
cat man/ocamlbuild.header.1 man/ocamlbuild.options.1 man/ocamlbuild.footer.1 > man/ocamlbuild.1
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/configuration.ml
ocamlc.opt -g -I +unix -I src -o ocamlbuild.byte unix.cma src/ocamlbuild_pack.cmo plugin-lib/ocamlbuild_plugin.cmo plugin-lib/ocamlbuild_executor.cmo plugin-lib/ocamlbuild_unix_plugin.cmo bin/ocamlbuild.cmo
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/command.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/flags.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/findlib.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/options.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/pathname.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/digest_cache.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/hygiene.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_arch.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/fda.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/resource.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/rule.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/tools.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/solver.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/report.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/plugin.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_utils.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_dependencies.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_compiler.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_tools.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocaml_specific.ml
ocamlopt.opt -g -for-pack Ocamlbuild_pack -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/main.ml
mkdir -p tmp
ocamlopt.opt -g -pack src/const.cmx src/loc.cmx src/discard_printf.cmx src/signatures.cmi src/my_std.cmx src/my_unix.cmx src/tags.cmx src/display.cmx src/log.cmx src/shell.cmx src/bool.cmx src/glob_ast.cmx src/glob_lexer.cmx src/glob.cmx src/lexers.cmx src/param_tags.cmx src/command.cmx src/ocamlbuild_config.cmx src/ocamlbuild_where.cmx src/slurp.cmx src/options.cmx src/pathname.cmx src/configuration.cmx src/flags.cmx src/hygiene.cmx src/digest_cache.cmx src/resource.cmx src/rule.cmx src/solver.cmx src/report.cmx src/tools.cmx src/fda.cmx src/findlib.cmx src/ocaml_arch.cmx src/ocaml_utils.cmx src/ocaml_dependencies.cmx src/ocaml_compiler.cmx src/ocaml_tools.cmx src/ocaml_specific.cmx src/exit_codes.cmx src/plugin.cmx src/hooks.cmx src/main.cmx -o tmp/ocamlbuild_pack.cmx
mv tmp/ocamlbuild_pack.cmx src/ocamlbuild_pack.cmx
mv tmp/ocamlbuild_pack.o src/ocamlbuild_pack.o
ocamlopt.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_plugin.ml
ocamlopt.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_executor.ml
ocamlopt.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c plugin-lib/ocamlbuild_unix_plugin.ml
ocamlopt.opt -g -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c bin/ocamlbuild.ml
ocamlopt.opt -g -a -o plugin-lib/ocamlbuildlib.cmxa src/ocamlbuild_pack.cmx plugin-lib/ocamlbuild_plugin.cmx plugin-lib/ocamlbuild_executor.cmx plugin-lib/ocamlbuild_unix_plugin.cmx
ocamlopt.opt -g -I +unix -I src -o ocamlbuild.native unix.cmxa src/ocamlbuild_pack.cmx plugin-lib/ocamlbuild_plugin.cmx plugin-lib/ocamlbuild_executor.cmx plugin-lib/ocamlbuild_unix_plugin.cmx bin/ocamlbuild.cmx
/usr/bin/ld: /usr/lib64/ocaml/libasmrun.a(amd64.o): warning: relocation against `caml_array_bound_error' in read-only section `.text.caml.caml_ml_array_bound_error'
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: /tmp/camlstartup48b840.o: in function `caml_program':
:(.text+0xc): undefined reference to `caml_globals_inited'
/usr/bin/ld: :(.text+0x1c): undefined reference to `caml_globals_inited'
/usr/bin/ld: :(.text+0x2c): undefined reference to `caml_globals_inited'
/usr/bin/ld: :(.text+0x3c): undefined reference to `caml_globals_inited'
/usr/bin/ld: :(.text+0x4c): undefined reference to `caml_globals_inited'
/usr/bin/ld: /tmp/camlstartup48b840.o::(.text+0x5c): more undefined references to `caml_globals_inited' follow
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__report_error_489':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:23: undefined reference to `caml_sys_argv'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:26: undefined reference to `unix_error_message'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__is_link_1142':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:42: undefined reference to `unix_lstat'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__at_exit_once_1144':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:45: undefined reference to `unix_getpid'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__fun_1262':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:47: undefined reference to `unix_getpid'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__stdout_isatty_1170':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:63: undefined reference to `unix_isatty'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:64: undefined reference to `caml_sys_getenv'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:64: undefined reference to `caml_string_notequal'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__myunixreadlink_1194':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:79: undefined reference to `unix_readlink'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o: in function `camlOcamlbuild_unix_plugin__setup_1220':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:87: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:88: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:89: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:90: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:91: undefined reference to `caml_modify'
/usr/bin/ld: plugin-lib/ocamlbuild_unix_plugin.o:/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_unix_plugin.ml:92: more undefined references to `caml_modify' follow
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__compare_543':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:44: undefined reference to `caml_compare'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__compare_763':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:45: undefined reference to `caml_compare'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__loop_1040':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:68: undefined reference to `caml_ml_output_char'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__execute_inner_1507':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:95: undefined reference to `unix_environment'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:195: undefined reference to `caml_create_bytes'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__fun_1523':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:118: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:119: undefined reference to `caml_modify'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__fun_1531':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:122: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:123: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:124: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__add_job_1190':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:139: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:139: undefined reference to `unix_set_nonblock'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:140: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:140: undefined reference to `unix_set_nonblock'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:152: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:152: undefined reference to `caml_channel_descriptor'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:152: undefined reference to `caml_modify'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:153: undefined reference to `caml_modify'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__skip_empty_tasks_1200':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:161: undefined reference to `caml_string_equal'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__iteration_1329':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:207: undefined reference to `unix_error_message'
/usr/bin/ld: plugin-lib/ocamlbuild_executor.o: in function `camlOcamlbuild_executor__loop_1393':
/home/tkloczko/rpmbuild/BUILD/ocamlbuild-0.14.2/plugin-lib/ocamlbuild_executor.ml:248: undefined reference to `caml_channel_descriptor'

[.lots of other missing symbols.]

(.text.caml.caml_raise_exception+0x3d): undefined reference to `caml_stash_backtrace'
/usr/bin/ld: /usr/lib64/ocaml/libasmrun.a(amd64.o): in function `caml_ml_array_bound_error':
(.text.caml.caml_ml_array_bound_error+0x3): undefined reference to `caml_array_bound_error'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
make: *** [Makefile:136: ocamlbuild.native] Error 2
@gasche
Copy link
Member

gasche commented Jun 22, 2023

I suppose that the error may be related to ocaml/ocaml#1323 .

Can you tell more about your architecture, operating system and OCaml version? (Including the output of ocamlopt -config could be helpful.)

@kloczek
Copy link
Author

kloczek commented Jun 22, 2023

I'm using ocaml 4.14.0 on x86_64.
Here is -config output:

[tkloczko@pers-jacek SPECS]$ ocamlopt -config
version: 4.14.0
standard_library_default: /usr/lib64/ocaml
standard_library: /usr/lib64/ocaml
ccomp_type: cc
c_compiler: /usr/bin/gcc
ocamlc_cflags: -O2 -fno-strict-aliasing -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -pthread -fPIC -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none
ocamlc_cppflags: -D_FILE_OFFSET_BITS=64
ocamlopt_cflags: -O2 -fno-strict-aliasing -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -pthread -fPIC -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none
ocamlopt_cppflags: -D_FILE_OFFSET_BITS=64
bytecomp_c_compiler: /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -pthread -fPIC -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_FILE_OFFSET_BITS=64
native_c_compiler: /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -pthread -fPIC -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_FILE_OFFSET_BITS=64
bytecomp_c_libraries: -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -lm  -lpthread
native_c_libraries: -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -lm
native_pack_linker: ld -r -o
architecture: amd64
model: default
int_size: 63
word_size: 64
system: linux
asm: as
asm_cfi_supported: true
with_frame_pointers: false
ext_exe:
ext_obj: .o
ext_asm: .s
ext_lib: .a
ext_dll: .so
os_type: Unix
default_executable_name: a.out
systhread_supported: true
host: x86_64-redhat-linux-gnu
target: x86_64-redhat-linux-gnu
flambda: false
safe_string: true
default_safe_string: true
flat_float_array: true
function_sections: true
afl_instrument: false
windows_unicode: false
supports_shared_libraries: true
naked_pointers: true
exec_magic_number: Caml1999X031
cmi_magic_number: Caml1999I031
cmo_magic_number: Caml1999O031
cma_magic_number: Caml1999A031
cmx_magic_number: Caml1999Y031
cmxa_magic_number: Caml1999Z031
ast_impl_magic_number: Caml1999M031
ast_intf_magic_number: Caml1999N031
cmxs_magic_number: Caml1999D031
cmt_magic_number: Caml1999T031
linear_magic_number: Caml1999L031

I don't think that it could be related to frame pointers because in this case linking fails so some shad/static libraries or objects are missing.
I've packaged ocaml by myself starting from Fedora spec file so it is possible as well that something is wring with my packaged ocaml 🤔

@kloczek
Copy link
Author

kloczek commented Jun 22, 2023

In -config output are preserv4ed LTO optimisation options which I've used to build ocaml.
In case of using LTO if some symbols are not marked as public linker automatically skips that producing smaller binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants