Skip to content
Mark Johnson edited this page Mar 8, 2018 · 36 revisions

<-- 'List of Themes'

<-- 'List of Projects'


liblzma from xz-5.1.3 alpha - for Rasterlite2

The original source code archive can be found in the archive directory



2014-05-14: final version that compiled and linked properly

./configure --host=arm-linux-androideabi --target=arm-linux-androideabi 
  --enable-static --with-pic --disable-xz --disable-xzdec --disable-lzmainfo 
  --disable-scripts --disable-lzmadec --disable-shared
lzma_flags := \
 -DHAVE_CONFIG_H \
 -g -O2 \
 -std=gnu99

What follows will be left for future reference, but otherwise ignore it


  • Note: all the errors below were resolve when using the following in lzma-xz-5.1.3a.mk
lzma_flags := \
-DHAVE_CONFIG_H \
-E \
-std=gnu99
  • as was done in the Makefile created with
    • ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
      • with make it had compiled properly

link errors

  • /obj/local/armeabi/liblzma.a: no archive symbol table (run ranlib)

Will be left for future reference, but otherwise ignore it

/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "="  VALUE(var)
// print out values
#pragma message(VAR_NAME_VALUE(UINT_MAX))
#pragma message(VAR_NAME_VALUE(UINT_MAX))
/*
note: #pragma message: UINT32_C=UINT32_C
// this is being defined in limits.h: with
// #define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
note: #pragma message: UINT_MAX=0xffffffffU
#define UINT_MAX UINT32_C(4294967295)
note: #pragma message: UINT_MAX=4294967295U
*/

compile errors

  • lzma <= check.c
    • xz-5.1.3alpha/src/common/mythread.h
 :85:1:error: unknown type name 'sigset_t'
  • sigset_t is however defined in android

    • arch-arm/usr/include/asm/signal.h:typedef unsigned long sigset_t;
  • cause

    • -DMYTHREAD_ENABLED=1 in lzma-xz-5.1.3a.mk was not being set

--

  • xz-5.1.3alpha/src/common/sysdefs.h
:58:4: error: #error UINT32_C is not defined and unsigned int is not 32-bit.
:122:4: error: #error size_t is not 32-bit or 64-bit
:126:3: error: #error size_t is not 32-bit or 64-bit
  • cause
    • -DHAVE_STDINT_H=1 in lzma-xz-5.1.3a.mk was not being set
    • -DHAVE_LIMITS_H=1 in lzma-xz-5.1.3a.mk was not being set
      • this does not resolve the check.c:13 problem
      • stdint.h is being read, so uint8_t is known
      • limits.h is being read, so SIZE_MAX is known
        • #line 46 "stdint.h being read\n"
    • value of UINT_MAX=0xffffffffU
      • #define UINT_MAX UINT32_C(4294967295)
        • removed errors 58:4,122:4 and 126:3

--

  • xz-5.1.3alpha/src/liblzma/check/check.c:13
src/liblzma/common/common.h:112:27: error: expected ';', ',' or ')' before 'in'
// 'in' is a 'const uint8_t *restrict', which may be caused by the above '58.4' error
src/liblzma/common/common.h:155:2: error: unknown type name 'lzma_code_function'
// 155 is caused by 112
src/liblzma/common/common.h:267:51: error: expected ';', ',' or ')' before 'in'
// 'in' is a 'const uint8_t *restrict', which may be caused by the above '58.4' error
  • uint8_c is defined in src/liblzma/api/lzma.h

    • typedef unsigned __int8 uint8_t
      • but only when
        • UINT32_C is not defined and
          • is _WIN32 or _MSC_VER
            • which is not the case
  • same problem as in [--> 'libcurl-7.36.0.mk'] (libcurl-7.36.0.mk#error_cause)


  • code changes
    • xz-5.1.3alpha/src/common/sysdefs.h:
      • #define UINT_MAX UINT32_C(4294967295)

2014-05-06: Mark Johnson, Berlin Germany


Clone this wiki locally