hasse69 / rar2fs

FUSE file system for reading RAR archives
https://hasse69.github.io/rar2fs/
GNU General Public License v3.0
272 stars 25 forks source link

Compiler errors in 1.29.6... #190

Open noci2012 opened 5 days ago

noci2012 commented 5 days ago

During a build on gentoo ...

x86_64 / amd64, build fails.

configure: loading site script /usr/share/config.site
configure: loading site script /usr/share/config.site.d/80crossdev.conf
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/lib/portage/python3.12/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking dependency style of x86_64-pc-linux-gnu-gcc... none
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C99... none needed
checking for x86_64-pc-linux-gnu-gcc option to accept ISO Standard C... (cached) none needed
checking whether x86_64-pc-linux-gnu-gcc and cc understand -c and -o together... yes
checking for x86_64-pc-linux-gnu-g++... x86_64-pc-linux-gnu-g++
checking whether we are using the GNU C++ compiler... yes
checking whether x86_64-pc-linux-gnu-g++ accepts -g... yes
checking dependency style of x86_64-pc-linux-gnu-g++... none
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether byte ordering is bigendian... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/mount.h usability... yes
checking sys/mount.h presence... yes
checking for sys/mount.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/statvfs.h usability... yes
checking sys/statvfs.h presence... yes
checking for sys/statvfs.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking ucontext.h usability... yes
checking ucontext.h presence... yes
checking for ucontext.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking sys/xattr.h usability... yes
checking sys/xattr.h presence... yes
checking for sys/xattr.h... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking whether to enable assertions... yes
checking for uid_t in sys/types.h... yes
checking for inline... inline
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking for ssize_t... yes
checking for struct stat.st_blksize... yes
checking for struct stat.st_gen... no
checking for struct stat.st_atim... yes
checking for struct stat.st_ctim... yes
checking for struct stat.st_mtim... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_rdev... yes
checking for uint64_t... yes
checking for a working PRIu64... yes
checking return type of signal handlers... void
checking for struct sigaction.sa_sigaction... yes
checking for unistd.h... (cached) yes
checking for working chown... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether lstat correctly handles trailing slash... yes
checking for mktime... yes
checking for atexit... yes
checking for dup3... yes
checking for fs_stat_dev... no
checking for ftruncate... yes
checking for getcwd... yes
checking for getpass... yes
checking for lchown... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for mkdir... yes
checking for realpath... yes
checking for rmdir... yes
checking for select... yes
checking for setlocale... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strpbrk... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
checking for utimensat... yes
checking for fdatasync... yes
checking for wcstombs... yes
checking for umask... yes
checking for memrchr... yes
checking for library containing getxattr... none required
checking for getxattr... yes
checking for lgetxattr... yes
checking for fgetxattr... yes
checking for listxattr... yes
checking for llistxattr... yes
checking for flistxattr... yes
checking for removexattr... yes
checking for lremovexattr... yes
checking for fremovexattr... yes
checking for setxattr... yes
checking for lsetxattr... yes
checking for fsetxattr... yes
checking whether xattr interface takes additional options... no
checking for fmemopen... yes
checking for lockf... yes
checking for flock... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for munmap... yes
checking for library containing backtrace... none required
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for main in -lrt... yes
checking for main in -ldl... yes
checking fuse.h usability... yes
checking fuse.h presence... yes
checking for fuse.h... yes
checking for fuse_new in -losxfuse_i64... no
checking for fuse_new in -losxfuse... no
checking for fuse_new in -lfuse_ino64... no
checking for fuse_new in -lfuse4x... no
checking for fuse_new in -lfuse... yes
checking for fuse_version... yes
checking for supported FUSE API version... yes
checking if we need to set -DCYGFUSE... no
checking how to run the C++ preprocessor... x86_64-pc-linux-gnu-g++ -E
checking rar.hpp usability... yes
checking rar.hpp presence... yes
checking for rar.hpp... yes
checking for static linking of UnRAR library... no
checking for RARGetDllVersion in -lunrar... yes
checking for matching UnRAR library and source version... yes
checking if unrar library needs -DRAR_SMP... yes
checking for iconv... yes
checking for working iconv... yes
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for commit hash in git repo... no
checking for sched_setaffinity... yes
checking whether cpu_set_t available... yes
checking whether the CPU_SET and CPU_ZERO macros are defined... yes
checking scandir ARG3 => const struct dirent * ... ok
checking if compiler supports -fno-omit-frame-pointer... yes
checking if compiler supports -Wextra... yes
checking if compiler supports -Wno-unused-result... yes
checking if compiler supports visibility attribute... yes
checking if linker supports -rdynamic... yes
checking for __sync_synchronize... yes
checking for GNU style dirname... yes
checking for errno ENOATTR... no
checking whether ln -s works... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
Making all in src
make[1]: Entering directory '/var/tmp/portage/sys-fs/rar2fs-1.29.6/work/rar2fs-1.29.6/src'
make  all-am
make[2]: Entering directory '/var/tmp/portage/sys-fs/rar2fs-1.29.6/work/rar2fs-1.29.6/src'
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/libunrar -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -DNDEBUG -DRARDLL -DRAR_SMP -Wall -Wno-reorder -O2 -pipe  -c -o dllext.o dllext.cpp
dllext.cpp: In function ‘int RARListArchiveEx(void*, RARArchiveDataEx**)’:
dllext.cpp:174:46: error: cannot convert ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’} to ‘const wchar_t*’
  174 |           wcscpy(N->LinkTargetW,Arc.FileHead.RedirName);
      |                                 ~~~~~~~~~~~~~^~~~~~~~~
      |                                              |
      |                                              std::wstring {aka std::__cxx11::basic_string<wchar_t>}
