jmacd / xdelta

open-source binary diff, delta/differential compression tools, VCDIFF/RFC 3284 delta compression
http://xdelta.org
1.1k stars 184 forks source link

Issues with compiling in MinGW on Windows #208

Open hurda opened 8 years ago

hurda commented 8 years ago

Trying to compile https://github.com/jmacd/xdelta-devel/tree/4b4aed71a959fe11852e45242bb6524be85d3709 with MinGW on Windows, I encountered these issues:

1.)

        untar-lzma ... ./run_release.sh: line 61: cd: /c/xdelta-devel-64bithash/
xdelta3/build: No such file or directory
 failed!
Error tar in /c/xdelta-devel-64bithash/xdelta3/build

Reason: the build-folder is not created. After manually creating the folder before running run_release.sh, the script passes this stage.

2.) configure-lzma is done successfully, but then the compilation stalls at build-lzma. After a while nothing happens anymore, but the make-process is still continuing to use a CPU-core. I killed the compilation after an hour at build-lzma.

$ ./run_release.sh
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: linking file `m4/libtool.m4'
libtoolize: linking file `m4/ltoptions.m4'
libtoolize: linking file `m4/ltsugar.m4'
libtoolize: linking file `m4/ltversion.m4'
libtoolize: linking file `m4/lt~obsolete.m4'
configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal).
Makefile.am:85: DEBUG_SYMBOLS does not appear in AM_CONDITIONAL
Makefile.am: installing `./INSTALL'
Makefile.am: required file `./NEWS' not found
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
Makefile.am: required file `./ChangeLog' not found
configure.ac:48: required file `config.h.in' not found
Makefile.am:41: compiling `testing/checksum_test_c.c' in subdir requires `AM_PRO
G_CC_C_O' in `configure.ac'
Makefile.am: installing `./depcomp'
/mingw/share/automake-1.11/am/depend2.am: am__fastdepCC does not appear in AM_CO
NDITIONAL
/mingw/share/automake-1.11/am/depend2.am:   The usual way to define `am__fastdep
CC' is to add `AC_PROG_CC'
/mingw/share/automake-1.11/am/depend2.am:   to `configure.ac' and run `aclocal'
and `autoconf' again.
/mingw/share/automake-1.11/am/depend2.am: AMDEP does not appear in AM_CONDITIONA
L
/mingw/share/automake-1.11/am/depend2.am:   The usual way to define `AMDEP' is t
o add one of the compiler tests
/mingw/share/automake-1.11/am/depend2.am:     AC_PROG_CC, AC_PROG_CXX, AC_PROG_C
XX, AC_PROG_OBJC,
/mingw/share/automake-1.11/am/depend2.am:     AM_PROG_AS, AM_PROG_GCJ, AM_PROG_U
PC
/mingw/share/automake-1.11/am/depend2.am:   to `configure.ac' and run `aclocal'
and `autoconf' again.
/mingw/share/automake-1.11/am/depend2.am: am__fastdepCXX does not appear in AM_C
ONDITIONAL
/mingw/share/automake-1.11/am/depend2.am:   The usual way to define `am__fastdep
CXX' is to add `AC_PROG_CXX'
/mingw/share/automake-1.11/am/depend2.am:   to `configure.ac' and run `aclocal'
and `autoconf' again.
Makefile.am:49: variable `GOLANG_SOURCES' is defined but no program or
Makefile.am:49: library has `GOLANG' as canonical name (possible typo)
configure.ac:5: required file `./config.guess' not found
configure.ac:5:   `automake --add-missing' can install `config.guess'
configure.ac:5: required file `./config.sub' not found
configure.ac:5:   `automake --add-missing' can install `config.sub'
configure.ac:6: required file `./missing' not found
configure.ac:6:   `automake --add-missing' can install `missing'
Makefile.am:49: variable `GOLANG_SOURCES' is defined but no program or
Makefile.am:49: library has `GOLANG' as canonical name (possible typo)
        untar-lzma ...  success

Host i686-w64-mingw32-mconsole afl=0

        ... liblzma
        configure-lzma ...  success
        build-lzma ...

At first the last line in build-lzma.stdout was for libzma-la-common.o, in the second attempt compilation stopped at liblzma_la-index.o, and in other tries it stopped at liblzma_la-hardware_physmem.o and liblzma_la-stream_flags_common.o.

As a test I tried to compile xz all by itself in MinGW, using windows\build.bash, which worked fine.

hurda commented 8 years ago

After removing the makeflags -j 10 in run_release.sh, compilation of lzma is now completing successfully.

I tried compiling xz in a similar way as xdelta is (i.e. not using windows/build.bash but plain make -j 10), and it's also stalling. The xz's make-files and build.bash are not using -j, as far as I understood the files. I guess that flag is not fully supported by xz, at least when compiling on Windows/MinGW.

PS: Now configure-xdelta is failing:

configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: error: cannot run /bin/sh /c/xdelta-devel-64bithash/xdelta3/config.sub
hurda commented 8 years ago

The workaround/fix(?) for the missing config.sub is rather easy:

https://github.com/jmacd/xdelta-devel/blob/4b4aed71a959fe11852e45242bb6524be85d3709/xdelta3/run_release.sh#L45 automake --add-missing has the be placed after automake, then the missing files are created.

hurda commented 8 years ago

Now compilation fails at the 64bit-stage at build-lzma:

Host i686-w64-mingw32-mconsole afl=0

        ... liblzma
        configure-lzma ...  success
        build-lzma ...  success
        install-lzma ...  success
        ... i686-w64-mingw32-mconsole-32-32
        configure-xdelta ...  success
        ... i686-w64-mingw32-mconsole-32-64
        configure-xdelta ...  success
        ... i686-w64-mingw32-mconsole-64-64
        configure-xdelta ...  success

Host x86_64-w64-mingw32-mconsole afl=0

        ... liblzma
        configure-lzma ...  success
        build-lzma ...  failed!
Error make in /c/xdelta3/xdelta3/build/lib-x86_64-w64-mingw32-mco
nsole
        ... x86_64-w64-mingw32-mconsole-32-32
        configure-xdelta ...  success
        ... x86_64-w64-mingw32-mconsole-32-64
        configure-xdelta ...  success
        ... x86_64-w64-mingw32-mconsole-64-64
        configure-xdelta ...  success

build-lzma.stderr:

In file included from c:/xdelta3/xdelta3/build/xz-5.2.1/src/liblzma/common/common.h:17:0,
                 from c:/xdelta3/xdelta3/build/xz-5.2.1/src/liblzma/common/common.c:13:
c:/xdelta3/xdelta3/build/xz-5.2.1/src/common/mythread.h:349:1: error: unknown type name 'CONDITION_VARIABLE'
 typedef CONDITION_VARIABLE mythread_cond;
 ^

No idea how to fix that.

Tried MinGW-W64 (5.3.0) too, but that's failing at build-lzma with some assembler-error.

firstrose commented 7 years ago

Well, ignore "compilation fails at the 64bit-stage at build-lzma" ,please.

Other stages are ok and you can find xdelta3.exe in build\ for 32bit-stage.

hurda commented 7 years ago

The point of the compilation was to get a 64bit-build, which wasn't available as a binary yet back then.

No idea if compilation is working now with the current code, haven't tried.

firstrose commented 7 years ago

Sorry to hear that. Why not look for help from XZ's site? Seems there is a bug in XZ, not xdelta.

hurda commented 7 years ago

Won't matter right now, as the Windows-64bit-version is broken when using blocksize >2gb: https://github.com/jmacd/xdelta/issues/127#issuecomment-171032023