Bug 29489 - dlltool is not deterministic
Summary: dlltool is not deterministic
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-15 02:11 UTC by Mike Hommey
Modified: 2022-08-23 08:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Proposed Patch (2.41 KB, patch)
2022-08-17 09:02 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hommey 2022-08-15 02:11:12 UTC
Both ar and objcopy default to build deterministic archives, but dlltool doesn't.
Comment 1 Nick Clifton 2022-08-16 14:17:02 UTC
Hi Mike,

  Please could you elaborate on this ?  

  What specifically do you think should be happening ?

Cheers
  Nick
Comment 2 Mike Hommey 2022-08-16 20:35:38 UTC
The bfd objects used for dlltool should have the BFD_DETERMINISTIC_OUTPUT flag set.
Comment 3 Nick Clifton 2022-08-17 09:02:52 UTC
Created attachment 14284 [details]
Proposed Patch

Hi Mike,

  Thanks - that makes things clearer.

  Please could you try out the uploaded patch to see if it does what you expect.

  (Note - I do not have a cygwin/mingw test environment, so I have not been 
  able to test the patch thoroughly).

Cheers
  Nick
Comment 4 Mike Hommey 2022-08-23 01:29:46 UTC
The patch seems to work as expected.
Comment 5 cvs-commit@gcc.gnu.org 2022-08-23 08:55:35 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=25ee24d990d6beb3fb01c673fcf13e0ea1522c5b

commit 25ee24d990d6beb3fb01c673fcf13e0ea1522c5b
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Aug 23 09:54:52 2022 +0100

    Add an option to dlltool to allow the creation of deterministic libraries.
    
            PR 29489
            * dlltool.c (deterministic): New variable.
            (gen_lib_file): If deterministic is true set the
            BFD_DETERMINISTIC_OUTPUT flag.
            (usage): Mention --deterministic-libraries and
            --non-deterministic-libraries.
            (long_options): Add new options.
            (main): Parse new options.
            * doc/binutils.texi: Document the new options.
            * NEWS: Mention the new feature.
Comment 6 Nick Clifton 2022-08-23 08:58:16 UTC
Patch applied