Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 41866
Status: open
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: bhaskar_s [...] thbs.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Warning message for file sha1.c when doing a 'make'
Date: Mon, 22 Dec 2008 14:49:52 +0530
To: <bug-par [...] rt.cpan.org>
From: "Bhaskar.S" <bhaskar_s [...] thbs.com>
Download makeOutput.txt
text/plain 4.4k

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 819b
Hello, I downloaded the package - PAR-Packer-0.982 from CPAN. I tried to install the module, so I ran perl Makefile.PL, then i gave a 'make'. I keep getting these warning messages: "sha1.c", line 158: warning: shift count negative or too big: >> 32 "/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE/config.h", line 1144: warning: macro redefined: BYTEORDER Please find attached a text file containing the entire output I got when I ran the command - 'make' Here are my system details: Perl version: v5.6.1 OS - SunOS 5.9 Please guide me through this, and let me know if this warning message could be overlooked Regards, Bhaskar.S Show quoted text
________________________________________________ Bhaskar.S Associate Software Engineer Torry Harris Business Solutions (www.thbs.com) Tel: +91-(0)80-41827200 Mobile: +91-98860 2 58 57
Download (untitled) / with headers
text/plain 297b
Hi, sorry for the long delay in replying. Unfortunately, the SHA1 code in sha1.c is beyond my knowledge of C to fix. Do you get the same error messages when compiling Digest::SHA1? If so, maybe take it up to its author (Gisle Aas) since that's where we took the code from. Best regards, Steffen
Download (untitled) / with headers
text/plain 1.4k
If I read the code in myldr/sha1.c correctly the line should be W[i] = T32(T >> 32); which is inside a #if BYTEORDER == 0x87654321 This warning implies that ULONG is a 32-bit quantity whereas the code assumes is 64-bit. "/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE/config.h" in the other warning implies is that this is a 64-bit Perl and the one shipped with Solaris. Is it a 64-bit Solaris then? What compiler was used, the Sun compiler or gcc? Sorry, I don't have access to a 64-bit Solaris, but the following lines at the start of sha1.c look highly suspicious: #if defined(U64TYPE) && (defined(USE_64_BIT_INT) || ((BYTEORDER != 0x1234) && (BYTEORDER != 0x4321))) typedef U64TYPE ULONG; # if BYTEORDER == 0x1234 # undef BYTEORDER # define BYTEORDER 0x12345678 # elif BYTEORDER == 0x4321 # undef BYTEORDER # define BYTEORDER 0x87654321 # endif #else # if (!defined(__GNUC__) || !defined(_WINNT_H)) typedef unsigned long ULONG; /* 32-or-more-bit quantity */ # endif #endif Looks like the author is trying to work around some flaw in Perl's configuration - he overrides BYTEORDER obtained from $Config{byteorder}. Note that macros USE_64_BIT_INT and U64TYPE are #define'd in the above config.h, but it isn't #include'd anywhere. So assuming a non-gcc compiler (since gcc will #define __GNUC__) this would imply typedef unsigned long ULONG; /* 32-or-more-bit quantity */ takes hold which might explain the mismatch (probably should be "unsigned long long").
Subject: Re: [rt.cpan.org #41866] Warning message for file sha1.c when doing a 'make'
Date: Fri, 6 Feb 2009 10:10:45 +0530
To: <bug-PAR [...] rt.cpan.org>
From: "Bhaskar.S" <bhaskar_s [...] thbs.com>
Download (untitled) / with headers
text/plain 3.1k
Thank you so much for the response :-) ..As it has been suspected, the module is compiled with sun cc compiler, in 64 bit Solaris environment. I can be happy with 32 bit compilation with gcc compiler also. Here I tried recompiling PAR-Packer by re-generating the makefile with the command: perl Makefile.PL CC=gcc Here in the Makefile, the CC flag is chosen as 'gcc' as I expected. But still when I do a 'make', All the 'C' libraries are again getting compiled with 'cc' compiler so I still get that warning from sha1.c file. From the above discussion, if I some how use 'gcc' and re-compile the package, this warning will be gone? If so, can you please guide as to how to make the module use 'gcc' instead of 'cc'. Further more, how far this 'sha1.c' file involve in the basic functionality of PAR-Packer?? Is this warning something really important that I'm not supposed to get? Because, I use pp in the scripts directory to generate the *.par file and I use par.pl file to generate the executable binary. Every thing is working fine for me. I believe that, since the whole idea of this module deals with binaries and stuff, and this warning I got is, I guess relates to bit copy (>> operator has to do some thing with bit/byte shift am I right?) Should I take it more seriously? Many Thanks, Bhaskar.S Show quoted text
----- Original Message ----- From: "RSCHUPP via RT" <bug-PAR@rt.cpan.org> To: <bhaskar_s@thbs.com> Sent: Tuesday, February 03, 2009 6:13 PM Subject: [rt.cpan.org #41866] Warning message for file sha1.c when doing a 'make'
> <URL: https://rt.cpan.org/Ticket/Display.html?id=41866 > > > If I read the code in myldr/sha1.c correctly the line should be > > W[i] = T32(T >> 32); > > which is inside a #if BYTEORDER == 0x87654321 > > This warning implies that ULONG is a 32-bit quantity whereas > the code assumes is 64-bit. > "/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE/config.h" in the > other warning implies is that this is a 64-bit Perl and > the one shipped with Solaris. Is it a 64-bit Solaris then? > What compiler was used, the Sun compiler or gcc? > > Sorry, I don't have access to a 64-bit Solaris, but the > following lines at the start of sha1.c look highly suspicious: > > #if defined(U64TYPE) && (defined(USE_64_BIT_INT) || ((BYTEORDER != > 0x1234) && (BYTEORDER != 0x4321))) > typedef U64TYPE ULONG; > # if BYTEORDER == 0x1234 > # undef BYTEORDER > # define BYTEORDER 0x12345678 > # elif BYTEORDER == 0x4321 > # undef BYTEORDER > # define BYTEORDER 0x87654321 > # endif > #else > # if (!defined(__GNUC__) || !defined(_WINNT_H)) > typedef unsigned long ULONG; /* 32-or-more-bit quantity */ > # endif > #endif > > Looks like the author is trying to work around some flaw > in Perl's configuration - he overrides BYTEORDER obtained from > $Config{byteorder}. Note that macros USE_64_BIT_INT and > U64TYPE are #define'd in the above config.h, but it isn't > #include'd anywhere. So assuming a non-gcc compiler > (since gcc will #define __GNUC__) this would imply > > typedef unsigned long ULONG; /* 32-or-more-bit quantity */ > > takes hold which might explain the mismatch (probably should > be "unsigned long long"). >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.