Edrusb / DAR

DAR - Disk ARchive
http://dar.linux.free.fr/
GNU General Public License v2.0
133 stars 19 forks source link

Dar 2.7.13 has broken birthtime detection on Linux #57

Closed BC204 closed 8 months ago

BC204 commented 8 months ago

Environment: AOSC OS (https://aosc.io/downloads/) GCC version: 13.2.0 Glibc version: 2.37 Architecture: amd64 Version: 2.7.13

While attempting to build dar 2.7.13 with --enable-birthtime, configure complains that it could not find support for birthtime. However, from the ChangLog I see that dar 2.7 has added support for statx() under Linux.

build.log

checking birth time availability... NOT FOUND
configure: WARNING: Cannot find support for birthtime, HFS+ FSA support will not be available
configure: error: birth time support not available

config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by DAR configure 2.7.13, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /var/cache/acbs/build/acbs.iyiadthb/dar-2.7.13/configure --build=x86_64-aosc-linux-gnu --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --bindir=/usr/bin --sbindir=/usr/bin --mandir=/usr/share/man --enable-birthtime --enable-option-checking=fatal

...

configure:24946: checking birth time availability
configure:24987: g++ -o conftest  -pipe -Wno-error -fstack-protector-strong --param=ssp-buffer-size=4 -fexceptions -ggdb -O2 -fomit-frame-pointer -march=x86-64 -mtune=sandybridge -msse2 -fira-loop-pressure -fira-hoist-pressure -ftree-vectorize -specs=/usr/lib/gcc/specs/hardened-cc1 -flto=auto -ggdb -fpermissive -fdeclone-ctor-dtor -ftree-vectorize   -D_GLIBCXX_ASSERTIONS -D_FORTIFY_SOURCE=2   -Wl,-O1,--sort-common,--as-needed -Wl,-build-id=sha1 -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/gcc/specs/hardened-ld -flto -fuse-linker-plugin  conftest.cpp -lattr -lgcrypt -lgpg-error -llz4 -lzstd -llzma -llzo2 -lbz2 -lz -ldl -lcap  >&5
conftest.cpp: In function 'int main()':
conftest.cpp:166:68: error: 'struct stat' has no member named 'st_birthtime'
  166 |                                                 time_t birth = tmp.st_birthtime;
      |                                                                    ^~~~~~~~~~~~
configure:24987: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "DAR"
| #define PACKAGE_TARNAME "dar"
| #define PACKAGE_VERSION "2.7.13"
| #define PACKAGE_STRING "DAR 2.7.13"
| #define PACKAGE_BUGREPORT "http://sourceforge.net/tracker/?group_id=65612&atid=511612"
| #define PACKAGE_URL ""
| #define DAR_VERSION "2.7.13"
| #define PACKAGE "dar"
| #define VERSION "2.7.13"
| #define ENABLE_NLS 1
| #define HAVE_GETTEXT 1
| #define HAVE_DCGETTEXT 1
| #define HAVE_ICONV 1
| #define ICONV_CONST 
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define _XOPEN_SOURCE 700
| #define _BSD_SOURCE 1
| #define _DEFAULT_SOURCE 1
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define HAVE_LIBCAP 1
| #define HAVE_LIBDL 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_TIME_H 1
| #define HAVE_FNMATCH_H 1
| #define HAVE_REGEX_H 1
| #define HAVE_PWD_H 1
| #define HAVE_GRP_H 1
| #define HAVE_STDIO_H 1
| #define HAVE_PTHREAD_H 1
| #define HAVE_CTYPE_H 1
| #define HAVE_GETOPT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_LIBINTL_H 1
| #define HAVE_SYS_CAPABILITY_H 1
| #define HAVE_LINUX_CAPABILITY_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_WCTYPE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STRUCT_STAT_ST_RDEV 1
| #define HAVE_DECL_SYS_SIGLIST 0
| #define SIZEOF_SIZE_T 8
| #define SIZEOF_TIME_T 8
| #define SIZEOF_OFF_T 8
| #define HAVE_FNMATCH 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_WORKING_VFORK 1
| #define HAVE_WORKING_FORK 1
| #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
| #define MAJOR_IN_SYSMACROS 1
| #define HAVE_STDLIB_H 1
| #define HAVE_MALLOC 1
| #define RETSIGTYPE void
| #define HAVE_UTIME_H 1
| #define HAVE_UTIME_NULL 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_LCHOWN 1
| #define HAVE_MKDIR 1
| #define HAVE_REGCOMP 1
| #define HAVE_RMDIR 1
| #define HAVE_STRERROR_R 1
| #define HAVE_UTIME 1
| #define HAVE_FDOPENDIR 1
| #define HAVE_READDIR_R 1
| #define HAVE_CTIME_R 1
| #define HAVE_GETGRNAM_R 1
| #define HAVE_GETPWNAM_R 1
| #define HAVE_LOCALTIME_R 1
| #define HAVE_GETOPT_IN_UNISTD_H 1
| #define HAVE_CAPABILITIES 1
| #define HAVE_FDATASYNC 1
| #define HAVE_SYNCFS 1
| #define LIBDAR_TIME_ACCURACY_SECOND 0
| #define LIBDAR_TIME_ACCURACY_MICROSECOND 6
| #define LIBDAR_TIME_ACCURACY_NANOSECOND 9
| #define LIBDAR_TIME_WRITE_ACCURACY 9
| #define LIBDAR_TIME_READ_ACCURACY 9
| #define HAVE_LUTIMES 1
| #define HAVE_STRERROR_R_CHAR_PTR 1
| #define HAVE_STATX_SYSCALL 1
| #define HAVE_LIBZ 1
| #define HAVE_ZLIB_H 1
| #define LIBZ_AVAILABLE 1
| #define HAVE_LIBBZ2 1
| #define HAVE_BZLIB_H 1
| #define LIBBZ2_AVAILABLE 1
| #define HAVE_LIBLZO2 1
| #define HAVE_LZO_LZO1X_H 1
| #define LIBLZO2_AVAILABLE 1
| #define HAVE_LIBLZMA 1
| #define HAVE_LZMA_H 1
| #define LIBLZMA_AVAILABLE 1
| #define HAVE_LIBZSTD 1
| #define HAVE_ZSTD_H 1
| #define MIN_MAJ_VERSION_ZSTD "1"
| #define MIN_MIN_VERSION_ZSTD "3"
| #define LIBZSTD_AVAILABLE 1
| #define HAVE_LIBLZ4 1
| #define HAVE_LZ4_H 1
| #define LIBLZ4_AVAILABLE 1
| #define HAVE_LIBGPG_ERROR 1
| #define HAVE_LIBGCRYPT 1
| #define HAVE_GCRYPT_H 1
| #define MIN_VERSION_GCRYPT "1.4.0"
| #define MIN_VERSION_GCRYPT_HASH_BUG "1.6.0"
| #define CRYPTO_AVAILABLE 1
| #define HAVE_SYS_XATTR_H 1
| #define HAVE_LIBATTR 1
| #define EA_SUPPORT /**/
| #define LIBDAR_NODUMP_FEATURE NODUMP_EXT2FS
| /* end confdefs.h.  */
| 
|                                                 extern "C" {
|                                                 #if HAVE_SYS_TYPE_H
|                                                 #include <sys/types.h>
|                                                 #endif
|                                                 #if HAVE_SYS_STAT_H
|                                                 #include <sys/stat.h>
|                                                 #endif
|                                                 #if HAVE_UNISTD_H
|                                                 #include <unistd.h>
|                                                 #endif
|                                                 }
| int
| main ()
| {
| 
|                                                 struct stat tmp;
|                                                 int ret = stat("/", &tmp);
|                                                 time_t birth = tmp.st_birthtime;
| 
|   ;
|   return 0;
| }
| 
configure:24998: result: NOT FOUND
configure:25000: WARNING: Cannot find support for birthtime, HFS+ FSA support will not be available
configure:25007: error: birth time support not available
Edrusb commented 8 months ago

Hi,

birthtime and statx are two independent implementations (both are enabled by default and disabled if detection failed) that provide support for the birth time date. From ./configure --help you will find the following (note the restriction under Linux):

--disable-birthtime     disable the HFS+ Filesystem Specific Attribute  support

--disable-linux-statx   ignore linux's statx() system call and do not save
                          birthtime of files under Linux because it is only
                          possible to set and thus restore it under BSD
                          systems like MACOS X, no under Linux today

Under Linux your ./configure should give something like this:

dar and libdar have been successfully configured with the following parameters:

  LIBDAR parameters:
   Zlib compression (gzip)    : YES
   Libbz2 compression (bzip2) : YES
   Liblzo2 compression (lzo)  : YES
   Liblxz compression (xz)    : YES
   Liblzstd compression (zstd): YES
   Liblz4 compression (lz4)   : YES
   Strong encryption support  : YES
   Public key cipher support  : YES
   Extended Attributes support: YES
   Large files support (> 2GB): YES
   extX FSA / nodump support  : YES
   HFS+ FSA support           : NO    <<<<<------ here
   statx() support            : YES       <<<<<<----- and here
   Integer size used          : 64
   Thread safe support        : YES
   Furtive read mode          : YES
   Large directory optim.     : YES
   posix fadvise support      : YES
   timepstamps write accuracy : 1 nanosecond
   timestamps read accuracy   : 1 nanosecond
   can restore symlink dates  : YES
   can uses multiple threads  : YES (+ barrier implementations for MAC OS)
   Delta-compression support  : YES
   Remote repository support  : YES
   Argon2 hashing algorithm   : YES
BC204 commented 8 months ago

Ok, I see. Thanks for your reply.