In file included from /usr/include/features.h:503,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/x86_64-pc-linux-gnu/bits/os_defines.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/x86_64-pc-linux-gnu/bits/c++config.h:679,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/requires_hosted.h:31,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/iostream:38,
                 from dllext.cpp:29:
/usr/include/bits/wchar2.h:60:1: note:   initializing argument 2 of ‘wchar_t* wcscpy(wchar_t*, const wchar_t*)’
   60 | __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
      | ^~~~~
dllext.cpp:180:46: error: cannot convert ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’} to ‘const wchar_t*’
  180 |           wcscpy(N->LinkTargetW,Arc.FileHead.RedirName);
      |                                 ~~~~~~~~~~~~~^~~~~~~~~
      |                                              |
      |                                              std::wstring {aka std::__cxx11::basic_string<wchar_t>}
/usr/include/bits/wchar2.h:60:1: note:   initializing argument 2 of ‘wchar_t* wcscpy(wchar_t*, const wchar_t*)’
   60 | __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
      | ^~~~~
dllext.cpp: In function ‘void RARNextVolumeName(char*, bool)’:
dllext.cpp:214:18: error: ‘NM’ was not declared in this scope
  214 |   wchar NextName[NM];
      |                  ^~
dllext.cpp:215:20: error: ‘NextName’ was not declared in this scope; did you mean ‘SetName’?
  215 |   CharToWide(arch, NextName, ASIZE(NextName));
      |                    ^~~~~~~~
      |                    SetName
dllext.cpp: In function ‘void RARVolNameToFirstName(char*, bool)’:
dllext.cpp:227:17: error: ‘NM’ was not declared in this scope
  227 |   wchar ArcName[NM];
      |                 ^~
dllext.cpp:228:20: error: ‘ArcName’ was not declared in this scope
  228 |   CharToWide(arch, ArcName, ASIZE(ArcName));
      |                    ^~~~~~~
dllext.cpp: In function ‘void RARGetFileInfo(void*, const char*, RARWcb*)’:
dllext.cpp:244:20: error: ‘NM’ was not declared in this scope
  244 |   char FileNameUtf[NM];
      |                    ^~
dllext.cpp:253:37: error: ‘FileNameUtf’ was not declared in this scope; did you mean ‘FileName’?
  253 |     WideToUtf(Arc.FileHead.FileName,FileNameUtf,ASIZE(FileNameUtf));
      |                                     ^~~~~~~~~~~
      |                                     FileName
dllext.cpp: In function ‘size_t ListFileHeader(wchar*, Archive&)’:
dllext.cpp:373:18: error: cannot convert ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’} to ‘wchar*’ {aka ‘wchar_t*’} in initialization
  373 |   wchar *Name=hd.FileName;
      |               ~~~^~~~~~~~
      |                  |
      |                  std::wstring {aka std::__cxx11::basic_string<wchar_t>}
dllext.cpp:438:24: error: ‘NM’ was not declared in this scope
  438 |       char LinkTargetA[NM];
      |                        ^~
dllext.cpp:443:18: error: ‘LinkTargetA’ was not declared in this scope
  443 |         strncpyz(LinkTargetA,"*<-?->",ASIZE(LinkTargetA));
      |                  ^~~~~~~~~~~
In file included from /usr/include/libunrar/rar.hpp:13,
                 from dllext.cpp:31:
