Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: sig_t is not portable #1825

Open
mtelka opened this issue Feb 6, 2025 · 1 comment
Open

[Bug]: sig_t is not portable #1825

mtelka opened this issue Feb 6, 2025 · 1 comment

Comments

@mtelka
Copy link

mtelka commented Feb 6, 2025

Describe the issue

Compilation of tests fails on OpenIndiana due to sig_t:

/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc: In function 'bool {anonymous}::SleepForBounded(absl::lts_20240116::Duration, absl::lts_20240116::Duration, absl::lts_20240116::Duration, absl::lts_20240116::Duration, AlarmPolicy, int*)':
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:62:5: error: 'sig_t' was not declared in this scope
   62 |     sig_t old_alarm = SIG_DFL;
      |     ^~~~~
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:65:7: error: 'old_alarm' was not declared in this scope
   65 |       old_alarm = signal(SIGALRM, AlarmHandler);
      |       ^~~~~~~~~
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:77:23: error: 'old_alarm' was not declared in this scope
   77 |       signal(SIGALRM, old_alarm);
      |                       ^~~~~~~~~

Steps to reproduce the problem

Compile abseil-cpp 20240116.3 with -DABSL_BUILD_TESTING=ON and -DABSL_USE_EXTERNAL_GOOGLETEST=ON on OpenIndiana.

What version of Abseil are you using?

20240116.3

What operating system and version are you using?

OpenIndiana Hipster (an illumos distro)

What compiler and version are you using?

$ gcc --version
gcc (OpenIndiana 14.2.0-oi-1) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$

What build system are you using?

cmake version 3.31.5

Additional context

No response

@mtelka
Copy link
Author

mtelka commented Feb 9, 2025

This fixes the problem:

--- absl/time/clock_test.cc.orig
+++ absl/time/clock_test.cc
@@ -18,7 +18,7 @@
 #if defined(ABSL_HAVE_ALARM)
 #include <signal.h>
 #include <unistd.h>
-#ifdef _AIX
+#if defined(_AIX) || defined(__illumos__)
 // sig_t is not defined in AIX.
 typedef void (*sig_t)(int);
 #endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant