[llvm] r367304 - [CMake] Define _FILE_OFFSET_BITS=64 on Solaris

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 01:47:00 PDT 2019


Merged to release_90 in r367526.

On Tue, Jul 30, 2019 at 12:32 PM Rainer Orth via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> Author: ro
> Date: Tue Jul 30 03:33:20 2019
> New Revision: 367304
>
> URL: http://llvm.org/viewvc/llvm-project?rev=367304&view=rev
> Log:
> [CMake] Define _FILE_OFFSET_BITS=64 on Solaris
>
> This is the compantion patch to https://reviews.llvm.org/D64482, needed to ensure
> that builds with host compilers that don't yet predefine _FILE_OFFSET_BITS=64 on
> Solaris succeed by always making the host and freshly built clang consistent.
>
> Tested on x86_64-pc-solaris2.11.
>
> Differential Revision: https://reviews.llvm.org/D64483
>
> Modified:
>     llvm/trunk/CMakeLists.txt
>     llvm/trunk/cmake/config-ix.cmake
>
> Modified: llvm/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=367304&r1=367303&r2=367304&view=diff
> ==============================================================================
> --- llvm/trunk/CMakeLists.txt (original)
> +++ llvm/trunk/CMakeLists.txt Tue Jul 30 03:33:20 2019
> @@ -833,6 +833,11 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHE
>            add_definitions("-D_LARGE_FILE_API")
>  endif()
>
> +# Build with _FILE_OFFSET_BITS=64 on Solaris to match g++ >= 9.
> +if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
> +          add_definitions("-D_FILE_OFFSET_BITS=64")
> +endif()
> +
>  # Work around a broken bfd ld behavior. When linking a binary with a
>  # foo.so library, it will try to find any library that foo.so uses and
>  # check its symbols. This is wasteful (the check was done when foo.so
>
> Modified: llvm/trunk/cmake/config-ix.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=367304&r1=367303&r2=367304&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/config-ix.cmake (original)
> +++ llvm/trunk/cmake/config-ix.cmake Tue Jul 30 03:33:20 2019
> @@ -30,6 +30,12 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHE
>            list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_LARGE_FILE_API")
>  endif()
>
> +# Do checks with _FILE_OFFSET_BITS=64 on Solaris, because we will build
> +# with those too.
> +if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
> +          list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
> +endif()
> +
>  # include checks
>  check_include_file(dlfcn.h HAVE_DLFCN_H)
>  check_include_file(errno.h HAVE_ERRNO_H)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list