dllext.cpp:447:57: error: ‘LinkTargetA’ was not declared in this scope
  447 |         int DataSize=(int)Min((size_t)hd.PackSize,ASIZE(LinkTargetA)-1);
      |                                                         ^~~~~~~~~~~
/usr/include/libunrar/rardefs.hpp:4:26: note: in definition of macro ‘Min’
    4 | #define  Min(x,y) (((x)<(y)) ? (x):(y))
      |                          ^
dllext.cpp:447:51: note: in expansion of macro ‘ASIZE’
  447 |         int DataSize=(int)Min((size_t)hd.PackSize,ASIZE(LinkTargetA)-1);
      |                                                   ^~~~~
dllext.cpp:452:18: error: ‘LinkTargetA’ was not declared in this scope
  452 |       CharToWide(LinkTargetA,LinkTarget,ASIZE(LinkTarget));
      |                  ^~~~~~~~~~~
dllext.cpp:452:30: error: ‘LinkTarget’ was not declared in this scope; did you mean ‘MListTarget’?
  452 |       CharToWide(LinkTargetA,LinkTarget,ASIZE(LinkTarget));
      |                              ^~~~~~~~~~
      |                              MListTarget
In file included from /usr/include/bits/types/stack_t.h:23,
                 from /usr/include/signal.h:313,
                 from /usr/include/libunrar/os.hpp:142,
                 from /usr/include/libunrar/rar.hpp:6:
dllext.cpp:493:52: error: cannot bind non-const lvalue reference of type ‘std::wstring&’ {aka ‘std::__cxx11::basic_string<wchar_t>&’} to an rvalue of type ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’}
  493 |     BinToHex(hd.FileHash.Digest,BLAKE2_DIGEST_SIZE,NULL,BlakeStr,ASIZE(BlakeStr));
      |                                                    ^~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/string:54,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/locale_classes.h:40,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/ios_base.h:41,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/ios:44,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/ostream:40,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/iostream:41:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:641:7: note:   after user-defined conversion: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = std::allocator<wchar_t>; _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]’
  641 |       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
In file included from /usr/include/libunrar/rar.hpp:31:
/usr/include/libunrar/strfn.hpp:33:60: note: in passing argument 3 of ‘void BinToHex(const byte*, size_t, std::wstring&)’
   33 | void BinToHex(const byte *Bin,size_t BinSize,std::wstring &Hex);
      |                                              ~~~~~~~~~~~~~~^~~
dllext.cpp:534:39: error: cannot bind non-const lvalue reference of type ‘std::wstring&’ {aka ‘std::__cxx11::basic_string<wchar_t>&’} to an rvalue of type ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’}
  534 |     uint Version=ParseVersionFileName(Name,false);
      |                                       ^~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:641:7: note:   after user-defined conversion: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = std::allocator<wchar_t>; _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]’
  641 |       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
In file included from /usr/include/libunrar/rar.hpp:30:
/usr/include/libunrar/pathfn.hpp:92:40: note:   initializing argument 1 of ‘int ParseVersionFileName(std::wstring&, bool)’
   92 | int ParseVersionFileName(std::wstring &Name,bool Truncate);
      |                          ~~~~~~~~~~~~~~^~~~
make[2]: *** [Makefile:379: dllext.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-fs/rar2fs-1.29.6/work/rar2fs-1.29.6/src'
make[1]: *** [Makefile:248: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-fs/rar2fs-1.29.6/work/rar2fs-1.29.6/src'
make: *** [Makefile:283: all-recursive] Error 1
hasse69 commented 5 days ago

Did you try master/HEAD?

noci2012 commented 5 days ago

no, as that is not available in Gentoo directly. (They are waiting for a released version before updating).

hartmark commented 5 days ago

It's working without any issues using the tarbal for 1.29.6 on ArchLinux.

It's using unrar version 6.2.6

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rar2fs

hasse69 commented 5 days ago

no, as that is not available in Gentoo directly. (They are waiting for a released version before updating).

I just published a new patch release. This is the first attempt doing a release entirely from the GitHub interface. Thus keep me informed if the automatically attached assets are not good enough for Gentoo. I will keep this issue open until the new release has been confirmed to solve the build problem.

fdegros commented 4 days ago

I just published a new patch release. This is the first attempt doing a release entirely from the GitHub interface. Thus keep me informed if the automatically attached assets are not good enough for Gentoo.

I confirm that the recently released package of rar2fs 1.29.7 can be used to build rar2fs on ChromeOS, which uses a similar build system to Gentoo. However, ChromeOS is still using unrar 6.2.10.

fdegros commented 4 days ago

I also created a pull request to upgrade rar2fs to 1.29.7 in Gentoo. We'll see how it goes...