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

file-posix.c build error #59

Open
ocramz opened this issue Apr 5, 2020 · 1 comment
Open

file-posix.c build error #59

ocramz opened this issue Apr 5, 2020 · 1 comment

Comments

@ocramz
Copy link

ocramz commented Apr 5, 2020

Building a project that includes unliftio (Stackage LTS 14.27 i.e. GHC 8.6.5) fails with this:

unliftio      > [20 of 20] Compiling UnliftIO
unliftio      > 
unliftio      > /private/var/folders/n0/zx3dkw3d2hd3x59rjk3gtj5r0000gn/T/stack24793/unliftio-0.2.12/cbits/file-posix.c:16:10: error:
unliftio      >      error: use of undeclared identifier 'AT_FDCWD'
unliftio      >       return AT_FDCWD;
unliftio      >              ^
unliftio      >    |
unliftio      > 16 |   return AT_FDCWD;
unliftio      >    |          ^
unliftio      > 
unliftio      > /private/var/folders/n0/zx3dkw3d2hd3x59rjk3gtj5r0000gn/T/stack24793/unliftio-0.2.12/cbits/file-posix.c:21:10: error:
unliftio      >      error: use of undeclared identifier 'AT_SYMLINK_FOLLOW'
unliftio      >       return AT_SYMLINK_FOLLOW;
unliftio      >              ^
unliftio      >    |
unliftio      > 21 |   return AT_SYMLINK_FOLLOW;
unliftio      >    |          ^
unliftio      > 2 errors generated.
unliftio      > `gcc' failed in phase `C Compiler'. (Exit code: 1)

If it helps,

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
@ocramz
Copy link
Author

ocramz commented Apr 5, 2020

Indeed, I've just tried building on a newer machine (with a later XCode etc. ) and the error doesn't happen:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I'd be keen to know a fix that applies to older XCode versions, because I won't be able to use the new one for a while.

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