[PATCH] D33575: [llvm-ar] Make llvm-lib behave more like the MSVC archiver

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 16:46:59 PDT 2017


> ===================================================================
> --- llvm/lib/Object/COFFImportFile.cpp
> +++ llvm/lib/Object/COFFImportFile.cpp
> @@ -516,10 +516,9 @@
>          OF.createShortImport(*Name, E.Ordinal, ImportType, NameType));
>    }
>  
> -  std::pair<StringRef, std::error_code> Result =
> -      writeArchive(Path, Members, /*WriteSymtab*/ true, object::Archive::K_GNU,
> -                   /*Deterministic*/ true, /*Thin*/ false);
> -
> +  std::pair<StringRef, std::error_code> Result = writeArchive(
> +      Path, Members, /*WriteSymtab=*/true, /*WriteObjPaths=*/true,
> +      object::Archive::K_GNU, /*Deterministic=*/true, /*Thin=*/false);

This changes WriteObjPaths for COFF import files. Is that intentional?

> -static bool useStringTable(bool Thin, StringRef Name) {
> -  return Thin || Name.size() >= 16;
> +static bool useStringTable(bool WriteObjPaths, StringRef Name) {
> +  // Force the use of the string table if we're writing full paths.
> +  return WriteObjPaths || Name.size() >= 16;

I think you want to keep Thin in here. That is a format difference of
thin archives:

https://sourceware.org/ml/binutils/2008-03/msg00150.html

Cheers,
Rafael


More information about the llvm-commits mailing list