FS#38387 - [glibc,linux-api-headers] {linux,sys}/xattr.h incompatibility

Attached to Project: Arch Linux
Opened by Andreas (misc) - Sunday, 05 January 2014, 12:57 GMT
Last edited by Allan McRae (Allan) - Tuesday, 07 January 2014, 07:10 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

With libcap 2.23-2 zsh will fail to compile:

gcc -c -I. -I../../Src -I../../Src -I../../Src/Zle -I. -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -DMODULE -march=x86-64 -mtune=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -o attr..o attr.c
In file included from attr.c:34:0:
/usr/include/sys/xattr.h:31:3: Error: expected identifier before numeric constant
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
^
Makefile:241: recipe for target 'attr..o' failed

Downgrade to libcap 2.22-5 made the compilation succeed again.

Filing this as libcap issue and not as zsh one as it likely affects other programs, too.
This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 07 January 2014, 07:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  glibc 2.18-12
Comment by Allan McRae (Allan) - Sunday, 05 January 2014, 14:07 GMT
This is actually an incompatibility between linux/xattr.h and sys/xattr.h. It fails when linux/xattr.h is included first but not when sys/xattr.h is.
Comment by Dave Reisner (falconindy) - Sunday, 05 January 2014, 19:57 GMT
> likely affects other programs, too.
Affects anything that relies on sys/capability.h as well. systemd fails to build under libcap 2.23.
Comment by Allan McRae (Allan) - Sunday, 05 January 2014, 21:57 GMT
Anything that includes sys/capability.h (and thus linux/xattr.h) before sys/xattr.h
Comment by Andreas (misc) - Monday, 06 January 2014, 01:22 GMT
Current git of systemd does build, though.
Comment by Dave Reisner (falconindy) - Monday, 06 January 2014, 02:35 GMT
> Current git of systemd does build, though.
Ah. It only builds because of the patch included in 2.23-2.
Comment by Pierre Schmitz (Pierre) - Monday, 06 January 2014, 10:21 GMT
So this is nothing we can fix in zsh? If there is no easy fix, should we downgrade libcap to 2.22?
Comment by Allan McRae (Allan) - Monday, 06 January 2014, 10:43 GMT
Plenty of things you can do. Easiest "fix" is to get the include for sys/xattr.h to the top of the file.

Downgrading libcap does not seem right when it is not the cause of the issue - although including a kernel space header in a userspace library should not be done. I suppose, technically it is changes in glibc-2.18 causing it.

I'll provide a hack fix in glibc while I am dealing with linux/glibc upstream to fix this correctly.
Comment by Pierre Schmitz (Pierre) - Monday, 06 January 2014, 11:00 GMT
OK, I'll move the include for now.

Loading...