cr-marcstevens / sha1collisiondetection

Library and command line tool to detect SHA-1 collision in a file
Other
1.3k stars 179 forks source link

Detect endianess on HP-UX #50

Closed michael-o closed 5 years ago

michael-o commented 5 years ago

HP-UX is not properly detected and classified as little endian. Add test macro for HP-UX to make it big endian.

Based on the discussion on the Git mailing list, here is the upstream patch for HP-UX detection.

cr-marcstevens commented 5 years ago

Thanks for the proposed changes.

Just to be sure: the proposed change is to whitelist HP UX OS as Big Endian, is this guaranteed to hold? Or are there also HP UX on Little Endian machines?

michael-o commented 5 years ago

There is no HP-UX on x86_64 yet, HPE is probably in preparation for, but there aren't any products available as told by our HPE salesman. HP-UX on PA-RISC and Itanium is big endian.

There is this:

#include <sys/portal.h>
#include <stdio.h>

int main(void) {
    int i;
    TEST_ENDIAN(i)
    printf("%d\n", i);
    return 0;
}

but is is a runtime check.

I would rely on the macro for now (upcoming years).

cr-marcstevens commented 3 years ago

@MONIMAKER365 as far as we understand, HP-UX should be detected properly and big-endian configuration activated. If you have problems with the detection macros and HP-UX then please provide more information.

michael-o commented 3 years ago

@MONIMAKER365 I am confused because Git has now been flawlessly working for me on HP-UX for quite some time.