ocamlfind
ocamlfind copied to clipboard
Gentoo - undefined reference to `io.c.880cdbd1
I am expriencing following output during build: build.log
my gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/python --enable-languages=c,c++,go,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=yes --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.0 p1' --disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --enable-lto --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Gentoo 11.2.0 p1)
I have following ocaml language package installed:
* Found these USE flags for dev-lang/ocaml-4.11.2-r2:
U I
- - emacs : Add support for GNU Emacs
- - flambda : Enables the Flambda optimizer: A new intermediate representation (introduced in ocaml 4.03) in the depths of the compiler designed to allow for better inlining.
- - latex : Add support for LaTeX (typesetting package)
+ + ocamlopt : Enable ocamlopt support (ocaml native code compiler) -- Produces faster programs (Warning: you have to disable/enable it at a global scale)
- - spacetime : Enables the Spacetime memory profiler. See https://caml.inria.fr/pub/docs/manual-ocaml/spacetime.html for more information.
- - xemacs : Add support for XEmacs
So, just extending the info, its seems like findlib is not buildable with lto optimizations, eg these gcc envars:
Emerging (1 of 1) dev-ml/findlib-1.9.1::gentoo
* findlib-1.9.1.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
* FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr'
* CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* CXXFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* FFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* FCFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* F77FLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* LDFLAGS='-Wl,-O1 -Wl,--as-needed -Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe'
* MAKEOPTS='-j12 -l12'
* gcc (Gentoo 11.2.0 p1) 11.2.0
* g++ (Gentoo 11.2.0 p1) 11.2.0
* GNU ld (Gentoo 2.37_p1 p0) 2.37
* Linux zeus 5.13.10-gentoo-x86_64 #2 SMP Sat Oct 9 11:39:47 CEST 2021 x86_64 Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz GenuineIntel GNU/Linux
I try now with leaving O3 and Graphite options, but disable purely only LTO:
Emerging (1 of 1) dev-ml/findlib-1.9.1::gentoo
* findlib-1.9.1.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
* FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr'
* CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* CXXFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* FFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* FCFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* F77FLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
* LDFLAGS='-Wl,-O1 -Wl,--as-needed -Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe'
* MAKEOPTS='-j12 -l12'
* gcc (Gentoo 11.2.0 p1) 11.2.0
* g++ (Gentoo 11.2.0 p1) 11.2.0
* GNU ld (Gentoo 2.37_p1 p0) 2.37
* Linux zeus 5.13.10-gentoo-x86_64 #2 SMP Sat Oct 9 11:39:47 CEST 2021 x86_64 Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz GenuineIntel GNU/Linux
hard to say what this is - I've not much experience in lto and to what degree it needs cleaner code. findlib is a pretty normal OCaml application, so it is likely that this is something that is already unclean in core OCaml. My first bet would be that these are the foreign functions (i.e. that their function pointers are just typed as void *(void)
or so, and not with their real type, because I remember I ran into link problems for my recent WebAssembly experiments). Could also be that some other constraints are violated.
Note that the C compiler options usually do not apply to OCaml builds, like O3
. Linker options like -flto
do, of course.