attr/xattr.h conflicts with new glibc sys/xattr.h

Bug #1288091 reported by Martin Pitt
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
attr (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Latest eglibc changed its <sys/xattr.h> file to define XATTR_CREATE as a enum:

{
  XATTR_CREATE = 1,……………/* set value, fail if attr already exists. */
#define XATTR_CREATE…………XATTR_CREATE
  XATTR_REPLACE = 2……………/* set value, fail if attr does not exist. */
#define XATTR_REPLACE………XATTR_REPLACE
};

But our <attr/xattr.h> conflicts to that as it defines it as a macro:

#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */

This leads to build failures like in systemd, which explicitly inclue <attr/xattr.h>, but <sys/xattr.h> gets pulled in through some other include:

In file included from src/core/socket.c:33:0:
/usr/include/x86_64-linux-gnu/sys/xattr.h:31:3: error: expected identifier before numeric constant
   XATTR_CREATE = 1, /* set value, fail if attr already exists. */

See https://launchpad.net/ubuntu/+source/systemd/204-5ubuntu12 for the build errror, and https://sourceware.org/ml/libc-alpha/2014-01/msg00075.html for an upstream discussion about that.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in attr (Ubuntu):
status: New → Confirmed
Revision history for this message
Camilo Aguilar (camilo-aguilar) wrote :

I just got bitten by this issue. Is there any workaround while a fix gets worked out?

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Sebastian Geiger (lanoxx) wrote :

Is there any fix for this? It prevents me from building systemd...

Revision history for this message
Martin Pitt (pitti) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.