lzma-utils fails on IRIX with: make[4]: Entering directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src/sdk/Common' source='Alloc.cpp' object='Alloc.o' libtool=no \ DEPDIR=.deps depmode=sgi /bin/sh ../../../depcomp \ CC -DHAVE_CONFIG_H -I. -I../../.. -DCOMPRESS_MF_BT -DCOMPRESS_MF_BT4 -DCOMPRESS_MF_HC -I.. -J2 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -woff 1174,1183,1185,1552,3968,3970 -c -o Alloc.o Alloc.cpp source='C_FileIO.cpp' object='C_FileIO.o' libtool=no \ DEPDIR=.deps depmode=sgi /bin/sh ../../../depcomp \ CC -DHAVE_CONFIG_H -I. -I../../.. -DCOMPRESS_MF_BT -DCOMPRESS_MF_BT4 -DCOMPRESS_MF_HC -I.. -J2 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -woff 1174,1183,1185,1552,3968,3970 -c -o C_FileIO.o C_FileIO.cpp cc-1035 CC: ERROR File = /usr/include/stdint.h, Line = 5 #error directive: This header file is to be used only for c99 mode compilations #error This header file is to be used only for c99 mode compilations ^ cc-1020 CC: ERROR File = Types.h, Line = 27 The identifier "int_fast16_t" is undefined. typedef int_fast16_t Int16; ^ cc-1020 CC: ERROR File = Types.h, Line = 28 The identifier "uint_fast16_t" is undefined. typedef uint_fast16_t UInt16; ^ 3 errors detected in the compilation of "C_FileIO.cpp". make[4]: *** [C_FileIO.o] Error 2 make[4]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src/sdk/Common' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src/sdk' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4' make: *** [all] Error 2 * ERROR: app-arch/lzma-utils-4.32.4 failed: * emake failed * * Call stack: * ebuild.sh: 46: <call src_compile> * environment:2837: emake || die "emake failed"; Unfortunately, int_fast16_t and uint_fast16_t are only defined in stdint.h - which is a c-only header. These typedefs should probably be int16_t and uint16_t from <inttypes.h> instead...
configure.ac includes: # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_HEADER_TIME AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_CHECK_TYPE(int_fast8_t,, [AC_DEFINE(int_fast8_t, int8_t, [Define to `int8_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(uint_fast8_t,, [AC_DEFINE(uint_fast8_t, uint8_t, [Define to `uint8_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(int_fast16_t,, [AC_DEFINE(int_fast16_t, int16_t, [Define to `int16_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(uint_fast16_t,, [AC_DEFINE(uint_fast16_t, uint16_t, [Define to `uint16_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(int_fast32_t,, [AC_DEFINE(int_fast32_t, int32_t, [Define to `int32_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(uint_fast32_t,, [AC_DEFINE(uint_fast32_t, uint32_t, [Define to `uint32_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(int_fast64_t,, [AC_DEFINE(int_fast64_t, int64_t, [Define to `int64_t' if <inttypes.h> or <stdint.h> does not define it.])]) AC_CHECK_TYPE(uint_fast64_t,, [AC_DEFINE(uint_fast64_t, uint64_t, [Define to `uint64_t' if <inttypes.h> or <stdint.h> does not define it.])]) ... so it looks as if there is logic which should prevent this from happening - it just isn't working :( ... and this is why (from config.log): configure:21190: checking for int_fast16_t configure:21220: cc -c -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -I/opt/portage/usr/include conftest.c >&5 cc-1209 cc: WARNING File = conftest.c, Line = 72 The controlling expression is constant. if ((ac__type_new_ *) 0) ^ configure:21226: $? = 0 configure:21241: result: yes configure:21253: checking for uint_fast16_t configure:21283: cc -c -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -I/opt/portage/usr/include conftest.c >&5 cc-1209 cc: WARNING File = conftest.c, Line = 72 The controlling expression is constant. if ((ac__type_new_ *) 0) ^ configure:21289: $? = 0 configure:21304: result: yes ... and so the obvious problem is that defines that will be used in C++ code which will be compiled with CC is being tested against C headers compiled with cc. If I build the package with 'CC="CC" emerge -v lzma-utils", then configure correctly detects the absence of stdint.h includes, but then fails with: Making all in liblzmadec make[3]: Entering directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src/liblzmadec' source='main.c' object='main.lo' libtool=yes \ DEPDIR=.deps depmode=sgi /bin/sh ../../depcomp \ /bin/sh ../../libtool --tag=CC --mode=compile CC -DHAVE_CONFIG_H -I. -I../.. -I/opt/portage/usr/include -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -c -o main.lo main.c mkdir .libs CC -DHAVE_CONFIG_H -I. -I../.. -I/opt/portage/usr/include -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -c main.c -Wp,-MDupdate,.deps/main.TPlo -DPIC -o .libs/main.o cc-1164 CC: ERROR File = main.c, Line = 170 Argument of type "uint8_t *" is incompatible with parameter of type "int8_t *". &info->is_streamed, buffer + 5); ^ 1 error detected in the compilation of "main.c". make[3]: *** [main.lo] Error 1 make[3]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src/liblzmadec' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-arch/lzma-utils-4.32.4/work/lzma-4.32.4' make: *** [all] Error 2 * ERROR: app-arch/lzma-utils-4.32.4 failed: * emake failed * * Call stack: * ebuild.sh: 46: <call src_compile> * environment:2838: emake || die "emake failed";
you should take 4.32.5, unpack and compile it by hand, and if it fails, file a report at the lzma-utils homepage
Reported at http://sourceforge.net/forum/message.php?msg_id=4772455
As per the above link, a fix has been found: src/sdk/Common/Types.h and src/sdk/7zip/Compress/RangeCoder/RangeCoderBitTree.h require patching for IRIX. (Types.h requires '#include <stdint.h>' removing and 'uint_fast16_t' and 'uint_fast32_t' changing to 'uint16_t' and 'uint32_t' respectively, and RangeCoderBitTree.h requires the final three functions to be declared as 'inline')
the author suggests a sort of simple patch in http://sourceforge.net/forum/forum.php?thread_id=1936858&forum_id=708858 does that work? and what is the patch eventually?
Created attachment 148122 [details, diff] Patch to allow lzma-utils to build cleanly on IRIX With this patch applied, the entire build completes successfully without even a warning! (Without the patch to io.c, I got a warning about an incompatible redefinition of SIZE_MAX... which is another symbol defined in stdint.h, and so unavailable to C++ applications)
added, thanks!
Added URL. More info from #tukaani: 16:14 < Larhzu> darksiide: There are some problems on IRIX too. I hope they get fixed too even thuogh there reporter wasn't so cooperative and disappeared. 16:16 < Larhzu> darksiide: This, there's a Gentoo bug too. http://sourceforge.net/forum/forum.php?thread_id=1936858&forum_id=708858 16:16 < Larhzu> 4.32.6 won't use fast types in Types.h for unrelated reason, I suppose that will fix the problem. 16:18 < Larhzu> If it doesn't fix the issue on IRIX, I'd like to hear. The change is not in git repo yet.
Hmmm, 4.32.6 is in the tree, does it compile on IRIX? Pipping, you have access to an IRIX machine too, does it compile for you?
Yes, 4.32.6 compiles for me with plain `./configure && make` on a mips-sgi-irix6.5. Even with ================== All 2 tests passed ==================
Then this bug should be fixed by now. Thanks pipping.
Afraid not - was Elias using GCC or MIPSpro? I've just tried again with the latest in-tree version (lzma-utils-4.32.6), and I still get the same cc-1035 error. The first part of the IRIX patch is still required for 4.32.6: --- src/sdk/Common/Types.h.dist 2008-07-10 14:20:19.462304800 +0100 +++ src/sdk/Common/Types.h 2008-07-10 14:21:29.639083200 +0100 @@ -9,8 +9,10 @@ #include <inttypes.h> -#ifdef HAVE_STDINT_H -# include <stdint.h> +#ifndef __sgi +# ifdef HAVE_STDINT_H +# include <stdint.h> +# endif #endif typedef uint8_t Byte;
Created attachment 160052 [details, diff] Patch to prevent <stdint.h> being incorrectly included on IRIX With MIPSpro, stdint.h is a C99-only header which #errors out if used in C++ code.
that's easy to apply, I assume that patch completely fixes it?
ha, I see. What you patch out, is being introduced by the Interix patch, so plain lzma-utils indeed /does/ compile. I'll fix up the Interix patch instead.
Ok, hopefully fixed now.