[PATCH] D81946: [WIP][RISCV] Enable multilib support even without a detected GCC install

Simon Cook via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 02:42:03 PDT 2020


simoncook added a comment.

Thanks for this Ed. I've tried building a toolchain with it and noticed a couple of things:

1. Printing the set of multilibs doesn't provide a default, I think that should still be defined and printed with `-print-multi-libs`
2. There's a slight path finding issue if I build compiler-rt with an option like `-DCMAKE_INSTALL_PREFIX=$(clang -print-resource-dir)/${CRT_MULTILIB_DIR}` (the latter being the multilib dir printed by `-print-multi-libs`).

The build system installs crtbegin/crtend/clang_rt into `${CMAKE_INSTALL_PREFIX}/lib` (if I set the OS to ""), but clang searches for the multilib variants in a folder without `/lib` at the end.

Looking at compiler-rt's CMake that seems to be down to:

  if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
    set(COMPILER_RT_LIBRARY_OUTPUT_DIR
      ${COMPILER_RT_OUTPUT_DIR})
    set(COMPILER_RT_LIBRARY_INSTALL_DIR
      ${COMPILER_RT_INSTALL_PATH})
  else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
    set(COMPILER_RT_LIBRARY_OUTPUT_DIR
      ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
    set(COMPILER_RT_LIBRARY_INSTALL_DIR
      ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
  endif()

I can work around this by setting `COMPILER_RT_OS_DIR` to "..", but I'm wondering whether it makes more sense to allow "lib" to be replaced with a multilib directory name, preserving "lib" for the default multilib?

Other than that, a first bit of testing this is working great, it's nice having native bare metal RISC-V multilibs for Clang.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81946





More information about the cfe-commits mailing list