missing attr/xattr.h

111 views
Skip to first unread message

Erich Eckner

unread,
Jan 9, 2021, 4:40:30 PM1/9/21
to bareos-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I'm trying to compile bareos 20 on arch linux, but it fails in
core/src/droplet/libdroplet/src/utils.c, because there is no attr/xattr.h.
It appears, that (at least arch) linux has this in sys/xattr.h ? So I
applied the following patch:

- ----8<----8<----8<----8<----8<----8<----
- --- a/core/src/droplet/libdroplet/src/utils.c 2020-12-16
08:46:16.000000000 +0100
+++ b/core/src/droplet/libdroplet/src/utils.c 2021-01-09
21:28:43.099999815 +0100
@@ -33,7 +33,7 @@
*/
#include <dropletp.h>
#include <linux/xattr.h>
- -#include <attr/xattr.h>
+#include <sys/xattr.h>
#include <errno.h>

/** @file */
- ---->8---->8---->8---->8---->8---->8----

which makes the compiler go further, until it stumbles over:

- ----8<----8<----8<----8<----8<----8<----
[ 12%] Building C object core/src/droplet/libdroplet/CMakeFiles/droplet.dir/src/backend/cdmi/object_id.c.o
In file included from /usr/include/unicode/umachine.h:52,
from /usr/include/unicode/utypes.h:38,
from /usr/include/unicode/ucnv_err.h:88,
from /usr/include/unicode/ucnv.h:52,
from /usr/include/libxml2/libxml/encoding.h:31,
from /usr/include/libxml2/libxml/parser.h:810,
from /home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/include/dropletp.h:59,
from /home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/src/backend/cdmi/object_id.c:34:
/home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/include/droplet/cdmi/crcmodel.h:81:25
error: both 'unsigned' and '_Bool' in declaration specifiers
81 | typedef unsigned bool;
| ^~~~

- ---->8---->8---->8---->8---->8---->8----

So I got bold and removed that line. However, then it complains about
missing definition of "bool" (who would have guessed that?):

- ----8<----8<----8<----8<----8<----8<----
[ 12%] Building C object
core/src/droplet/libdroplet/CMakeFiles/droplet.dir/src/backend/cdmi/crcmodel.c.o
In file included from /home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/src/backend/cdmi/crcmodel.c:30:
/home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/include/droplet/cdmi/crcmodel.h:109:4
error: unknown type name 'bool'
109 | bool cm_refin; /* Parameter: Reflect input bytes? */
| ^~~~
/home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/include/droplet/cdmi/crcmodel.h:110:4
error: unknown type name 'bool'
110 | bool cm_refot; /* Parameter: Reflect output CRC? */
| ^~~~
- ---->8---->8---->8---->8---->8---->8----

so I replaced bool by _Bool there and it goes further until:

- ----8<----8<----8<----8<----8<----8<----
[ 16%] Building C object core/src/droplet/libdroplet/CMakeFiles/droplet.dir/src/backend/posix/reqbuilder.c.o
/home/erich/archlinuxewe/bareos/src/bareos-Release-20.0.0/core/src/droplet/libdroplet/src/backend/posix/reqbuilder.c:42:10:
fatal error: attr/xattr.h: No such file or directory
42 | #include <attr/xattr.h>
| ^~~~~~~~~~~~~~
- ---->8---->8---->8---->8---->8---->8----

so I also replaced that one by sys/xattr.h. This makes the build finally
complete. However, this approach looks rather hacked to me. Can anyone
explain, what's going on here?

For sake of easy readability, I'll give the complete patch here:

- ----8<----8<----8<----8<----8<----8<----
- --- a/core/src/droplet/libdroplet/src/utils.c 2020-12-16
08:46:16.000000000 +0100
+++ b/core/src/droplet/libdroplet/src/utils.c 2021-01-09
21:28:43.099999815 +0100
@@ -33,7 +33,7 @@
*/
#include <dropletp.h>
#include <linux/xattr.h>
- -#include <attr/xattr.h>
+#include <sys/xattr.h>
#include <errno.h>

/** @file */
- --- a/core/src/droplet/libdroplet/include/droplet/cdmi/crcmodel.h
2020-12-16 08:46:16.000000000 +0100
+++ b/core/src/droplet/libdroplet/include/droplet/cdmi/crcmodel.h
2021-01-09 21:50:10.506666487 +0100
@@ -78,7 +78,6 @@
#ifndef DONE_STYLE

typedef unsigned long ulong;
- -typedef unsigned bool;
typedef unsigned char * p_ubyte_;

#ifndef TRUE
@@ -106,8 +106,8 @@
int cm_width; /* Parameter: Width in bits [8,32]. */
ulong cm_poly; /* Parameter: The algorithm's polynomial. */
ulong cm_init; /* Parameter: Initial register value. */
- - bool cm_refin; /* Parameter: Reflect input bytes? */
- - bool cm_refot; /* Parameter: Reflect output CRC? */
+ _Bool cm_refin; /* Parameter: Reflect input bytes? */
+ _Bool cm_refot; /* Parameter: Reflect output CRC? */
ulong cm_xorot; /* Parameter: XOR this to output CRC. */

ulong cm_reg; /* Context: Context during execution. */
- --- a/core/src/droplet/libdroplet/src/backend/posix/reqbuilder.c
2020-12-16 08:46:16.000000000 +0100
+++ b/core/src/droplet/libdroplet/src/backend/posix/reqbuilder.c
2021-01-09 22:27:57.346666239 +0100
@@ -39,7 +39,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <linux/xattr.h>
- -#include <attr/xattr.h>
+#include <sys/xattr.h>
#include <utime.h>
#include <pwd.h>
#include <grp.h>
- ---->8---->8---->8---->8---->8---->8----

regards,
Erich

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAl/6IsEACgkQCu7JB1Xa
e1rWPA//elYE5zxtcskcP00hb1D83wzOKEcSTLBas1PVtpoS6v7+r+rowSywMnvC
6CgH3mS24gNkRLSqQJbQ3wrdutYEHQ6s+oKmLaxtb4/3T5u/8BiUxhipJel/qIwg
6/Pk1HZz1Bz/70tuPeZ4xwlF6XksArFox0MmQ7pZ6zO5ZGf/2b0Yuo+7EPVn6Euz
PSvVYLFuRLuRmmpA6kkPOwu+6jTRNV+mDLsoYEIoWwQUDfFsBS75aONCYIoIvYne
Htcx9LpB8Enw7Uoy6FvM49onKA8Jt62Da5Fb10nMPXC6dttQdy4iP+vwhgkpME4O
lFVWa7xsYZsNT0eLR54cctpieUQR1wapkZRGVJfmAyTHmVerRcxYkRGxuoTJUvjO
1o9xWAK9VCB+0jz33PETH73WcprLVQcbxtCUJaYcCWykRIxpWMX0Y3UpQ1QKOK55
JqQ9QlXoVYvi/LJmWLd0K0h2gCFqCo2zrLpsRyZafrr/l2f+HrIOV8Y8N8QH0VlO
P8e6JtHNXPEQeu6qOwI51a6DnlBAfdUGgsYaPJDPYZ++lD2qrZ+xj4ktdaVoFalH
zciK35BuPAkBAns5lKBwLugkJeH0KLKrxk0gpGmdtjIe6HDyOQ0hivuV+WJ8G6Tx
DmIo14mEMuf4Ujavcg2GojEwwefLDT4U1hfU5cvzIk7rgmChC9Y=
=606O
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages