swift-llbuild icon indicating copy to clipboard operation
swift-llbuild copied to clipboard

llbuild fails to build with _FORTIFY_SOURCE=2

Open finagolfin opened this issue 1 year ago • 0 comments

The Android NDK turned on this flag a couple years ago, so I had to disable it when I started cross-compiling llbuild on my Android CI, because of build errors like this:

lib/llvm/Support/Unix/Process.inc:218:21: error: no matching function for call to 'RetryAfterSignal'
      if ((NullFD = RetryAfterSignal(-1, ::open, "/dev/null", O_RDWR)) < 0)
                    ^~~~~~~~~~~~~~~~
include/llvm/Support/Errno.h:34:13: note: candidate template ignored: couldn't infer template argument 'Fun'
inline auto RetryAfterSignal(const FailT &Fail, const Fun &F,
            ^
1 error generated.

I'm not sure if these fortify checks are specific to the Android NDK or would be applied on other platforms too.

finagolfin avatar Apr 21 '23 14:04 finagolfin