[llvm-bugs] [Bug 29020] New: LTO is broken on 32-bit hosts

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 17 10:36:59 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29020

            Bug ID: 29020
           Summary: LTO is broken on 32-bit hosts
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvm-bugs at lists.llvm.org, tejohnson at google.com
    Classification: Unclassified

gold has

  --map-whole-files           Map whole files to memory (default on 64-bit
hosts)
  --no-map-whole-files        Map relevant file parts to memory (default on
32-bit hosts)

On 32-bit hosts, the view is released by

void
File_read::clear_views(Clear_views_mode mode)
{
  bool keep_files_mapped = (parameters->options_valid()
                            && parameters->options().keep_files_mapped());
  Views::iterator p = this->views_.begin();
  while (p != this->views_.end())
    {    
      bool should_delete;
      if (p->second->is_locked() || p->second->is_permanent_view())
        should_delete = false;
      else if (mode == CLEAR_VIEWS_ALL)
        should_delete = true;
      else if ((p->second->should_cache()
                || p->second == this->whole_file_view_)
                                ^^^^^^^^^^^^^^^^^^^^^^ This is NULL on 32-bit
hosts.
               && keep_files_mapped)
        should_delete = false;
      else if (this->object_count_ > 1
               && p->second->accessed()
               && mode != CLEAR_VIEWS_ARCHIVE)
        should_delete = false;
      else 
        should_delete = true;

from:

#0  0xf71e8650 in munmap () from /libx32/libc.so.6
#1  0x005c8be5 in gold::File_read::View::~View (this=<optimized out>, 
    __in_chrg=<optimized out>)
    at /export/linux/src/binutils/binutils/gold/fileread.cc:139
#2  0x005ca045 in gold::File_read::clear_views (this=this at entry=0xad1248, 
    mode=mode at entry=gold::File_read::CLEAR_VIEWS_NORMAL)
    at /export/linux/src/binutils/binutils/gold/fileread.cc:819
#3  0x005ca1ed in gold::File_read::release (this=this at entry=0xad1248)
    at /export/linux/src/binutils/binutils/gold/fileread.cc:279
#4  0x005ca27a in gold::File_read::unlock (this=<optimized out>,
task=<optimized out>)
    at /export/linux/src/binutils/binutils/gold/fileread.cc:307
#5  0x0068570e in gold::Object::unlock (this=<optimized out>, t=<optimized
out>)
    at /export/linux/src/binutils/binutils/gold/object.h:505
#6  gold::Plugin_manager::release_input_file (this=<optimized out>, 
    handle=<optimized out>) at
/export/linux/src/binutils/binutils/gold/plugin.cc:802
#7  0xf2ccad36 in (anonymous namespace)::PluginInputFile::~PluginInputFile (
    this=0xffff8fb0, __in_chrg=<optimized out>)
    at /export/gnu/import/git/llvm-x32/tools/gold/gold-plugin.cpp:77
#8  0xf2cceb3b in allSymbolsReadHook ()
    at /export/gnu/import/git/llvm-x32/tools/gold/gold-plugin.cpp:814
#9  0xf2ccefc7 in all_symbols_read_hook ()
    at /export/gnu/import/git/llvm-x32/tools/gold/gold-plugin.cpp:860

Passing --map-whole-files to gold is a workaround.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160817/379a36ca/attachment.html>


More information about the llvm-bugs mailing list