Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XrdPosix fails to compile with glibc 2.33 (2.32.9000) #1315

Closed
ellert opened this issue Oct 26, 2020 · 7 comments
Closed

XrdPosix fails to compile with glibc 2.33 (2.32.9000) #1315

ellert opened this issue Oct 26, 2020 · 7 comments

Comments

@ellert
Copy link
Contributor

ellert commented Oct 26, 2020

/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Fstat(int, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:379:27: error: '_STAT_VER' was not declared in this scope
  379 |           : Xunix.Fstat64(_STAT_VER, fildes, (struct stat64 *)buf));
      |                           ^~~~~~~~~
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Lstat(const char*, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:563:27: error: '_STAT_VER' was not declared in this scope
  563 |           ? Xunix.Lstat64(_STAT_VER, path, (struct stat64 *)buf)
      |                           ^~~~~~~~~
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Stat(const char*, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:891:26: error: '_STAT_VER' was not declared in this scope
  891 |           ? Xunix.Stat64(_STAT_VER, path, (struct stat64 *)buf)
      |                          ^~~~~~~~~

In glibc 2.32 and earlier _STAT_VER is defined in /usr/include/sys/stat.h (which includes /usr/include/bits/stat.h). However, in glibc 2.33 this define is dropped. The headers no longer redirects the calls to the kernel functions, but there are implementations in glibc.

I do not know how to fix this, is it sufficient to do

#ifndef _STAT_VER
#define _STAT_VER <some value> /* What value? */
#endif

Or does it need morc complicates changes?

@xrootd-dev
Copy link

xrootd-dev commented Oct 26, 2020 via email

@ellert
Copy link
Contributor Author

ellert commented Oct 27, 2020

The compilation started failing on Fedora 34/Fedora Rawhide. Fedora 34 is scheduled for 2021-04-20.
https://koschei.fedoraproject.org/package/xrootd?collection=f34

It can be reproduced using a Fedora Rawhide mockbuild:
mock --root fedora-rawhide-x86_64 xrootd-5.0.2-1.fc33.src.rpm

@abh3
Copy link
Member

abh3 commented Oct 27, 2020

Ah, those are hard to come by. Anyway I can login to a Fedora 34 machine?

@ellert
Copy link
Contributor Author

ellert commented Oct 29, 2020

You don't need a Fedora 34 machine to build for Fedora 34. A mock chroot environment is sufficient.

@simonmichal
Copy link
Contributor

This is fixed in 5298c73

@ellert
Copy link
Contributor Author

ellert commented Nov 3, 2020

I applied the commit as a patch for the Fedora Rawhide build and it builds again.
https://src.fedoraproject.org/rpms/xrootd/c/369a165341d142ceff52dc1324fe15735246ead8?branch=master
https://koschei.fedoraproject.org/package/xrootd?collection=f34

Candidate commit for stable?

@simonmichal
Copy link
Contributor

@ellert : thanks a lot! we will have 5.1.0 soonish and it will be definitely included.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Mar 2, 2021
https://build.opensuse.org/request/show/876080
by user badshah400 + RBrownSUSE
- Update to version 4.12.7.
- Add xrootd-build-with-glibc2.33.patch: Fix build with glibc 2.33; patch taken from upstream commit [gh#xrootd/xrootd#1315].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants