Bug 15132 - Samba fails to build with glibc 2.36 caused by including <sys/mount.h> in libreplace
Summary: Samba fails to build with glibc 2.36 caused by including <sys/mount.h> in lib...
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.16.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
Depends on:
Reported: 2022-07-29 08:13 UTC by Andreas Schneider
Modified: 2022-09-28 15:42 UTC (History)
3 users (show)

See Also:

patch for 4.16 and 4.15 (1.68 KB, patch)
2022-08-02 11:56 UTC, Andreas Schneider
slow: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2022-07-29 08:13:11 UTC
You need to be careful if you include <sys/mount.h> or <linux/mount.h> at least since glibc 2.36.
Details at:

Patch will follow, need bug number.
Comment 1 Andreas Schneider 2022-07-29 08:14:47 UTC
In file included from /usr/include/linux/fs.h:19,
                 from /usr/include/xfs/linux.h:36,
                 from /usr/include/xfs/xfs.h:9,
                 from /usr/include/xfs/xqm.h:9,
                 from ../../source3/lib/sysquotas_xfs.c:36:
/usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
   95 | enum fsconfig_command {
      |      ^~~~~~~~~~~~~~~~
In file included from ../../lib/replace/system/filesys.h:40,
                 from ../../libcli/smb/smb_util.h:23,
                 from ../../libcli/smb/smb_common.h:31,
                 from ../../source3/include/smb.h:29,
                 from ../../source3/include/includes.h:275,
                 from ../../source3/lib/sysquotas_xfs.c:21:
/usr/include/sys/mount.h:189:6: note: originally defined here
Comment 2 Samba QA Contact 2022-07-29 13:09:03 UTC
This bug was referenced in samba master:

Comment 3 Björn Jacke 2022-07-29 21:41:21 UTC
Did you make sure that sys/mount.h isn't required for and the include removal does not break the other non-Linux systems like *BSD, AIX vor Solaris?
Comment 4 Andreas Schneider 2022-07-30 17:25:08 UTC
I didn't as I don't have those systems available. I also do not see them in bootstrap that you could run them e.g. easily with VirtualBox ...

Also I already provide a FreeBSD runner for https://gitlab.com/cwrap

You have Azure credits with your MSDN account, install a FreeBSD runner and we can test regularly ...
Comment 5 Ralph Böhme 2022-08-01 14:23:23 UTC
(In reply to Andreas Schneider from comment #4)
This change breaks the build on FreeBSD.
Comment 6 Björn Jacke 2022-08-01 18:34:35 UTC
(In reply to Andreas Schneider from comment #4)
if you make a change like *this* you should at least request reviews from people who are able to test on other OSes, which are obviously in danger to be broken by your change. Just requesting a review from a colleague, who also just runs Linux is not a good idea then.
Comment 7 Andrew Bartlett 2022-08-01 21:57:12 UTC
This isn't really the place to discuss this, but I need to make clear that there is much more involved than 'just' offering a gitlab runner.  For security, they need to be on a VM that is destroyed after each run for example.

Portability-relevant changes really do need to be manually tested at this time.
Comment 8 Andrew Bartlett 2022-08-01 22:03:22 UTC
We might get somewhere via efforts like https://chimera-linux.org/ (but this is on musl libc, not FreeBSD libc) or a full FreeBSD in qemu or such.
Comment 9 Samba QA Contact 2022-08-02 11:06:03 UTC
This bug was referenced in samba master:

Comment 10 Andreas Schneider 2022-08-02 11:56:05 UTC
Created attachment 17454 [details]
patch for 4.16 and 4.15
Comment 11 Samba QA Contact 2022-08-08 14:32:24 UTC
This bug was referenced in samba v4-17-test:

Comment 12 Samba QA Contact 2022-08-08 14:36:36 UTC
This bug was referenced in samba v4-17-stable (Release samba-4.17.0rc1):

Comment 13 Ralph Böhme 2022-08-22 07:47:58 UTC
Reassigning to Jule for inclusion in 4.16 and 4.15.
Comment 14 Jule Anger 2022-08-23 06:00:30 UTC
Pushed to autobuild-v4-{16,15}-test.
Comment 15 Samba QA Contact 2022-08-23 07:35:10 UTC
This bug was referenced in samba v4-15-test:

Comment 16 Samba QA Contact 2022-08-23 08:54:11 UTC
This bug was referenced in samba v4-16-test:

Comment 17 Jule Anger 2022-08-23 09:31:52 UTC
Closing out bug report.

Comment 18 Samba QA Contact 2022-09-07 19:02:34 UTC
This bug was referenced in samba v4-16-stable (Release samba-4.16.5):

Comment 19 Samba QA Contact 2022-09-28 15:42:04 UTC
This bug was referenced in samba v4-15-stable (Release samba-4.15.10):