2.6.0.RC1 cygwin compilation issue

mannino <[email protected]> Thu, 23 Aug 2018 17:13:27 +0300
Newsgroups gmane.comp.sysutils.backup.dar.general
Message-ID <[email protected]>
I have been trying to compile the RC on Windows 10 x64 under the latest 
cygwin (2.1). I have followed the recipe in the FAQ and got the required 
packages installed but I'm still facing multiple problems.

Configure reports:

   LIBDAR parameters:
    Zlib compression (gzip)    : YES
    Libbz2 compression (bzip2) : YES
    Liblzo2 compression (lzo)  : YES
    Liblxz compression (xz)    : YES
    Strong encryption support  : YES
    Public key cipher support  : NO
    Extended Attributes support: YES
    Large files support (> 2GB): YES
    extX FSA / nodump support  : NO
    HFS+ FSA support           : YES
    Integer size used          : 64
    Thread safe support        : YES
    Furtive read mode          : YES
    Large directory optim.     : YES
    posix fadvise support      : YES
    microsecond read accuracy  : YES
    microsecond write accuracy : YES
    can restore symlink dates  : YES
    can uses multiple threads  : NO
    Delta-compression support  : YES
    Remote repository support  : NO

   DAR SUITE command line programs:
    Long options available : YES
    Building examples      : NO
    Building dar_static    : YES
    using upx at install   : YES
    building documentation : YES

However, linking the binary fails with:

libtool: link: g++ -static -o dar_static.exe command_line.o 
config_file.o dar.o dar_suite.o hide_file.o no_comment.o line_tools.o 
crit_action_cmd_line.o  -lintl ../libdar/.libs/libdar64.a -lpthread 
-lrsync -lgcrypt -lgpg-error -llzma -llzo2 -lbz2 -lz -ldl
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -lrsync
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -lgcrypt
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -lgpg-error
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -llzma
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -llzo2
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:565: dar_static.exe] Error 1

By inspecting C:\cygwin64\lib I notice that many files have the .dll.a 
suffix rather than .a (e.g. libpthread.a exists and ld doesn't 
complain). All of the above 5 libs have the .dll.a suffix. Copying them 
to .a files made ld happy.

However, it then fails with inability to resolve iconv functions:

libtool: link: g++ -static -o dar_static.exe command_line.o 
config_file.o dar.o dar_suite.o hide_file.o no_comment.o line_tools.o 
crit_action_cmd_line.o  -lintl ../libdar/.libs/libdar64.a -lpthread 
-lrsync -lgcrypt -lgpg-error -llzma -llzo2 -lbz2 -lz -ldl
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../lib/libintl.a(dcigettext.o): 
In function `_nl_find_msg':
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1315: 
undefined reference to `libiconv'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1315:(.text+0x5ed): 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol 
`libiconv'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1183: 
undefined reference to `libiconv_open'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1183:(.text+0x96f): 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol 
`libiconv_open'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1177: 
undefined reference to `libiconv_open'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/dcigettext.c:1177:(.text+0xaf9): 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol 
`libiconv_open'
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../lib/libintl.a(relocatable.o): 
In function `libintl_set_relocation_prefix':
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/relocatable.c:171: 
undefined reference to `libiconv_set_relocation_prefix'
/usr/src/debug/gettext-0.19.8.1-2/gettext-tools/../gettext-runtime/intl/relocatable.c:171:(.text+0x46): 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol 
`libiconv_set_relocation_prefix'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:565: dar_static.exe] Error 1
make[3]: Leaving directory '/cygdrive/t/dar-2.6.0.RC1/src/dar_suite'
make[2]: *** [Makefile:415: install-recursive] Error 1
make[2]: Leaving directory '/cygdrive/t/dar-2.6.0.RC1/src'
make[1]: *** [Makefile:459: install-recursive] Error 1
make[1]: Leaving directory '/cygdrive/t/dar-2.6.0.RC1'
make: *** [Makefile:761: install-strip] Error 2

I have installed a bunch of gettext-related packages. It still fails.

I think the FAQ should be updated - it will take minutes for someone 
familiar with the build process to list all required packages while 
saving hours of repeated attempts to build for someone who isn't.

In any case, how do I build dar on Windows?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot