Skip to content

ptrauth module include issue for Swift 6.1 release #5211

Closed
@Kyle-Ye

Description

@Kyle-Ye

On Swift 6.1 release, the LLVM dependency has included the following commit.

swiftlang/llvm-project@0481f04

And it added ptrauth.h header to clang's modulemap file.

module ptrauth {
  header "ptrauth.h"
  export *
}
Image

And on swift-corelibs-foundation repo, we have the following statements between a CF_EXTERN_C_BEGIN and CF_EXTERN_C_END block.

#if __has_include(<ptrauth.h>)
#include <ptrauth.h>
#endif

It will end up causing include issue for the CoreFoundation on Linux platform.

/usr/lib/swift/CoreFoundation/CFBase.h:683:1: error: import of C++ module 'ptrauth' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]

The fix is move such include statements out of CF_EXTERN_C_BEGIN and CF_EXTERN_C_END block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions