<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 doesn't work on RISC-V rv64imafdc"
   href="https://bugs.llvm.org/show_bug.cgi?id=44836">44836</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LTO doesn't work on RISC-V rv64imafdc
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>bero@lindev.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang 10.0-rc1 on riscv64-linux (RV64IMAFDC) breaks if LTO is enabled --
apparently the correct ABI isn't passed to the linker:

$ clang -march=rv64imafdc test.c
[works perfectly, binary works]
$ clang -march=rv64imafdc -flto test.c
/usr/bin/ld: /tmp/lto-llvm-f65f95.o: can't link soft-float modules with
double-float modules
/usr/bin/ld: failed to merge target specific data of file
/tmp/lto-llvm-f65f95.o
clang-10: error: linker command failed with exit code 1 (use -v to see
invocation)
$ clang -march=rv64imafdc -flto -fuse-ld=lld test.c
ld.lld: error: lto.tmp: cannot link object files with different floating-point
ABI
ld.lld: error: static-reloc.c:(.text+0x0): relocation R_RISCV_ALIGN requires
unimplemented linker relaxation; recompile with -mno-relax
ld.lld:
/builddir/build/BUILD/llvm-project-release-10.x/lld/ELF/Relocations.cpp:987:
uint64_t lld::elf::{anonymous}::OffsetGetter::get(uint64_t): Assertion
`pieces[i].inputOff <= off && "Relocation not in any piece"' failed.
Stack dump:
0.      Program arguments: /usr/bin/ld.lld --build-id --eh-frame-hdr -m
elf64lriscv -dynamic-linker /lib/ld-linux-riscv64-lp64d.so.1 -o a.out
/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/../../../../lib64/crt1.o
/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/crti.o
/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/crtbegin.o
-L/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1
-L/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/../../../../lib64
-L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib64/lp64d
-L/usr/lib64/lp64d
-L/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/../../../../riscv64-openmandriva-linux-gnu/lib
-L/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/../../..
-L/usr/bin/../lib -L/lib -L/usr/lib -plugin /usr/bin/../lib64/LLVMgold.so
/tmp/test-6791f6.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
--as-needed -lgcc_s --no-as-needed
/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/crtend.o
/usr/bin/../lib64/gcc/riscv64-openmandriva-linux-gnu/9.2.1/crtn.o 
clang-10: error: unable to execute command: Segmentation fault (core dumped)
clang-10: error: linker command failed due to signal (use -v to see invocation)</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>