sys-devel/llvm: Fix implicit dependency on app-arch/libxar
authorMichał Górny <mgorny@gentoo.org>
Fri, 19 Jan 2018 19:50:48 +0000 (20:50 +0100)
committerMichał Górny <mgorny@gentoo.org>
Fri, 19 Jan 2018 22:21:43 +0000 (23:21 +0100)
Support conditionally using app-arch/libxar in LLVM 6+, and explicitly
force it off in LLVM 5. This library is used only to dump LLVM bitcode
in Mach-O files and it's very rare, so we can safely presume that nobody
really used it and it's not worth rebuild due to revbumping LLVM 5.

Closes: https://bugs.gentoo.org/645038

sys-devel/llvm/llvm-5.0.1.ebuild
sys-devel/llvm/llvm-6.0.9999.ebuild
sys-devel/llvm/llvm-9999.ebuild
sys-devel/llvm/metadata.xml

index 949988d12d13ac983b062bc50b5f5fabc18a08f4..f1eff0e8a3d4b97d9eb1208bda0f6cb7d49eb912 100644 (file)
@@ -122,6 +122,7 @@ multilib_src_configure() {
 
                -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
                -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+               -DHAVE_LIBXAR=0
 
                # disable OCaml bindings (now in dev-ml/llvm-ocaml)
                -DOCAMLFIND=NO
index 03eed722f8d09c09793298baa5729ecdc8775e96..f89769dc28303166ce88eeadec6209a671b850e9 100644 (file)
@@ -35,7 +35,7 @@ LICENSE="UoI-NCSA rc BSD public-domain
        llvm_targets_ARM? ( LLVM-Grant )"
 SLOT="$(ver_cut 1)"
 KEYWORDS=""
-IUSE="debug doc gold libedit +libffi ncurses test xml
+IUSE="debug doc gold libedit +libffi ncurses test xar xml
        kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
 RESTRICT="!test? ( test )"
 
@@ -45,6 +45,7 @@ RDEPEND="
        libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
        libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
        ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+       xar? ( app-arch/xar )
        xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )"
 # configparser-3.2 breaks the build (3.3 or none at all are fine)
 DEPEND="${RDEPEND}
@@ -119,6 +120,8 @@ multilib_src_configure() {
 
                -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
                -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+               # used only for llvm-objdump tool
+               -DHAVE_LIBXAR=$(multilib_native_usex xar 1 0)
 
                # disable OCaml bindings (now in dev-ml/llvm-ocaml)
                -DOCAMLFIND=NO
index 275fb80a6bdf2eda9fbc365c62b86c632df87994..d1550613720d03dd3b2d98f6128c5b7d7e6167a8 100644 (file)
@@ -37,7 +37,7 @@ LICENSE="UoI-NCSA rc BSD public-domain
        llvm_targets_ARM? ( LLVM-Grant )"
 SLOT="7"
 KEYWORDS=""
-IUSE="debug doc gold libedit +libffi ncurses test xml
+IUSE="debug doc gold libedit +libffi ncurses test xar xml
        kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
 RESTRICT="!test? ( test )"
 
@@ -47,6 +47,7 @@ RDEPEND="
        libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
        libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
        ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+       xar? ( app-arch/xar )
        xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )"
 # configparser-3.2 breaks the build (3.3 or none at all are fine)
 DEPEND="${RDEPEND}
@@ -124,6 +125,8 @@ multilib_src_configure() {
 
                -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
                -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+               # used only for llvm-objdump tool
+               -DHAVE_LIBXAR=$(multilib_native_usex xar 1 0)
 
                # disable OCaml bindings (now in dev-ml/llvm-ocaml)
                -DOCAMLFIND=NO
index f532f3a746df7b7ab65ce8ba2e74d5da51e08ca5..66c9caef166096d8c75b42b6fd2fa81a09770dbc 100644 (file)
@@ -20,5 +20,7 @@
                <flag name="ncurses">Support querying terminal properties using ncurses' terminfo</flag>
                <flag name="sanitize">Build compiler-rt's sanitizers</flag>
                <flag name="static-analyzer">Install the Clang static analyzer (requires USE=clang)</flag>
+               <flag name="xar">Support dumping LLVM bitcode sections in Mach-O files
+                       (uses <pkg>app-arch/libxar</pkg>)</flag>
        </use>
 </pkgmetadata>