tcpdump mailing list archives

Re: build failures on Solaris


From: Guy Harris via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Sun, 8 Aug 2021 12:02:53 -0700

--- Begin Message --- From: Guy Harris <gharris () sonic net>
Date: Sun, 8 Aug 2021 12:02:53 -0700
On Aug 8, 2021, at 2:26 AM, Denis Ovsienko <denis () ovsienko info> wrote:

GCC+CMake fails early now (see attached).

Good!  That reveals the *underlying* problem:

1) CMake, by default, checks for both a C *and* a C++ compiler;

2) if it's checking for both compilers, the way CMake determines CMAKE_SIZEOF_VOID_P is to:

        check for a C compiler;

        set CMAKE_C_SIZEOF_DATA_PTR to the size of data pointers in that C compiler with whatever C flags are being 
used;

        set CMAKE_SIZEOF_VOID_P to CMAKE_C_SIZEOF_DATA_PTR;

        check for a C++ compiler;

        set CMAKE_CXX_SIZEOF_DATA_PTR to the size of data pointers in that C++ compiler with whatever C++ flags are 
being used;

        set CMAKE_SIZEOF_VOID_P to CMAKE_CXX_SIZEOF_DATA_PTR;

3) Sun/Oracle's C and C++ compilers default to building *32-bit* code;

4) the version of GCC installed on the Solaris 11 builder appears to default to building 64-bit code;

5) there does not appear to be a version of G++ installed, so CMake finds "/usr/bin/CC", which is the Sun/Oracle C++ 
compiler;

6) as a result of the above, CMake ends up setting CMAKE_SIZEOF_VOID_P to 4, which can affect the process of finding 
libraries;

7) nevertheless, the C code (which is *all* the code - ain't no C++ in tcpdump) is compiled 64-bit;

8) hilarity ensues.

I've checked in a change to explicitly tell CMake "this is a C-only project, don't check for a C++ compiler", so it 
should now think it's building 64-bit when building with GCC.

See whether that fixes things.

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: