GNU bug report logs - #74194
compilation error: 'S_MAGIC_BCACHEFS' undeclared

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: Bruno Haible <bruno@HIDDEN>; Done: Paul Eggert <eggert@HIDDEN>; Maintainer for coreutils is bug-coreutils@HIDDEN.
bug closed, send any further explanations to 74194 <at> debbugs.gnu.org and Bruno Haible <bruno@HIDDEN> Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 74194 <at> debbugs.gnu.org:


Received: (at 74194) by debbugs.gnu.org; 3 Nov 2024 23:53:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 03 18:53:22 2024
Received: from localhost ([127.0.0.1]:35798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t7kPK-0002M1-M6
	for submit <at> debbugs.gnu.org; Sun, 03 Nov 2024 18:53:22 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:45756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1t7kPH-0002Lk-TM
 for 74194 <at> debbugs.gnu.org; Sun, 03 Nov 2024 18:53:21 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 42BCB3C00FA88;
 Sun,  3 Nov 2024 15:53:13 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id tivv0_U8dwx4; Sun,  3 Nov 2024 15:53:13 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 094EB3C00FA89;
 Sun,  3 Nov 2024 15:53:13 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 094EB3C00FA89
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1730677993;
 bh=iCY6eoK7TTlsvS2capTM39FAprXxyZUJMku+yaNXFL0=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=c8hlI/nZcV79MdKd6iED7OfAz967eFYhapvSQB3pyCyafMbY/T1cg1aKXI7UP9Wwv
 CVS7nt+8F4Zi3Ln5TdC/jpTZwXrk2fo9C5jen7vxAuy6Zgjk+Z0RGSHD+dxfYiaPks
 40lr3vNSKQ+SVxwmODM9tb8L83a11J5nad3UWbO28COgvEDBhpziCxxvvDomFk2hzO
 9QJs+lgX/wjIs9p2yTVt3cTKi58BVFuzjGLe9WywHbB1kMP3vE8C4cxzfGTyVhFh29
 T/6HixVaxD8nVzQiEUMo0+2TNhNytPFUOBA5DMhxxpA56bMLCsCqK4FGVFInvLojxV
 P/RP1IE6I+epQ==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id b-foBZLhicTC; Sun,  3 Nov 2024 15:53:12 -0800 (PST)
Received: from [192.168.254.12] (unknown [47.150.137.250])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id E073D3C00FA86;
 Sun,  3 Nov 2024 15:53:12 -0800 (PST)
Message-ID: <b0fd0c0a-875e-4650-92fa-b48aed747a77@HIDDEN>
Date: Sun, 3 Nov 2024 15:53:12 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#74194: compilation error: 'S_MAGIC_BCACHEFS' undeclared
To: Bruno Haible <bruno@HIDDEN>, 74194 <at> debbugs.gnu.org
References: <1867774.e4xvhzFMnl@nimes>
Content-Language: en-US
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <1867774.e4xvhzFMnl@nimes>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74194
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Thanks, I installed that patch.




Information forwarded to bug-coreutils@HIDDEN:
bug#74194; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Nov 2024 23:14:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 03 18:14:55 2024
Received: from localhost ([127.0.0.1]:35571 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t7jo6-00012J-SA
	for submit <at> debbugs.gnu.org; Sun, 03 Nov 2024 18:14:55 -0500
Received: from lists.gnu.org ([209.51.188.17]:49964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bruno@HIDDEN>) id 1t7jo4-00012D-F2
 for submit <at> debbugs.gnu.org; Sun, 03 Nov 2024 18:14:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bruno@HIDDEN>) id 1t7jo3-0006D3-56
 for bug-coreutils@HIDDEN; Sun, 03 Nov 2024 18:14:51 -0500
Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bruno@HIDDEN>) id 1t7jo0-00046o-Ur
 for bug-coreutils@HIDDEN; Sun, 03 Nov 2024 18:14:50 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1730675686; cv=none;
 d=strato.com; s=strato-dkim-0002;
 b=N5hURv4DsE9jqUAj2stcniI0BdmPa/E8yTxrSL/GVax9j7LV3Cizi6XpsZOK/hXSPD
 +Y4x5VIFa7HnDAA7MipISOLae7LEEBaUdd/iQ+Zps11mvhcGljklWcp0IV7F/nI8fY9l
 e8CuYRLzwrRABUoT/H/1ZRt7DKTbP39vEEY7adUGqqxmlzesxSDWein0N+BtGexBTZnn
 LZNd9Iz6+1kK9jShczQ6M/Q3rasEvSltWDaN19hl5lkQz1oxmTIq70F7m/ECpyd6rlYS
 EyiayBWFIpAxvdHtpRbJQrQBZalKI6AI4xRnRkCX5f3eMOnQEdaq6j7UVxI0DOI3I8yH
 DNTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1730675685;
 s=strato-dkim-0002; d=strato.com;
 h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender;
 bh=d9OJ7CxmhrXQiXXEOfD/52biFlN+MxGznj6RiCSdFwA=;
 b=WyJxT8JBDeIUTbXi0I3u1XSReTdq4o8jdVnsZWLN4s9kPtpV/Yo9dkLisK/GO/JLZj
 t7YGhckSzTQ9sDCrWfD8fsG5hIMKsnYa7tYrHkPCW5NJ09V2yLRT5etJcDZZtorTX5rm
 4rwXWTYtrRQuvKO+oWgmfmxxvCxPjdC5tAYV6N4L/Yox2gEzD8PjehbR+1Hlcx/e2YEq
 AqolOC27fa5+QWbH82gm7DM1TVVuaub7aQpGd0UEVEppG00HKOaiDD3y+lWx52+SCjBm
 QFvuRobEvGd7i9NFUkZVZP9xBiUDeWU8wmlFCOq2FeEJIKbezzEnJk9nb3lqcxnXxrxa
 mEew==
