Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559624 - =sys-devel/llvm-3.7.0[ocaml] fails to build with an older version of llvm[ocaml] installed - Error: The files ... make inconsistent assumptions over interface CamlinternalFormatBasics
Summary: =sys-devel/llvm-3.7.0[ocaml] fails to build with an older version of llvm[oca...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
: 559940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-05 05:31 UTC by Olivier Huber
Modified: 2015-10-13 13:52 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.xz,94.43 KB, application/x-xz)
2015-09-05 05:36 UTC, Olivier Huber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Huber 2015-09-05 05:31:33 UTC
excerpt from build.log

[1079/3390] cd /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine && /usr/bin/ocamlfind ocamlmklib -o llvm_executionengine -lstdc++ -ldopt -L/var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/./lib64 -ccopt "-L\\\$CAMLORIGIN/.." -ccopt "-Wl,-rpath,\\\$CAMLORIGIN/.." -package ctypes -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/target -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMipa -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport -lrt -ldl -lcurses -lpthread -lz -lm -ldopt "-Wl,-rpath,\\\$ORIGIN/../../lib64" llvm_executionengine.mli llvm_executionengine.ml executionengine_ocaml.o
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm, /usr/lib64/ocaml
findlib: [WARNING] Interface llvm_target.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/target, /usr/lib64/ocaml
[1080/3390] cd /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine && /usr/bin/ocamlfind ocamldoc -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/./lib64/ocaml/ -dump /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.odoc -package ctypes /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.mli /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.ml
FAILED: cd /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine && /usr/bin/ocamlfind ocamldoc -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine -I /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/./lib64/ocaml/ -dump /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.odoc -package ctypes /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.mli /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.ml
File "/var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.mli", line 1:
Error: The files /usr/lib64/ocaml/pervasives.cmi
       and /usr/lib64/ocaml/llvm_target.cmi make inconsistent assumptions
       over interface CamlinternalFormatBasics
File "/var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/executionengine/llvm_executionengine.ml", line 1:
Error: The files /usr/lib64/ocaml/pervasives.cmi
       and /usr/lib64/ocaml/llvm_target.cmi make inconsistent assumptions
       over interface CamlinternalFormatBasics
2 error(s) encountered
ninja: build stopped: subcommand failed.
 * ERROR: sys-devel/llvm-3.7.0::gentoo failed (compile phase):

I have llvm-3.6.1 installed with the ocaml bindings. It looks like some files from the current install are being used instead of the freshly compiled ones. My install of ocaml was updated just before attempting to update llvm.

