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

Update FindLibClang.cmake to fix a build failure #1439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LocutusOfBorg
Copy link

With this regex the example test code of clang fails in cmake, causing an error.
this is due to -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
becoming:
-I/usr/lib/llvm-18/include;-D_GNU_SOURCE;-D_FILE_OFFSET_BITS;-D_LARGEFILE_SOURCE;-D_FILE_OFFSET_BITS;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS

If you undefine _FILE_OFFSET_BITS and you enable _TIME_BITS=64 you get a FTBFS

/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
26 | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"

With this regex the example test code of clang fails in cmake, causing an error.
this is due to -I/usr/lib/llvm-18/include -std=c++17   -fno-exceptions -funwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
becoming:
-I/usr/lib/llvm-18/include;-D_GNU_SOURCE;-D_FILE_OFFSET_BITS;-D_LARGEFILE_SOURCE;-D_FILE_OFFSET_BITS;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS

If you undefine _FILE_OFFSET_BITS and you enable _TIME_BITS=64 you get a FTBFS

/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
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

Successfully merging this pull request may close these issues.

1 participant