ARC-Authentication-Results: i=1; strato.com;
    arc=none;
    dkim=none
X-RZG-CLASS-ID: mo00
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1730675685;
 s=strato-dkim-0002; d=clisp.org;
 h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender;
 bh=d9OJ7CxmhrXQiXXEOfD/52biFlN+MxGznj6RiCSdFwA=;
 b=GHnAuHpkbs+tCa9XROQ0IjhC/wDtVSXxEJVNJFTvTIL7LjD4zFxx/VTlKJmOIDmqw6
 Hdt6c2rPSpDn7MN8E1RI2ucguO+2rRk+cuSb9vjGMx+dk1ToCuiRUK5aIjrtiUdjkKTu
 m+9tltYauGHZndlSxrmzBy33Gxb0ZJ4zJCr3XfZYCgRkIE1N/CKfOuIQaU6mCPqW0G9+
 Aj5+KQNLz+iaWF8y15jjNbMA7nAwxjxwcvQ52Ds+DN1xdwSHx/CflFGFJs+iS5FMyuQn
 C5i5Gy/cz4QMiIT/jUayz2Gp+utDYUqXkZbPdx6Kg0JEJlExrVpeyuuiVmaM6o12zzy7
 3bJA==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1730675685;
 s=strato-dkim-0003; d=clisp.org;
 h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender;
 bh=d9OJ7CxmhrXQiXXEOfD/52biFlN+MxGznj6RiCSdFwA=;
 b=QrsS2sS4FYyoHkPcifF3OXB0kqovDXuQ/jNxFDaBCRcXozFUPQbcJ/Fii83A/Q48xQ
 nQaiIAPCr6PfVgnlvtCQ==
X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlLnY4jECd2hdUURIbZgL8PX2QiTuZ3cdB8X/nqmjPHG2+tC7Ze3UGPC3VAB/U5hGP"
Received: from nimes.localnet by smtp.strato.de (RZmta 51.2.11 AUTH)
 with ESMTPSA id Nd105a0A3NEGal6
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits))
 (Client did not present a certificate);
 Mon, 4 Nov 2024 00:14:16 +0100 (CET)
From: Bruno Haible <bruno@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: compilation error: 'S_MAGIC_BCACHEFS' undeclared
Date: Mon, 04 Nov 2024 00:14:16 +0100
Message-ID: <1867774.e4xvhzFMnl@nimes>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="nextPart1815047.K29ADDU3aD"
Content-Transfer-Encoding: 7Bit
Received-SPF: none client-ip=81.169.146.162; envelope-from=bruno@HIDDEN;
 helo=mo4-p00-ob.smtp.rzone.de
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a multi-part message in MIME format.

--nextPart1815047.K29ADDU3aD
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Hi,

Building coreutils from source, today, I encountered this compilation error:

  CC       src/stat.o
=2E./src/stat.c: In function 'human_fstype':
=2E./src/stat.c:304:10: error: 'S_MAGIC_BCACHEFS' undeclared (first use in =
this function); did you mean 'S_MAGIC_TRACEFS'?
  304 |     case S_MAGIC_BCACHEFS: /* 0xCA451A4E local */
      |          ^~~~~~~~~~~~~~~~
      |          S_MAGIC_TRACEFS
=2E./src/stat.c:304:10: note: each undeclared identifier is reported only o=
nce for each function it appears in
=2E./src/stat.c:378:10: error: 'S_MAGIC_FUSE' undeclared (first use in this=
 function); did you mean 'S_MAGIC_UFS'?
  378 |     case S_MAGIC_FUSE: /* 0x65735546 remote */
      |          ^~~~~~~~~~~~
      |          S_MAGIC_UFS
=2E./src/stat.c:463:10: error: 'S_MAGIC_PID_FS' undeclared (first use in th=
is function); did you mean 'S_MAGIC_PRL_FS'?
  463 |     case S_MAGIC_PID_FS: /* 0x50494446 local */
      |          ^~~~~~~~~~~~~~
      |          S_MAGIC_PRL_FS
make[2]: *** [Makefile:12874: src/stat.o] Error 1

I understand that the list of S_* macros is meant to be defined in src/fs.h,
which is meant to be autogenerated from src/stat.c.

History:
=2D In July I had apparently built coreutils in this checkout.
=2D Now I did a 'git pull', 'make -k distclean', then
  built in a subdir 'build-64' (VPATH build).

The files that I have in this checkout at this point:

$ ls -l src/fs.h src/fs-is-local.h=20
=2Dr--r--r-- 1 bruno bruno 4755 Jul 21 18:15 src/fs.h
=2Dr--r--r-- 1 bruno bruno 5157 Jul 21 18:15 src/fs-is-local.h
$ ls -l src/stat.c=20
=2Drw-rw-r-- 1 bruno bruno 57973 Aug 14 14:38 src/stat.c

I tried this:

$ ./configure; make distclean
$ ls -l src/fs.h src/fs-is-local.h=20
=2Dr--r--r-- 1 bruno bruno 4755 Jul 21 18:15 src/fs.h
=2Dr--r--r-- 1 bruno bruno 5157 Jul 21 18:15 src/fs-is-local.h

This is normal: since src/fs.h and src/fs-is-local.h are contained in the
tarball, "make distclean" does not remove them.

Now I try a non-VPATH build:

$ ./configure; make
$ ls -l src/fs.h src/fs-is-local.h=20
=2Dr--r--r-- 1 bruno bruno 4824 Nov  3 23:39 src/fs.h
=2Dr--r--r-- 1 bruno bruno 5230 Nov  3 23:39 src/fs-is-local.h

This one succeeded, because src/fs.h was regenerated now.

The question thus is: Why was src/fs.h not regenerated in the VPATH build
earlier?

To reproduce this, I
  - remove the 3 entries from src/fs.h,
  - $ touch -d 'Jul 21 18:15' src/fs.h
  - $ mkdir build-64; cd build-64; ../configure; make

