<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - LTO is broken on 32-bit hosts"
   href="https://llvm.org/bugs/show_bug.cgi?id=29020">29020</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LTO is broken on 32-bit hosts
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hjl.tools@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, tejohnson@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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@entry=0xad1248, 
    mode=mode@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@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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>