Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501764 - sys-devel/llvm-9999 - clang-3.5-gentoo-install.patch fails
Summary: sys-devel/llvm-9999 - clang-3.5-gentoo-install.patch fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-02-19 11:27 UTC by darkbasic
Modified: 2014-02-21 08:54 UTC (History)
3 users (show)

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


Attachments
New patch (clang-3.5-gentoo-install.patch,2.70 KB, text/plain)
2014-02-19 11:27 UTC, darkbasic
Details
previous clang-3.5 patch sans header and addProfileRT section (clang-3.5-gentoo-install.patch,2.12 KB, patch)
2014-02-21 02:23 UTC, James Harvey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description darkbasic 2014-02-19 11:27:14 UTC
Since a few days it complains when trying to patch tools/clang/tools/scan-build/scan-build (both hunks). I really don't understand why it doesn't apply anymore but I tried to create a new patch and it works flawlessly now (attached).

Reproducible: Always
Comment 1 darkbasic 2014-02-19 11:27:45 UTC
Created attachment 370752 [details]
New patch
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-20 17:07:49 UTC
+  20 Feb 2014; Michał Górny <mgorny@gentoo.org>
+  files/clang-3.5-gentoo-install.patch:
+  Update clang patch wrt bug #501764.

Committed, not tested since I'm no longer using the live ebuilds. Hope you attached a good patch :). Thanks.
Comment 3 darkbasic 2014-02-20 18:20:13 UTC
I'm sorry but I have to reopen: since last commit my patch is not enough anymore.
https://github.com/llvm-mirror/clang/commit/43ad7ade304afe59f8f696de9aa7327c7acb0d3c

Someone needs to have a look at clang-3.5-gentoo-install.patch
Comment 4 James Harvey 2014-02-21 02:23:38 UTC
Created attachment 370922 [details, diff]
previous clang-3.5 patch sans header and addProfileRT section

clang-3.5-gentoo-install.patch broke due to upstream changes in tools/clang/lib/Driver/Tools.cpp

Section of the original patch file having trouble:

@@ -222,7 +222,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
   // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
   // not supported by old linkers.
   std::string ProfileRT =
-    std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
+    "-l:libprofile_rt.a";

   CmdArgs.push_back(Args.MakeArgString(ProfileRT));
 }

New upstream code appears to have solved the issue requiring a patch:

static void addProfileRT(
    const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) {
  if (!(Args.hasArg(options::OPT_fprofile_arcs) ||
        Args.hasArg(options::OPT_fprofile_generate) ||
        Args.hasArg(options::OPT_fprofile_instr_generate) ||
        Args.hasArg(options::OPT_fcreate_profile) ||
        Args.hasArg(options::OPT_coverage)))
    return;

  // The profile runtime is located in the OS-specific resource directory and
  // has name "libclang_rt.profile-<ArchName>.a".
  SmallString<128> LibProfile(TC.getDriver().ResourceDir);
  llvm::sys::path::append(
      LibProfile, "lib", getOSNameForCompilerRTLib(TC),
      Twine("libclang_rt.profile-") + getArchNameForCompilerRTLib(TC) + ".a");

  CmdArgs.push_back(Args.MakeArgString(LibProfile));
}

I removed the addProfileRT section of the patch, both LLVM and clang built fine against LLVM git version f116e5308d2eed4b531da795e8eed91211c01241.
I also deleted the patch header since it looked out of date.  Feel fee to re-add it if need be.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-21 08:54:22 UTC
+  21 Feb 2014; Michał Górny <mgorny@gentoo.org>
+  files/clang-3.5-gentoo-install.patch:
+  Update clang patch wrt bug #501764, again.