#6 Cygwin 64-bit support


Can you add support for building p7zip for Cygwin 64-bit?


  • my p7zip

    my p7zip - 2013-06-15

    Cygwin 64-bit is not officially released...

    I tried the current version with p7zip_9.20.1_src_all.tar.bz2.

    $ tar xfj p7zip_9.20.1_src_all.tar.bz2
    $ cd p7zip_9.20.1
    $ cp makefile.cygwin makefile.machine
    $ make all_test
    $ file bin/7za
    bin/7za: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows

    So p7zip_9.20.1_src_all.tar.bz2 is already ready for 64 bits.

    Remark : don't use makefile.cygwin_asm instead of makefile.cygwin.

    I will try later to provide support for makefile.cygwin_amd64_asm

  • Tony Kelman

    Tony Kelman - 2014-03-01

    Hi, did you ever get around to 64-bit Cygwin with asm? It would be nice to make p7zip available as a 64-bit Cygwin package, cross it off this list http://cygwin.com/cygwin-64bit-missing

    I don't understand what the asm file is being used for, but I was able to get things to at least compile by using makefile.cygwin instead of makefile.cygwin_asm. There was a question on the Cygwin mailing list asking for more information about this http://cygwin.com/ml/cygwin/2014-03/msg00010.html

    I tried making a makefile.cygwin_amd64_asm by making the obvious changes to makefile.cygwin_asm: ASM=nasm -f win64, CPU=x64, and OBJ_CRC32=$(OBJ_CRC32_x86_64). This gives me some errors when it gets to running the assembler.

    nasm -f win64 ../../../../Asm/x64/7zCrcT8U.asm -o 7zCrcT8U.o
    ../../../../Asm/x64/7zCrcT8U.asm:21: error: COFF format does not support any special symbol types
    ../../../../Asm/x64/7zCrcT8U.asm:22: error: COFF format does not support any special symbol types
    ../../../../Asm/x64/7zCrcT8U.asm:103: warning: label alone on a line without a colon might be in error
    ../../../../makefile.glb:39: recipe for target '7zCrcT8U.o' failed
    make[1]: *** [7zCrcT8U.o] Error 1
    make[1]: Leaving directory '/home/Tony/p7zip/p7zip-9.20.1-1/build/CPP/7zip/Bundles/Alone'
    makefile:28: recipe for target '7za' failed
    make: *** [7za] Error 2

    I can fix the errors by removing :function from CrcUpdateT8 and _CrcUpdateT8, and I can fix the warning by adding a semicolon before the end, but I don't know assembly so I'm not sure if these are the right things to do. Please let me know.

    Thanks for the very useful tool!

  • Tony Kelman

    Tony Kelman - 2014-03-02

    It appears the x64 assembly version of that file has some problems. For example, if I run

    wget http://msysgit.googlecode.com/files/PortableGit-1.8.3-preview20130601.7z
    /usr/lib/p7zip/7z.exe x PortableGit-1.8.3-preview20130601.7z

    I get a segmentation fault. I don't get a very useful backtrace since I don't know if there's an easy way to compile a debug version of p7zip, but the few useful parts indicate it is occuring in the assembly function _CrcUpdateT8. This may be because of the patches I mention above that I needed to get the assembly file to compile under 64 bit Cygwin?

    Reading symbols from /usr/lib/p7zip/7z.exe...(no debugging symbols found)...done.
    (gdb) run
    Starting program: /usr/lib/p7zip/7z.exe x PortableGit-1.8.3-preview20130601.7z
    [New Thread 11196.0x3728]
    [New Thread 11196.0x2c04]
    7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
    Can't load '/usr/lib/p7zip/Codecs/.keep-p7zip' (Permission denied)
    Processing archive: PortableGit-1.8.3-preview20130601.7z
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000577871be6 in _CrcUpdateT8 () from D:/cygwin64/lib/p7zip/7z.so
    (gdb) bt
    #0  0x0000000577871be6 in _CrcUpdateT8 () from D:/cygwin64/lib/p7zip/7z.so
    #3  0x0000000577871bad in CrcCalc () from D:/cygwin64/lib/p7zip/7z.so
    #9  0x00000005777e877e in NArchive::N7z::CInArchive::FindAndReadSignature(IInStream*, unsigned long long const*) () from D:/cygwin64/lib/p7zip/7z.so
    #29 0x00000005777e88d5 in NArchive::N7z::CInArchive::Open(IInStream*, unsigned long long const*) ()   from D:/cygwin64/lib/p7zip/7z.so

    The C version works fine though, so I think I'll stick with that.

    Last edit: Tony Kelman 2014-03-02

Log in to post a comment.