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

llvm-ranlib does not support -D flag #41052

Closed
arichardson opened this issue May 2, 2019 · 2 comments
Closed

llvm-ranlib does not support -D flag #41052

arichardson opened this issue May 2, 2019 · 2 comments
Labels
bugzilla Issues migrated from bugzilla tools:llvm-ar/llvm-ranlib

Comments

@arichardson
Copy link
Member

Bugzilla Link 41707
Resolution FIXED
Resolved on Jan 02, 2020 04:48
Version trunk
OS All
CC @rupprecht

Extended Description

I have been trying to build FreeBSD (well CheriBSD actually) with llvm binutils instead of elftoolchain utilities.
I noticed that building static archives was failing because ranlib is invoked with the -D flag which is not supported by llvm-ranlib.

FreeBSD manpage:

 -D      When used in combination with the -r or -q option, with the -s
         option without other options, or when invoked as ranlib, insert
         0's instead of the real mtime, uid and gid values and 0644
         instead of file mode from the members named by arguments file
         ....  This ensures that checksums on the resulting archives are
         reproducible when member contents are identical.  This option is
         enabled by default.  If multiple -D and -U options are specified
         on the command line, the final one takes precedence.

GNU manpage:
-D Operate in deterministic mode. The symbol map archive member's header will show zero for the UID, GID, and timestamp. When this option is used, multiple runs will produce identical
output files.

       If binutils was configured with --enable-deterministic-archives, then this mode is on by default.  It can be disabled with the -U option, described below.
@rupprecht
Copy link
Collaborator

llvm-ar supports both D and U, but it looks like we don't have that hooked up for the ranlib entry point. We should add those.

As for local workarounds: deterministic is the default for llvm-ar/llvm-ranlib, so you can just remove it. Or you can run "llvm-ar Ds" since ranlib == ar s.

@arichardson
Copy link
Member Author

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla tools:llvm-ar/llvm-ranlib
Projects
None yet
Development

No branches or pull requests

2 participants