<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 - Darwin when compiling in backward compatibility 10.15 -> 10.13, can't go out of box on latter"
   href="https://bugs.llvm.org/show_bug.cgi?id=46533">46533</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Darwin when compiling in backward compatibility 10.15 -> 10.13, can't go out of box on latter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm@dyatkovskiy.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23670" name="attach_23670" title="HOST_LINK_VERSION patch">attachment 23670</a> <a href="attachment.cgi?id=23670&action=edit" title="HOST_LINK_VERSION patch">[details]</a></span>
HOST_LINK_VERSION patch

Steps to reproduce:
Build project on Mac OS X 10.15 with following cmake options:


        cmake -DCMAKE_BUILD_TYPE=Release \
              -DCMAKE_INSTALL_PREFIX=$PWD/install \
              -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
              -DLLVM_ENABLE_PROJECTS="clang libcxx libcxxabi" \
              -G "Ninja" <path-to-llvm-project>/llvm


Then run regular build commands:

ninja
ninja install

Copy installation onto the Mac OS X 10.13 platform, and try to compile
something (you should have either CommandLineTools or XCode installed):

<installation-path>/bin/clang++ test.cpp

Compilation will fail with following errors:

    ld: unknown option: -platform_version
    clang-11: error: linker command failed with exit code 1 (use -v to see
invocation)

Reasons:

It happens because linker version is detected during clang compilation out of
"ld -v" command, which will return newer linker version than on 10.13.

Then during test.cpp compilation, if "-mlinker-version" is not passed, driver
will check for "HOST_LINK_VERSION" constant and will misdecide that it should
use new linker API and thus will pass unsupported parameters.

I propose to enable HOST_LINK_VERSION customization on cmake stage. Then it
would be possible to fix problem by passing "-DHOST_LINK_VERSION=409.12" on
cmake configure stage.

Please find a patch with fix in attachment.

Thanks!</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>