[libcxx-commits] [PATCH] D111244: [libc++][AIX] Add scripts and config for building with the libcxx CI infrastructure
David Tenty via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 7 13:45:42 PDT 2021
daltenty marked 2 inline comments as done.
daltenty added inline comments.
================
Comment at: libcxx/cmake/caches/AIX.cmake:3-5
+set(CMAKE_C_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-G -Wl,-bcdtors:all:-2147483548:s" CACHE STRING "")
----------------
ldionne wrote:
> ðŸ˜
>
> Is that all necessary for libc++ to work on top of AIX? If so, does that mean users have to specify those when building their own programs too? It's none of my business, but perhaps it'd be awesome if the Clang driver (and the C library for `__LIBC_NO_CPP_MATH_OVERLOADS__`) handled a bit more automatically, from a user perspective.
The `__LIBC_NO_CPP_MATH_OVERLOADS__` actually does get added by the clang driver automatically, but thanks to the implementation we (perhaps some what naively) did in https://reviews.llvm.org/D109078, it won't be applied with `-nostdlib++`. We could look at changing that situation, but that's the status quo in the build compiler for now.
The linker flags are necessary due to particular semantics of the AIX linker:
-G enables support for the runtime linker, which is necessary if we want to be able to rebind any references in the library.
The priority value we pass in bcdtors is required to set the static init priority for the library relative to other modules. I believe this is necessary because AIX doesn't support SVR4 dependency ordering between dependent modules, so we have to assign a value sufficiently low enough to make sure we init before any other dependent libraries.
(We could move some of this into the main CMakeLists if you think it's more appropriate though)
================
Comment at: libcxxabi/test/lit.site.cfg.in:1
@AUTO_GEN_COMMENT@
----------------
ldionne wrote:
> I'm going to suggest that you don't even modify this file at all. No need to support legacy testing configs, we're trying to move away from them. Instead, you could specify
>
> ```
> -DLIBCXXABI_TEST_CONFIG="ibm-libc++-shared.cfg.in"
> ```
>
> in `run-buildbot` above and you'd never use the legacy config!
I've done this, but it requires creating and tweaking a separate bridge file so we point at the right things for the libcxxabi tests. Let me know if you'd like that split out to a separate PR.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111244/new/
https://reviews.llvm.org/D111244
More information about the libcxx-commits
mailing list