[MacPorts] #54602: git @2.14.1 generates corrupt SHA1 hashes on Tiger when built with gcc42, but works OK when built with gcc6

MacPorts noreply at macports.org
Tue May 8 05:38:49 UTC 2018


#54602: git @2.14.1 generates corrupt SHA1 hashes on Tiger when built with gcc42,
but works OK when built with gcc6
---------------------+----------------------
  Reporter:  kencu   |      Owner:  ci42
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  tiger
      Port:  git     |
---------------------+----------------------

Comment (by kencu):

 I had time to look at this today, in the "what else do I have to do?"
 category.

 Git introduced a new SHA1 calculating scheme with
 [https://github.com/git/git/commit/6b851e536b05e0c8c61f77b9e4c3e7cedea39ff8
 this commit] and this made it into `git 13.1`. I noticed `git 12.x` worked
 properly and `git 14.x` did not, so that fits with the timing. This only
 applies to systems that do not use Apple Common Crypto (i.e. < 10.5) so
 not noted on Leopard PPC. There were issues with this commit noted on
 [https://mail-index.netbsd.org/pkgsrc-users/2017/06/10/msg024967.html
 several systems].

 This was reworked, and then [https://github.com/cr-
 marcstevens/sha1collisiondetection/commit/a24eef58c0684078405f8c7a89f9b78271432005
 reworked again]. Looking this over, an error in the endianess of this
 seemed to be the most likely thing that has gone wrong on PowerPC Tiger.
 Sure enough, forcing the endianess by adding the following to the CFLAGS:

 {{{
 -DSHA1DC_FORCE_BIGENDIAN=1
 }}}
 fixes git on Tiger PPC when built with stock compilers. I suppose gcc6
 must define one of the tests that git is using to decide on BIGENDIAN,
 whereas gcc-4.x does not define it.

 It's not so easy to add a cppflag to the git build, as it doesn't use
 configure, and it hard codes in all the flags directly. One way to do it
 is to put this block below the current CFLAGS definintion
 {{{
 platform darwin 8 powerpc {
     set CFLAGS "${CFLAGS} -DSHA1DC_FORCE_BIGENDIAN=1"
 }
 }}}

 better, of course, would be to have the `git`-ters fix it properly, if
 they want to.

-- 
Ticket URL: <https://trac.macports.org/ticket/54602#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list