fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

Compilation error:chroot.c:38:45: error: '_STAT_VER' undeclared (first use in this function)

Open duerpei opened this issue 3 years ago • 4 comments

I’m try to cross complier fakechroot for arrch64 in ubuntu, I run the follow commands : $ ./autogen.sh $ ./configure --host=aarch64 $ make

I meet the follow error: chroot.c: In function 'chroot': chroot.c:38:45: error: '_STAT_VER' undeclared (first use in this function) 38 | # define STAT(path, sb) nextcall(__xstat64)(_STAT_VER, path, sb) | ^~~~~~~~~ chroot.c:108:19: note: in expansion of macro 'STAT' 108 | if ((status = STAT(path, &sb)) != 0) { | ^~~~ chroot.c:38:45: note: each undeclared identifier is reported only once for each function it appears in 38 | # define STAT(path, sb) nextcall(__xstat64)(_STAT_VER, path, sb) | ^~~~~~~~~ chroot.c:108:19: note: in expansion of macro 'STAT' 108 | if ((status = STAT(path, &sb)) != 0) { | ^~~~ make[2]: *** [Makefile:905: chroot.lo] Error 1 make[2]: Leaving directory '/compile/duep/cross-compile/fakechroot/src' make[1]: *** [Makefile:449: all-recursive] Error 1 make[1]: Leaving directory '/compile/duep/cross-compile/fakechroot' make: *** [Makefile:379: all] Error 2

I search it in google and I I found a issue similar to mine : https://github.com/criblio/appscope/issues/307 https://github.com/search?l=Diff&q=STAT_VER&type=Code https://github.com/criblio/appscope/commit/bbbe4e21cbca67db78f10c96ac747e3959b214c8 It seems to be a bug from glibc. After reading the content in the above link, I think we should avoid using _ STAT VER

Does anyone have any similar problems or suggestions on this problem. Anyway thank you very much

duerpei avatar Sep 09 '22 09:09 duerpei

Fixed by this: https://github.com/dex4er/fakechroot/pull/85/commits/693a3597ea7fccfb62f357503ff177bd3e3d5a89#diff-9c810d4a3b460bbc810ddccbed00e5f631ad4e5c208029149644b354c2597bff

josch avatar Oct 31 '22 18:10 josch

Hi, I have the same problem on the latest Fedora (glibc 2.39):

make[2]: Entering directory '/home/p/Workspaces/c/fakechroot/src'
  CC       chroot.lo
chroot.c:108:19: error: use of undeclared identifier '_STAT_VER'
  108 |     if ((status = STAT(path, &sb)) != 0) {
      |                   ^
chroot.c:38:45: note: expanded from macro 'STAT'
   38 | # define STAT(path, sb) nextcall(__xstat64)(_STAT_VER, path, sb)
      |                                             ^
1 error generated.

pradt2 avatar Jul 04 '24 16:07 pradt2