[PATCH] D119038: [BOLT] Fix bolt_rt_instr for osx build condition

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 10:21:00 PST 2022


yota9 marked 3 inline comments as done.
yota9 added inline comments.


================
Comment at: bolt/runtime/CMakeLists.txt:33
 
-if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   add_library(bolt_rt_instr_osx STATIC
----------------
Amir wrote:
> yota9 wrote:
> > alexander-shaposhnikov wrote:
> > > alexander-shaposhnikov wrote:
> > > > unless I'm missing something this appears to be incorrect.
> > > > Basically we used to build the osx runtime library regardless of the host platform
> > > > (clang works as a cross compiler). 
> > > @Amir - the runtime is not linked into BOLT, instead, it's used for creating the final output, thus the target for which we are building the project is not directly related to the target platforms supported by the tool itself.
> > The thing is that the clang may not support this target. I'm building it in arm linux env and it fails expectedly
> @alexander-shaposhnikov
> Thanks for clarifying. My mistake.
> 
> @yota9
> Are you using custom-built clang? IIUC clang is supposed to be a cross-compiler out of the box. As a workaround, we can group rt_instr targets similar to LLVM_ENABLE_TARGETS and select them at configuration time.
You are right, this is my fault. Let me update the patch


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119038/new/

https://reviews.llvm.org/D119038



More information about the llvm-commits mailing list