[llvm-bugs] [Bug 46533] New: Darwin when compiling in backward compatibility 10.15 -> 10.13, can't go out of box on latter
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jul 1 09:28:49 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46533
Bug ID: 46533
Summary: Darwin when compiling in backward compatibility 10.15
-> 10.13, can't go out of box on latter
Product: clang
Version: 10.0
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: llvm at dyatkovskiy.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
Created attachment 23670
--> https://bugs.llvm.org/attachment.cgi?id=23670&action=edit
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!
--
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/20200701/2346a2d1/attachment-0001.html>
More information about the llvm-bugs
mailing list