Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 244336 - failed to build btrfsck in btrfs-progs package
failed to build btrfsck in btrfs-progs package
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2007-06-15 01:43 EDT by Terje Røsten
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-15 04:01:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Terje Røsten 2007-06-15 01:43:18 EDT
Description of problem:

Wanted to play with btrfs:


on a rawhide box, however the btrfsck tools will not build.

After some testing it  seems like it will build on Fedora Core 6, but not
on Fedora 7 or rawhide. The error I get is:

gcc -g -Wall -fno-strict-aliasing -Werror -c btrfsck.c
In file included from /usr/include/fcntl.h:38,
                 from btrfsck.c:23:
/usr/include/sys/stat.h:370: error: array type has incomplete element type

As Fedora 7 and rawhide has newer glibc, the problem might be here.

Version-Release number of selected component (if applicable):


How reproducible:

Download btrfs-progs and try to build on Fedora 7 or rawhide.

Comment 1 Jakub Jelinek 2007-06-15 04:01:55 EDT
btrfsck.c is just buggy:
#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <stdlib.h>
#define __USE_GNU
#include <fcntl.h>

__USE_GNU macro is glibc implementation detail, no program must ever touch it.
info libc 'Feature Test Macros'
The feature test macros (_*_SOURCE) must be defined before including any header.
In this case SUSv3 namespace is not enough, as they want the readahead prototype.
But #define __USE_GNU is a wrong way to choose it, the right way is to
#define _GNU_SOURCE 1
above the first included header (either instead of _XOPEN_SOURCE 500 or together
with it).
Comment 2 Terje Røsten 2007-06-15 04:39:42 EDT
Thanks Jakub!

Note You need to log in before you can comment on or make changes to this bug.