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

[SR-8018] llbuild fails to build with SwiftPM because of the DEBUG define #785

Open
hartbit opened this issue Jun 16, 2018 · 0 comments
Open

Comments

@hartbit
Copy link
Contributor

hartbit commented Jun 16, 2018

Previous ID SR-8018
Radar None
Original Reporter @hartbit
Type Bug
Additional Detail from JIRA
Votes 2
Component/s llbuild
Labels Bug
Assignee None
Priority Medium

md5: db359f7c39800a3e55bf94a0e124261c

Issue Description:

When building llbuild with SwiftPM, we currently get the following error:

In file included from /Users/david/Projects/swift/llbuild/lib/llvm/Support/Path.cpp:14:
/Users/david/Projects/swift/llbuild/lib/llvm/Support/include/llvm/Support/COFF.h:541:5: error: expected identifier
    DEBUG,
    ^
<command line>:2:15: note: expanded from here
#define DEBUG 1
              ^
1 error generated.

This seems to be because clang is invoked with a -DDEBUG=1 define that clashes with llvmSupport's DataDirectoryIndex enum:

enum DataDirectoryIndex {
  EXPORT_TABLE = 0,
  IMPORT_TABLE,
  RESOURCE_TABLE,
  EXCEPTION_TABLE,
  CERTIFICATE_TABLE,
  BASE_RELOCATION_TABLE,
  DEBUG, // HERE
  ARCHITECTURE,
  GLOBAL_PTR,
  TLS_TABLE,
  LOAD_CONFIG_TABLE,
  BOUND_IMPORT,
  IAT,
  DELAY_IMPORT_DESCRIPTOR,
  CLR_RUNTIME_HEADER,

  NUM_DATA_DIRECTORIES
};

The only solution I've found for now is to tell SwiftPM to undefine DEBUG:

swift build -Xcxx -UDEBUG
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from swiftlang/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant