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
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
7
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2007-06-15 04:01:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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:

http://oss.oracle.com/~mason/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):

glibc-2.6-3
gcc-4.1.2-12

How reproducible:

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

http://oss.oracle.com/~mason/btrfs/btrfs-progs-0.2.tar.bz2
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.
See
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.