What I see is:

1) build-64/src/fs.h has been created, and it contains the 3 entries.

2) In the compilation command, -Isrc occurs before -I../src.

   gcc  -I. -I.. -I./lib  -Ilib -I../lib -Isrc -I../src -Wall   -g -O2 -c -=
o src/stat.o ../src/stat.c

   Use of option -E shows that despite this ordering of -I options,
   ../src/fs.h gets included. Apparently because it sits in the same
   directory as ../src/stat.c.

So the bug is that fs.h was created in the build directory, not in
the source directory. The GNU Coding Standards
<https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>
say that the file should be generated in the source directory:

  "GNU distributions usually contain some files which are not source
   files=E2=80=94for example, Info files, and the output from Autoconf, Aut=
omake,
   Bison or Flex. Since these files normally appear in the source
   directory, they should always appear in the source directory,
   not in the build directory. So Makefile rules to update them should
   put the updated files in the source directory."

The attached patch fixes this GCS violation and thus fixes the compilation
error.


--nextPart1815047.K29ADDU3aD
Content-Disposition: attachment; filename="0001-build-Regenerate-distributed-built-files-in-top_srcd.patch"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="UTF-8"; name="0001-build-Regenerate-distributed-built-files-in-top_srcd.patch"

From a750d2b575520966e361753d9a0aebf9cc6809c8 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@HIDDEN>
Date: Mon, 4 Nov 2024 00:11:40 +0100
Subject: [PATCH] build: Regenerate distributed built files in $(top_srcdir)

* src/local.mk (src/dircolors.h, src/fs-is-local.h, src/fs.h): Generate
in $(top_srcdir).
---
 src/local.mk | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/local.mk b/src/local.mk
index 8133925ac..feea9a6c9 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -521,8 +521,8 @@ clean-local:
 	done
 
 
-BUILT_SOURCES += src/dircolors.h
-src/dircolors.h: src/dcgen src/dircolors.hin
+BUILT_SOURCES += $(top_srcdir)/src/dircolors.h
+$(top_srcdir)/src/dircolors.h: src/dcgen src/dircolors.hin
 	$(AM_V_GEN)rm -f $@ $@-t
 	$(AM_V_at)${MKDIR_P} src
 	$(AM_V_at)$(PERL) -w -- $(srcdir)/src/dcgen \
@@ -614,8 +614,8 @@ src/fs-kernel-magic: Makefile src/fs-latest-magic.h
 	  | $(ASSORT) -u						\
 	  > $@-t && mv $@-t $@
 
-BUILT_SOURCES += src/fs-is-local.h
-src/fs-is-local.h: src/stat.c src/extract-magic
+BUILT_SOURCES += $(top_srcdir)/src/fs-is-local.h
+$(top_srcdir)/src/fs-is-local.h: src/stat.c src/extract-magic
 	$(AM_V_GEN)rm -f $@
 	$(AM_V_at)${MKDIR_P} src
 	$(AM_V_at)$(PERL) $(srcdir)/src/extract-magic \
@@ -623,8 +623,8 @@ src/fs-is-local.h: src/stat.c src/extract-magic
 	$(AM_V_at)chmod a-w $@t
 	$(AM_V_at)mv $@t $@
 
-BUILT_SOURCES += src/fs.h
-src/fs.h: src/stat.c src/extract-magic
+BUILT_SOURCES += $(top_srcdir)/src/fs.h
+$(top_srcdir)/src/fs.h: src/stat.c src/extract-magic
 	$(AM_V_GEN)rm -f $@
 	$(AM_V_at)${MKDIR_P} src
 	$(AM_V_at)$(PERL) $(srcdir)/src/extract-magic \
-- 
2.34.1


--nextPart1815047.K29ADDU3aD--







Acknowledgement sent to Bruno Haible <bruno@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#74194; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 16 Feb 2025 07:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.