Hi,
Recently I've stumbled upon an compilation issue for ppc64le that is specific only to epel7. Program author says that the code is looking right and that there might be some issues with the platform [1]. cbang itself builds fine for i686 and x86_64 architectures on epel7.
src/cbang/tar/TarHeader.cpp:226:43: error: format '%llo' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Werror=format=] sprintf(buf, "%0*" PRIo64, length - 1, n); ^
The build that failed can be found on the following link: https://copr.fedorainfracloud.org/coprs/srakitnican/ppc64le-tests/build/5763...
Best regards, Samuel Rakitničan
[1] https://github.com/CauldronDevelopmentLLC/cbang/issues/21#issuecomment-31377...
On 07/07/2017 23:10, Samuel Rakitničan wrote:
Hi,
Recently I've stumbled upon an compilation issue for ppc64le that is specific only to epel7. Program author says that the code is looking right and that there might be some issues with the platform [1]. cbang itself builds fine for i686 and x86_64 architectures on epel7.
src/cbang/tar/TarHeader.cpp:226:43: error: format '%llo' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Werror=format=] sprintf(buf, "%0*" PRIo64, length - 1, n); ^
The build that failed can be found on the following link: https://copr.fedorainfracloud.org/coprs/srakitnican/ppc64le-tests/build/5763...
Best regards, Samuel Rakitničan
[1] https://github.com/CauldronDevelopmentLLC/cbang/issues/21#issuecomment-31377... _______________________________________________ ppc mailing list -- ppc@lists.fedoraproject.org To unsubscribe send an email to ppc-leave@lists.fedoraproject.org
Hello Samuel,
I did a small C code snippet (not c++) to mimic the error code flow of issue reported in (1) and was able to build and run it on a ppc64le guest in my own environment (in fc24, fc25 and epel7) Do you have the same with a C++ snipet ?
=== [root@vm52 test]# cat tstuint64.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h>
void writeNumber(uint64_t n, char *bug, uint32_t length) { sprintf(bug, "%0*" PRIo64, length -1, n); }
int main (int argc, char *argv[]) { uint64_t value; char buffer[12];
if (argc < 2) { fprintf(stderr, "usage: tstuint64 <value>\n"); return 1; } value = strtoul(argv[1], NULL, 0);
writeNumber(value, buffer, 12); printf("out str: %s\n", buffer);
return 0; } === # ./tstuint64 4096 out str: 00000010000 ===
On 10 July 2017 at 11:55, Normand normand@linux.vnet.ibm.com wrote:
On 07/07/2017 23:10, Samuel Rakitničan wrote:
Hi,
Recently I've stumbled upon an compilation issue for ppc64le that is specific only to epel7. Program author says that the code is looking right and that there might be some issues with the platform [1]. cbang itself builds fine for i686 and x86_64 architectures on epel7.
src/cbang/tar/TarHeader.cpp:226:43: error: format '%llo' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Werror=format=] sprintf(buf, "%0*" PRIo64, length - 1, n); ^
The build that failed can be found on the following link: https://copr.fedorainfracloud.org/coprs/srakitnican/ppc64le- tests/build/576355/
Best regards, Samuel Rakitničan
[1] https://github.com/CauldronDevelopmentLLC/cbang/issues/21# issuecomment-313770740 _______________________________________________ ppc mailing list -- ppc@lists.fedoraproject.org To unsubscribe send an email to ppc-leave@lists.fedoraproject.org
Hello Samuel,
I did a small C code snippet (not c++) to mimic the error code flow of issue reported in (1) and was able to build and run it on a ppc64le guest in my own environment (in fc24, fc25 and epel7) Do you have the same with a C++ snipet ?
=== [root@vm52 test]# cat tstuint64.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h>
void writeNumber(uint64_t n, char *bug, uint32_t length) { sprintf(bug, "%0*" PRIo64, length -1, n); }
int main (int argc, char *argv[]) { uint64_t value; char buffer[12];
if (argc < 2) { fprintf(stderr, "usage: tstuint64 <value>\n"); return 1; } value = strtoul(argv[1], NULL, 0); writeNumber(value, buffer, 12); printf("out str: %s\n", buffer); return 0;
}
# ./tstuint64 4096 out str: 00000010000 ===
Hi Michel,
I don't have any problems with your snipped either. I've reached out to Joseph (cbang author), until then I don't have anything to offer, sorry.
Thank you for taking a look into this.
Regards,
Samuel Rakitničan
-- Michel Normand
On 11 July 2017 at 08:53, Samuel Rakitničan samuel.rakitnican@gmail.com wrote:
On 10 July 2017 at 11:55, Normand normand@linux.vnet.ibm.com wrote:
On 07/07/2017 23:10, Samuel Rakitničan wrote:
Hi,
Recently I've stumbled upon an compilation issue for ppc64le that is specific only to epel7. Program author says that the code is looking right and that there might be some issues with the platform [1]. cbang itself builds fine for i686 and x86_64 architectures on epel7.
src/cbang/tar/TarHeader.cpp:226:43: error: format '%llo' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Werror=format=] sprintf(buf, "%0*" PRIo64, length - 1, n); ^
The build that failed can be found on the following link: https://copr.fedorainfracloud.org/coprs/srakitnican/ppc64le- tests/build/576355/
Best regards, Samuel Rakitničan
[1] https://github.com/CauldronDevelopmentLLC/cbang/issues/21#is suecomment-313770740 _______________________________________________ ppc mailing list -- ppc@lists.fedoraproject.org To unsubscribe send an email to ppc-leave@lists.fedoraproject.org
Hello Samuel,
I did a small C code snippet (not c++) to mimic the error code flow of issue reported in (1) and was able to build and run it on a ppc64le guest in my own environment (in fc24, fc25 and epel7) Do you have the same with a C++ snipet ?
=== [root@vm52 test]# cat tstuint64.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h>
void writeNumber(uint64_t n, char *bug, uint32_t length) { sprintf(bug, "%0*" PRIo64, length -1, n); }
int main (int argc, char *argv[]) { uint64_t value; char buffer[12];
if (argc < 2) { fprintf(stderr, "usage: tstuint64 <value>\n"); return 1; } value = strtoul(argv[1], NULL, 0); writeNumber(value, buffer, 12); printf("out str: %s\n", buffer); return 0;
}
# ./tstuint64 4096 out str: 00000010000 ===
Hi Michel,
I don't have any problems with your snipped either. I've reached out to Joseph (cbang author), until then I don't have anything to offer, sorry.
Thank you for taking a look into this.
We managed to find what was wrong, basically we needed to add explicit architecture macro definitions for epel7 while for fedora it somehow worked as is. cbang patch:
src/cbang/tar/TarHeader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cbang/tar/TarHeader.cpp b/src/cbang/tar/TarHeader.cpp index 470b37c..50df710 100644 --- a/src/cbang/tar/TarHeader.cpp +++ b/src/cbang/tar/TarHeader.cpp @@ -45,7 +45,8 @@ #endif
#ifndef PRIo64 -#if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) +#if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) || \ + defined(__aarch64__) || defined(__ppc64__) || defined(__PPC64__) #define PRIo64 "lo" #else #define PRIo64 "llo"
Any thoughts?
=== epel7 GCC 4.8 f24, f25 GCC 6 f26 GCC 7