Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501684 - sys-devel/llvm-3.4 - set proper paths for llvm-config's obj-root and src-root
Summary: sys-devel/llvm-3.4 - set proper paths for llvm-config's obj-root and src-root
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 12:26 UTC by T6n9naYMKJ
Modified: 2016-07-03 07:50 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description T6n9naYMKJ 2014-02-18 12:26:45 UTC
llvm-config returns temporary paths for obj-root and src-root:

> llvm-config --obj-root 
/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-amd64
> llvm-config --src-root 
/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4

It complicates the build process of other packages depending on those entries. The Debian guys recently included a patch to fix this:
http://anonscm.debian.org/viewvc/pkg-llvm/llvm-toolchain/branches/3.4/debian/patches/fix-llvm-config-obj-src-root.patch?view=markup&pathrev=1096

Maybe we can fix this too.

Reproducible: Always
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-20 17:11:00 UTC
On the Debian patch:

> Index: llvm-toolchain-3.3/tools/llvm-config/llvm-config.cpp
> ===================================================================
> --- llvm-toolchain-3.3.orig/tools/llvm-config/llvm-config.cpp   2013-11-26 10:49:16.183929247 +0100
> +++ llvm-toolchain-3.3/tools/llvm-config/llvm-config.cpp        2013-11-26 10:49:16.179929247 +0100
> @@ -302,9 +302,9 @@
>        } else if (Arg == "--build-mode") {
>          OS << LLVM_BUILDMODE << '\n';
>        } else if (Arg == "--obj-root") {
> -        OS << LLVM_OBJ_ROOT << '\n';
> +        OS << ActivePrefix << "/build/" << '\n';
>        } else if (Arg == "--src-root") {
> -        OS << LLVM_SRC_ROOT << '\n';
> +        OS << ActivePrefix << "/build/" << '\n';
>        } else {
>          usage();
>        }

Doesn't this actually invent some weirdo location like /usr/build?

Honestly, I have no idea what to do with this -- and moreover, I have no idea why would anyone sane use this location in a build system...
Comment 2 T6n9naYMKJ 2014-02-24 08:07:24 UTC
> Doesn't this actually invent some weirdo location like /usr/build?
Should be /usr/share/llvm-.../build in Ubuntu.

> Honestly, I have no idea what to do with this -- and moreover, I have no
> idea why would anyone sane use this location in a build system...
They added some patches to keep Makefile.rules, Makefile.config and the Release-link (back to /usr/share/llvm-...) in build/. Otherwise one can't build some LLVM subprojects and has to use ugly hacks: http://forums.gentoo.org/viewtopic-t-983748.html
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-24 08:13:30 UTC
As long as autotools are concerned, we usually can't support building subprojects outside of llvm ebuild. Which of the subprojects you need?
Comment 4 T6n9naYMKJ 2014-02-26 08:31:21 UTC
For instance KLEE. But my version has many patches and therefore integrating the original branch into the llvm ebuild is not an option.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-26 08:36:04 UTC
(In reply to T6n9naYMKJ from comment #4)
> For instance KLEE. But my version has many patches and therefore integrating
> the original branch into the llvm ebuild is not an option.

Well, you can either try to 'replace' the original branch in the ebuild (if we add it) with your own, or you'd have to work on your own llvm ebuild. We can't really support building against Makefiles like this since, well, the build system is so mis-designed it hurts.

Also I should note that we're slowly moving away from Makefiles in LLVM in favor of CMake which is a bit less broken in that project.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-02 19:58:38 UTC
As a note, in reply to bug #565358 I've added a patch that causes llvm-config to error out when obj-root or src-root is requested. I'm afraid this is not what you really wanted but at least it prevents reverse dependencies from trying to use temporary directories.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-07-03 07:50:44 UTC
As noted above, we went a different way and I don't think we can sanely support what you need. Please let me know if you have any ideas what to do (with llvm-3.8*+).