https://bugs.kde.org/show_bug.cgi?id=439046

            Bug ID: 439046
           Summary: valgrind is unusably large when linked with lld
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: matts...@gmail.com
  Target Milestone: ---

clang/lld pads out the .text section by the amount given by the -Ttext=...
option. This produces enormous executables in valgrind (memcheck-amd64-linux is
~1.4GB). This is the result of valgrind's configure.ac testing for linker
options -Ttext-segment=... which lld does not support and falling back to
-Ttext=... which was subject to a breaking change in behavior in lld-10 (see
[1]).

The patch at
https://github.com/paulfloyd/freebsd_valgrind/commit/9748df5f6a0cefd5b4a4beeeffe1d3668611e561
modifies configure.ac to test for lld's --image-base=... option which provides
the desired behavior.

I dug into this when I found valgrind to be unusably large (~14GB) on ChromeOS.
See [2]. Searching for relevant linker arguments with "valgrind" and "lld" lead
me to the GitHub patch.

It would be great to have this upstream sooner rather than later, because that
greatly simplifies the justification for cherry-picking the patch in downstream
distributions.

[1] https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
[2] https://issuetracker.google.com/issues/191520718

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to