[PATCH] D101335: [ASan][Darwin] Fix `TestCases/Darwin/init_for_dlopen.cpp` when running in a standalone build.

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 14:51:14 PDT 2021


yln added a comment.

Would it be possible (and wouldn't it be better?) to set `config.compiler_rt_libdir` to the right path in the first place?   This way we wouldn't get into the "path mismatch" state that we warn about.

I can see that `compiler_rt_libdir` is used in places (other than computing `shared_libasan_path`) as well.

First set by cmake `compiler-rt/cmake/Modules/AddCompilerRT.cmake`.  Ideally, we would pick the right path there, right?

  # Configure lit configuration files, including compiler-rt specific variables.
  function(configure_compiler_rt_lit_site_cfg input output)
    set_llvm_build_mode()
  
    get_compiler_rt_output_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} output_dir)
  
    string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER})
    string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR ${output_dir})
  
    configure_lit_site_cfg(${input} ${output})
  endfunction()

There also seems to be another config hook in `compiler-rt/unittests/lit.common.unit.configured.in`:

  # LLVM tools dir and build mode can be passed in lit parameters,
  # so try to apply substitution.
  try:
    config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
    config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params
    config.llvm_build_mode = config.llvm_build_mode % lit_config.params
  except KeyError as e:
    key, = e.args
    lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))

Can we use or change one of these existing mechanisms?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101335



More information about the llvm-commits mailing list