[PATCH] D46857: [CMake] Detect the compiler runtime and standard library

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 16:56:30 PDT 2018


dim added subscribers: emaste, dim.
dim added a comment.

Do we still leave the defaults for particular OSes here?  I'm asking because for example in FreeBSD, we use libcxxrt, but you *won't* find it in linker output, since our `libc++.so` is a linker script:

  $ clang++ /usr/local/share/cmake/Modules/DummyCXXFile.cxx -###
  FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
  Target: x86_64-unknown-freebsd11.2
  Thread model: posix
  InstalledDir: /usr/bin
   "/usr/bin/clang++" "-cc1" "-triple" "x86_64-unknown-freebsd11.2" "-emit-obj" "-mrelax-all" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "DummyCXXFile.cxx" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-dwarf-column-info" "-debugger-tuning=gdb" "-resource-dir" "/usr/lib/clang/6.0.0" "-internal-isystem" "/usr/include/c++/v1" "-fdeprecated-macro" "-fdebug-compilation-dir" "/home/dim/src/llvm/trunk" "-ferror-limit" "19" "-fmessage-length" "160" "-fobjc-runtime=gnustep" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "/tmp/DummyCXXFile-5ffab3.o" "-x" "c++" "/usr/local/share/cmake/Modules/DummyCXXFile.cxx"
   "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/tmp/DummyCXXFile-5ffab3.o" "-lc++" "-lm" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"

E.g., you see `-lc++`, and our `/usr/lib/libc++.so` contains:

  $ cat /usr/lib/libc++.so
  /* $FreeBSD: stable/11/lib/libc++/libc++.ldscript 253917 2013-08-03 16:23:43Z dim $ */
  GROUP ( /usr/lib/libc++.so.1 /usr/lib/libcxxrt.so )

So what would `check_link_libraries` find in this case?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D46857





More information about the llvm-commits mailing list