Compilation without linux-vdso

Hi all,

I’ve been trying the get Zeek to work on a platform that does not support linux-vdso.

I see that vdso has 4 syscalls out of which the first 3 are used in the code-

  1. gettimeofday
  2. clock_gettime
  3. time
  4. getcpu

A few things that I already tried doing-

  1. For the time being, removing all usages of “gettimeofday” and “clock_gettime”
  2. Commenting out the following from cmake files and bro-config-
    check_include_files(HAV_SYS_TIME_H)
    check_include_files(“time.h;sys/time.h”, TIME_WITH_SYS_TIME)

I’m not sure I’m doing everything to replace/remove the occurrences of the syscalls because ldd still shows that the bro execuatble is linking to linux-vdso.so and the LD logs show that symbols for those syscalls are being fetched (segfaults at this point)

Please let me know if I’m missing something?

Thanks,
Nafisa

Bro shouldn't depend on vDSO directly, it's libc that optionally
depends on vDSO, so I don't think you want to patch the Bro source
code to remove those syscalls -- it's just using standard library
functionality.

I haven't looked much into how to disable vDSO, you can maybe search
that out more on your own if that's really what you need, but I'd
guess there's some kernel/boot option for it. It also was not clear
why you say the platform doesn't support vDSO, but the kernel goes
ahead and maps/links linux-vdso.so anyway -- seems weird, so you may
have to give more specifics on the particular platform.

- Jon

Thanks a lot for the response.

I did a little bit of debugging myself and the problem is now reduced to using a custom (with some modifications for the platform) version of gcc.

To make this happen-
I tried set(CMAKE_C_COMPILER) but ./configure goes into an infinite loop which I think is bug -
https://public.kitware.com/pipermail/cmake/2009-November/033133.html

I then tried to run configure like this-
CC= CXX=<path to g++> CFLAGS= CXXFLAGS= ./configure

This picks the right compiler but runs into issues with openssl (header not found). I tried adding root and include paths for openssl by calling append_cache_entry() but it doesn’t work.

Was just wondering if I’m missing something here? Are there more changes required to safely replace the default compiler?

Thanks,
Nafisa

I then tried to run configure like this-
CC=<path to gcc> CXX=<path to g++> CFLAGS=<path to glibc> CXXFLAGS=<path to glibc> ./configure

This picks the right compiler but runs into issues with openssl (header not found). I tried adding root and include paths for openssl by calling append_cache_entry() but it doesn't work.

I'd first try using the --with-openssl= configure option before
manually patching in workarounds.

Or if you must patch, I'd probably hack in custom paths just before
"FindRequiredPackage(OpenSSL)" in CMakeLists.txt rather than the
configure script. If you're patching source code directly and still
have problems, it's hard to help further unless you give the exact
patch you are using.

Was just wondering if I'm missing something here? Are there more changes required to safely replace the default compiler?

I think you were setting the compiler fine, but sounds like now the
OpenSSL headers not being found is likely a separate/unrelated issue
to figure out.

- Jon