# emerge --info llvm
Portage 2.2.20.1 (python 2.7.10-final-0, default/linux/amd64/13.0/developer, gcc-4.9.3, glibc-2.21-r1, 4.1.2-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.2-gentoo-x86_64-Intel-R-_Core-TM-_i7-5600U_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     8062276 total,    878880 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 04 Sep 2015 15:15:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.1.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gtlib.gatech.edu/gentoo-portage
    priority: -1000

science
    location: /usr/local/overlays/sci
    masters: gentoo
    priority: 0

java
    location: /usr/local/overlays/java
    masters: gentoo
    priority: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="http://lug.mtu.edu/gentoo"
LANG="en_US.utf-8"
LC_ALL="en_US.utf-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aacplus abook acl acpi adns alsa amd64 amr amrenc apng apulse auto-hinter berkdb bluetooth branding bzip2 cairo caps cdda cdr celt chm cilk clang cli client clipboard compressed-lumas consolekit contrast corefonts cracklib crypt cryptsetup cups curl cxx dane dbus detex devil dia djvu dnstap dot dpi dri dts dvd dvdr ebook ecdsa egl emboss encode epspdf epub evdev exif expat extra extras faac faad fam ffmpeg fftw firefox flac fontconfig fontforge fortran frei0r fribidi ftp gd gdbm gdk-pixbuf gif glamor gles gles1 gles2 glut gmp gnutls gold gost gpg gpm graphics graphite graphviz gsm gstreamer gtk gts gudev harfbuzz hdf5 http2 iconv icu idn imagemagick imap inotify ipv6 ipython jpeg jpeg2k kde kdenlive ladspa lame lapack lasi latex lcms ldap ldapi ldns libkms libnotify libsamplerate libsecret lldb lzma lzo mad matplotlib matroska mbox melt metapost metis minizip mms mmx mmxext mng mobi modules mp3 mp4 mpc mpeg mpi multilib musepack music ncurses nettle nls notebook nptl nscd ocaml offensive ogg oom opengl openmp openssl opus pam pango passwdqc pcre pcre16 pcre32 pdf perl pkcs11 png policykit postproc postscript ppds pstricks publishers python qml qt3support qt4 qt5 quicktime quvi rar raw readline rtmp s3tc samba sasl schroedinger science script sctp sdl seccomp session sftp sidebar skey smi smime smtp snmp sparse speex spell sqlite sse sse2 ssh ssl startup-notification svg syslog system-jpeg system-libvpx szip taglib tahoma tcpd tftpd theora threads tiff tokyocabinet toolame tools truetype twolame udev udisks unicode upower usb utils uxa vaapi vdpau vim vim-pager vim-syntax vorbis vpx wavpack wayland webp wmf wpg wps x264 x265 xa xattr xcb xetex xkb xml xmp xpm xv xvid xvmc yaz zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/llvm-3.6.1::gentoo was built with the following:
USE="clang gold libffi ncurses ocaml python static-analyzer xml -debug -doc -libedit -multitarget -test" ABI_X86="32 64 -x32" PYTHON_TARGETS="python2_7 -pypy" VIDEO_CARDS="-radeon"
Comment 1 Olivier Huber 2015-09-05 05:36:05 UTC
Created attachment 411018 [details]
build.log

I had to compress the log because of the size (6.5 Mo)
Comment 2 Bernard Cafarelli gentoo-dev 2015-09-16 13:01:49 UTC
Thanks for the report, looks like the USE=ocaml support is not good enough yet :(

The root cause is probably before the compile error, like in the lines:
> findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-09-17 06:29:21 UTC
*** Bug 559940 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Huber 2015-09-30 04:44:39 UTC
(In reply to Bernard Cafarelli from comment #2)
> Thanks for the report, looks like the USE=ocaml support is not good enough
> yet :(
> 
> The root cause is probably before the compile error, like in the lines:
> > findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm

I agree that the cause is related to this findlib warning. Most likely ocamlfind uses the files found in the system instead of the one just built. Those warnings appear also earlier in the log, but the next command still works.

I'm fine closing this bug as WONTFIX. I need to update llvm since it's blocking some other updates (mesa, wine, ...) and I'd like to use the latest clang for my code too. I think I'll update my llvm by the end of this week. If this is not fixed I'm just going to remove /usr/lib64/ocaml/llvm* before launching emerge again.

Unfortunately I'm unable to provide any help. My ocaml knowledge is pretty limited ... My guess is that manpower is limited and this looks both non-trivial and not that important. Feel free to close it.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-09-30 05:21:24 UTC
Let's ask the ml people for help.
Comment 6 Alexis Ballier gentoo-dev 2015-09-30 08:42:06 UTC
Well, this is a valid bug: if llvm ocaml stuff builds against its installed ocaml stuff, it will never be able to be rebuilt, while it needs to be rebuilt to fix its ocaml stuf...

Those errors happen when e.g. you update dev-lang/ocaml, or even an ocaml "library" used by your package. The ocaml compiler then considers having "libraries" linked against non matching versions as an error and you get what you see here.

Correct fix is to make llvm[ocaml] link against the libraries it just built, not system ones, and is probably something to fix in their build system.
Comment 7 Olivier Huber 2015-09-30 18:42:52 UTC
(In reply to Alexis Ballier from comment #6)
> 
> Correct fix is to make llvm[ocaml] link against the libraries it just built,
> not system ones, and is probably something to fix in their build system.

Do you have some hints to help finding the root cause ? The issue here is that some files are found in both a build dir and a system one. We want the ocaml stuff to use the ones in the build dir. By inspecting the build.log file, I found that findlib was complaining about having found *.cmi files in several directories before:

$ xzgrep 'WARNING' build.log.xz

findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm_CppBackend.cmi occurs in several directories: /usr/lib64/ocaml, .
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
findlib: [WARNING] Interface llvm_CppBackend.cmi occurs in several directories: /usr/lib64/ocaml, .
findlib: [WARNING] Interface llvm.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm, /usr/lib64/ocaml
findlib: [WARNING] Interface llvm_target.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/target, /usr/lib64/ocaml


The command following this warning from findlib failed only for the last 2 instances. So my naive hypothesis is that whenever it finds several directories, it uses the last one. I tried to look for the behaviour of the ocaml tools in that case, but could not find where it was documented. Alexis could you shed some light on this ? I'd like to take a stab at it.
Comment 8 Alexis Ballier gentoo-dev 2015-10-01 08:50:36 UTC
Ah, but something I had overseen is that it finds llvm.cmi in /usr/lib64/ocaml!
There is nothing you can do about this, ocaml will always find it there. This directory is more or less reserved for ocaml standard library (for this reason). Since it seems llvm installs a META file (for findlib), it should install it to a subdir of it (e.g. /usr/lib64/ocaml/llvm), which would prevent ocaml from using installed files since the build system doesn't seem to do anything wrong in that regard.

llvm-3.7.0-ocaml-multilib.patch can be altered to fit that need.

then, after properly scoping llvm ocaml bindings, 'ocamlfind list | grep llvm' should still list it, and packages using them (are there any?) should continue to work without any change.
Comment 9 Olivier Huber 2015-10-01 18:46:48 UTC
(In reply to Alexis Ballier from comment #8)
> Ah, but something I had overseen is that it finds llvm.cmi in
> /usr/lib64/ocaml!
> There is nothing you can do about this, ocaml will always find it there.
> This directory is more or less reserved for ocaml standard library (for this
> reason). Since it seems llvm installs a META file (for findlib), it should
> install it to a subdir of it (e.g. /usr/lib64/ocaml/llvm), which would
> prevent ocaml from using installed files since the build system doesn't seem
> to do anything wrong in that regard.
> 
> llvm-3.7.0-ocaml-multilib.patch can be altered to fit that need.
> 
> then, after properly scoping llvm ocaml bindings, 'ocamlfind list | grep
> llvm' should still list it, and packages using them (are there any?) should
> continue to work without any change.

Thanks for the input. I've modified llvm-3.7.0-ocaml-multilib.patch to install into  ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm

I removed every file that llvm had installed in /usr/lib64/ocaml and saved them. My plan was to update llvm, then test if this fixes the issue by replacing temporarily the new ocaml files with the old ones and recompile llvm.

But I was stopped by this (unrelated) issue: https://bugs.gentoo.org/show_bug.cgi?id=561994
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-04 06:27:50 UTC
Just to be clear, are you able to build with USE=doc and the altered patch? I'd prefer fixing issues one at a time, especially when it comes to something I have almost no knowledge of :-).
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-04 06:31:35 UTC
Well, let me change my question. Does it work after being installed like this? :-P
Comment 12 Olivier Huber 2015-10-05 15:32:49 UTC
(In reply to Michał Górny from comment #11)
> Well, let me change my question. Does it work after being installed like
> this? :-P

I was able to "force merge" with the altered patch. It failed in the install phase because of https://bugs.gentoo.org/show_bug.cgi?id=562008 , but after removing one offending line I was able to resume the install with a emerge llvm-3.7.0-r1.ebuild merge and it was successful.

Now since my computing time is limited, I'd rather do one merge to
1. try a fix for the aforementioned bug as well as testing
2. test if it can build with (out-of-date) ocaml bindings on ${ROOT}.

and (finger crossed) it should work.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-05 15:39:39 UTC
Thanks for doing this. When you're done, please provide your final diff or pull request, and I'll gladly merge it.
Comment 14 Bernard Cafarelli gentoo-dev 2015-10-12 12:43:43 UTC
I'll probably update the patch along with 3.7.0-r2 bump (currently masked). The big question, though, do the bindings still work OK when moved to /usr/libXx/ocaml/llvm ?
I do not use them and only can check that compilation is OK
Comment 15 Bernard Cafarelli gentoo-dev 2015-10-12 18:26:45 UTC
OK, can you test llvm-3.7.0-r2? ocaml files are now installed in /usr/libXx/ocaml/llvm

Sadly for older installs, it will still exhibit the problem, so the ebuild now has this blocker:
ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] )

I retested by going back to 3.6.2, and had to remove it to let 3.7.0-r2 compile.

If ocaml bindings in their new location work fine for you, I'll unmask the -r2 ebuild (as it also includes some other fixes)
Comment 16 Olivier Huber 2015-10-13 02:59:44 UTC
(In reply to Bernard Cafarelli from comment #15)
> OK, can you test llvm-3.7.0-r2? ocaml files are now installed in
> /usr/libXx/ocaml/llvm
> 
> Sadly for older installs, it will still exhibit the problem, so the ebuild
> now has this blocker:
> ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] )
> 
> I retested by going back to 3.6.2, and had to remove it to let 3.7.0-r2
> compile.
> 
> If ocaml bindings in their new location work fine for you, I'll unmask the
> -r2 ebuild (as it also includes some other fixes)

Tested and approved. I did the following: I already had the ocaml bindings installed in /usr/lib64/ocaml/llvm/, so I created a local copy of 3.7.0-r2 to  remove the blocker ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] ). I replaced the "good" ocaml files in /usr/lib64/ocaml/llvm/ with the ones from 3.6.1 that I had previously saved. It compiled just fine.

I didn't find time last week to finish this. I wanted to mimic the LLVM_ENABLE_SPHINX logic for #562008, but it didn't happened ...

Thanks to mgorny and you for handling this.
Comment 17 Olivier Huber 2015-10-13 03:02:18 UTC
(In reply to Olivier Huber from comment #16)
> 
> Thanks to mgorny and you for handling this.

And also Alexis :)
Comment 18 Bernard Cafarelli gentoo-dev 2015-10-13 13:52:54 UTC
Thanks for testing and helping here, 3.7.0-r2 is unmasked now :)