diff --git a/lld/wasm/Config.h b/lld/wasm/Config.h --- a/lld/wasm/Config.h +++ b/lld/wasm/Config.h @@ -20,6 +20,9 @@ // For --unresolved-symbols. enum class UnresolvedPolicy { ReportError, Warn, Ignore }; +// For --build-id. +enum class BuildIdKind { None, Fast, Md5, Sha1, Hexstring, Uuid }; + // This struct contains the global configuration for the linker. // Most fields are direct mapping from the command line options // and such fields have the same name as the corresponding options. @@ -63,6 +66,7 @@ bool ltoNewPassManager; bool ltoDebugPassManager; UnresolvedPolicy unresolvedSymbols; + BuildIdKind buildId = BuildIdKind::None; llvm::StringRef entry; llvm::StringRef mapFile; @@ -75,6 +79,7 @@ std::vector searchPaths; llvm::CachePruningPolicy thinLTOCachePolicy; llvm::Optional> features; + std::vector buildIdVector; // The following config options do not directly correspond to any // particualr command line options. diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -352,6 +352,35 @@ return errorOrWarn; } +// Parse --build-id or --build-id=