'RENAME_NOREPLACE' undeclared

Comments, questions, bug reports, etc.
Post Reply
Skyblue
Posts: 26
Joined: Fri Apr 08, 2016 7:12 am

'RENAME_NOREPLACE' undeclared

Post by Skyblue »

Hello,

Trying to compile the source code of wimlib v1.14.4 on CentOS 7.9, I receive the following error messages :

Code: Select all

src/mount_image.c: In function 'wimfs_rename':
src/mount_image.c:1872:14: error: 'RENAME_EXCHANGE' undeclared (first use in this function)
  if (flags & RENAME_EXCHANGE)
              ^
src/mount_image.c:1872:14: note: each undeclared identifier is reported only once for each function it appears in
src/mount_image.c:1876:20: error: 'RENAME_NOREPLACE' undeclared (first use in this function)
           (flags & RENAME_NOREPLACE), NULL);
                    ^
src/mount_image.c:1877:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[1]: *** [src/libwim_la-mount_image.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/build/rpmbuild/BUILD/wimlib-1.14.4'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.ngCXdS (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.ngCXdS (%build)
Skyblue
Posts: 26
Joined: Fri Apr 08, 2016 7:12 am

Re: 'RENAME_NOREPLACE' undeclared

Post by Skyblue »

Hello,

Here, I found some equates :

https://kernel.googlesource.com/pub/scm ... enameat2.c

Code: Select all

#ifndef RENAME_NOREPLACE
#define RENAME_NOREPLACE	(1 << 0)	/* Don't overwrite target */
#endif
#ifndef RENAME_EXCHANGE
#define RENAME_EXCHANGE		(1 << 1)	/* Exchange source and dest */
#endif
Recompiling the source code, I get a lot of error messages :

^

Code: Select all

src/sha1.c:215:7: error: incompatible types when assigning to type '__m128i' from type 'int'
    w0 = _mm_shuffle_epi8(w0, bswap32_mask); \
       ^
src/sha1.c:226:2: note: in expansion of macro 'SHA1_SSSE3_PRECALC'
  SHA1_SSSE3_PRECALC((i) + 16, w0, w1, w2, w3, w4, w5, w6, w7); \
  ^
src/sha1.c:235:2: note: in expansion of macro 'SHA1_SSSE3_2ROUNDS'
  SHA1_SSSE3_2ROUNDS((i) + 2, d, e, a, b, c, w0, w1, w2, w3, w4, w5, w6, w7); \
  ^
src/sha1.c:246:2: note: in expansion of macro 'SHA1_SSSE3_4ROUNDS'
  SHA1_SSSE3_4ROUNDS((i) + 16, e, a, b, c, d, w4, w5, w6, w7, w0, w1, w2, w3);
  ^
src/sha1.c:274:3: note: in expansion of macro 'SHA1_SSSE3_20ROUNDS'
   SHA1_SSSE3_20ROUNDS(0, w0, w1, w2, w3, w4, w5, w6, w7); \
   ^
src/sha1.c:299:2: note: in expansion of macro 'SHA1_SSSE3_BODY'
  SHA1_SSSE3_BODY;
  ^
src/sha1.c:215:7: error: incompatible types when assigning to type '__m128i' from type 'int'
    w0 = _mm_shuffle_epi8(w0, bswap32_mask); \
       ^
src/sha1.c:229:2: note: in expansion of macro 'SHA1_SSSE3_PRECALC'
  SHA1_SSSE3_PRECALC((i) + 17, w0, w1, w2, w3, w4, w5, w6, w7); \
  ^
synchronicity
Site Admin
Posts: 474
Joined: Sun Aug 02, 2015 10:31 pm

Re: 'RENAME_NOREPLACE' undeclared

Post by synchronicity »

I'll add fallback definitions for those RENAME_* constants.

For the error in sha1.c, would you mind just using gcc 4.9 or later? It's already a decade old.
Skyblue
Posts: 26
Joined: Fri Apr 08, 2016 7:12 am

Re: 'RENAME_NOREPLACE' undeclared

Post by Skyblue »

Hi synchronicity,

Thanks for your suggestions, I managed to build the RPM packages.

The problem with the gcc compiler suit is that the standart installation of the development tools is offering an old version :

Code: Select all

[root@localhost ~]# gcc --version | grep gcc
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Installing version 7 as a quick solution :

https://superuser.com/questions/1640048 ... n-centos-7

Code: Select all

yum install -y centos-release-scl
yum install -y devtoolset-7
scl enable devtoolset-7 bash
Post Reply