This change introduces support for building libuwind. The library
build should be complete, but not all CMake options have been
replicated in GN. We also don't support tests yet.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/utils/gn/secondary/libunwind/src/BUILD.gn | ||
---|---|---|
20 ↗ | (On Diff #194041) | probably need a comment here to keep the sync script happy? |
23 ↗ | (On Diff #194041) | Does making this a source_set and having both libs depend on that not work for static_library? |
51 ↗ | (On Diff #194041) | why do you remove config_nortti and then add -fno-rtti back in here? Can't you just not remove it in the first place? |
77 ↗ | (On Diff #194041) | It looks for .h files, no matter if in a target or not. Does not adding this to public help the script? That'd surprise me. |
llvm/utils/gn/secondary/libunwind/src/BUILD.gn | ||
---|---|---|
23 ↗ | (On Diff #194041) | I did that originally, but I changed it to build static and shared library separately, which follows the recent change to CMake build which also stopped using object library: https://github.com/llvm/llvm-project/commit/1de15f6f336dba6e26c18c224d1b53ba617f57f0#diff-2467f5cba1ecc34d53f4480cd654aa55 which is itself is a follow up to http://llvm.org/viewvc/llvm-project?view=revision&revision=356150. The reason why we did that for libunwind, libc++abi and libunwind is because it's sometimes necessary to use different options for the static and shared library, e.g. on some platforms static library would be built without -fPIC but shared would still use it. In case of Fuchsia we also use libunwind_hermetic_static_library option which requires building static library objects with -fvisibility=hidden. This required a lot of complicated logic, not using the source set actually makes it simpler in this case. |
51 ↗ | (On Diff #194041) | In CMake build, it's possible to re-enable RTTI using the LLVM_ENABLE_RTTI that some users actually use, especially when linking LLVM into other projects. Do we plan on providing the same flag in LLVM build? If yes, that would be an argument for setting -fno-rtti here explicitly because it should be independent of the global LLVM setup. |
77 ↗ | (On Diff #194041) | I think the problem is that the CMake build uses ${CMAKE_CURRENT_SOURCE_DIR}/../include/libunwind.h while I tried using ../include/libunwind.h, the script doesn't seem to handle variables or ... Any suggestions how to work around it? |
llvm/utils/gn/secondary/libunwind/src/BUILD.gn | ||
---|---|---|
51 ↗ | (On Diff #194041) | Not unless someone needs it. I'd default to not adding things until they're needed. |
77 ↗ | (On Diff #194041) | Is the ${CMAKE_CURRENT_SOURCE_DIR} needed on the cmake side? Some places don't use it: $ git grep '\.\..*\.h' 'clang*CMake*' |