[libc-commits] [PATCH] D134567: [libc] Re-enable functions from signal.h and re-enable abort.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Sep 30 00:31:22 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/include/llvm-libc-macros/signal-macros.h:12
 
-#include <__llvm-libc-common.h>
+#ifdef __unix__
+#include "linux/signal-macros.h"
----------------
abrachet wrote:
> Should this be `__linux__`?
I don't remember why we started doing `#ifdef __unix__` - I have changed to `__linux__` now. I will cleanup other instances in a different change.


================
Comment at: libc/include/llvm-libc-types/siginfo_t.h:27
+  union sigval si_value;
+} siginfo_t;
+
----------------
abrachet wrote:
> FWIW, this looks like it's architecture dependent. Admittedly I don't remember the story about why we moved away from using Linux headers. It might be nice to leave around something like
> ```
> #if ! (defined(LLVM_LIBC_ARCH_X86_64) || defined(LLVM_LIBC_ARCH_AARCH64))
> #error "this siginfo may not be valid for your architecture"
> #endif
> ```
> Though I have no strong preference because it looks like only mips and ia64 have other implementations of this type
About Linux headers, tl;dr - they lead to name pollution in user programs.

About making this struct target specific or excluding it, I think we can do it when we have an example to deal with.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134567/new/

https://reviews.llvm.org/D134567



More information about the libc-commits mailing list