{"action":"created","issue":{"url":"https://api.github.com/repos/sahlberg/libnfs/issues/202","repository_url":"https://api.github.com/repos/sahlberg/libnfs","labels_url":"https://api.github.com/repos/sahlberg/libnfs/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/sahlberg/libnfs/issues/202/comments","events_url":"https://api.github.com/repos/sahlberg/libnfs/issues/202/events","html_url":"https://github.com/sahlberg/libnfs/issues/202","id":227328026,"number":202,"title":"FYI: glibc 2.25 - inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated","user":{"login":"MilhouseVH","id":805038,"avatar_url":"https://avatars3.githubusercontent.com/u/805038?v=3","gravatar_id":"","url":"https://api.github.com/users/MilhouseVH","html_url":"https://github.com/MilhouseVH","followers_url":"https://api.github.com/users/MilhouseVH/followers","following_url":"https://api.github.com/users/MilhouseVH/following{/other_user}","gists_url":"https://api.github.com/users/MilhouseVH/gists{/gist_id}","starred_url":"https://api.github.com/users/MilhouseVH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MilhouseVH/subscriptions","organizations_url":"https://api.github.com/users/MilhouseVH/orgs","repos_url":"https://api.github.com/users/MilhouseVH/repos","events_url":"https://api.github.com/users/MilhouseVH/events{/privacy}","received_events_url":"https://api.github.com/users/MilhouseVH/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-09T11:00:38Z","updated_at":"2017-05-09T23:21:35Z","closed_at":"2017-05-09T21:31:19Z","body":"glibc 2.25 changelog: https://sourceware.org/ml/libc-alpha/2017-02/msg00079.html\r\n\r\n```\r\n* The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated.\r\n  This means that in a future release, the macros “major”, “minor”, and\r\n  “makedev” will only be available from <sys/sysmacros.h>.\r\n\r\n  These macros are not part of POSIX nor XSI, and their names frequently\r\n  collide with user code; see for instance glibc bug 19239 and Red Hat\r\n  bug 130601.  <stdlib.h> includes <sys/types.h> under _GNU_SOURCE, and\r\n  C++ code presently cannot avoid being compiled under _GNU_SOURCE,\r\n  exacerbating the problem.\r\n```\r\nThis leads to the following build failure when building against glibc-2.25:\r\n```\r\n/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.0-devel/libnfs-1.11.0/lib/libnfs.c: In function 'specdata3_to_rdev':\r\n/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.0-devel/libnfs-1.11.0/lib/libnfs.c:1765:13: error: In the GNU C Library, \"makedev\" is defined\r\n by <sys/sysmacros.h>. For historical compatibility, it is\r\n currently defined by <sys/types.h> as well, but we plan to\r\n remove this soon. To use \"makedev\", include <sys/sysmacros.h>\r\n directly. If you did not intend to use a system-defined macro\r\n \"makedev\", you should undefine it after including <sys/types.h>. [-Werror]\r\n  return makedev(rdev->specdata1, rdev->specdata2);\r\n             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                  \r\n/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.0-devel/libnfs-1.11.0/lib/libnfs.c: In function 'nfs_mknod_async':\r\n/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.0-devel/libnfs-1.11.0/lib/libnfs.c:3675:13: error: In the GNU C Library, \"major\" is defined\r\n by <sys/sysmacros.h>. For historical compatibility, it is\r\n currently defined by <sys/types.h> as well, but we plan to\r\n remove this soon. To use \"major\", include <sys/sysmacros.h>\r\n directly. If you did not intend to use a system-defined macro\r\n \"major\", you should undefine it after including <sys/types.h>. [-Werror]\r\n  cb_data->major = major(dev);\r\n             ^~~~~~~~~~~~~~~~~                                                                                                                                                                                       \r\n/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.0-devel/libnfs-1.11.0/lib/libnfs.c:3676:13: error: In the GNU C Library, \"minor\" is defined\r\n by <sys/sysmacros.h>. For historical compatibility, it is\r\n currently defined by <sys/types.h> as well, but we plan to\r\n remove this soon. To use \"minor\", include <sys/sysmacros.h>\r\n directly. If you did not intend to use a system-defined macro\r\n \"minor\", you should undefine it after including <sys/types.h>. [-Werror]\r\n  cb_data->minor = minor(dev);\r\n             ^~~~~~~~~~~~~~~~~                                                                                                                                                                                       \r\n```\r\nSince LibreELEC doesn't care about building with older version of glibc this [hack](https://github.com/MilhouseVH/LibreELEC.tv/blob/b0d702ee21d43f342b5db56c5da09d9ed290512b/packages/network/libnfs/patches/libnfs-glibc-2.25.patch) works and allows libnfs to build with glibc-2.25, however I'm sure you can think of something far more elegant and able to support all versions of glibc... :)"},"comment":{"url":"https://api.github.com/repos/sahlberg/libnfs/issues/comments/300329186","html_url":"https://github.com/sahlberg/libnfs/issues/202#issuecomment-300329186","issue_url":"https://api.github.com/repos/sahlberg/libnfs/issues/202","id":300329186,"user":{"login":"MilhouseVH","id":805038,"avatar_url":"https://avatars3.githubusercontent.com/u/805038?v=3","gravatar_id":"","url":"https://api.github.com/users/MilhouseVH","html_url":"https://github.com/MilhouseVH","followers_url":"https://api.github.com/users/MilhouseVH/followers","following_url":"https://api.github.com/users/MilhouseVH/following{/other_user}","gists_url":"https://api.github.com/users/MilhouseVH/gists{/gist_id}","starred_url":"https://api.github.com/users/MilhouseVH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MilhouseVH/subscriptions","organizations_url":"https://api.github.com/users/MilhouseVH/orgs","repos_url":"https://api.github.com/users/MilhouseVH/repos","events_url":"https://api.github.com/users/MilhouseVH/events{/privacy}","received_events_url":"https://api.github.com/users/MilhouseVH/received_events","type":"User","site_admin":false},"created_at":"2017-05-09T23:21:35Z","updated_at":"2017-05-09T23:21:35Z","body":"Tested https://github.com/sahlberg/libnfs/commit/5b28ab5d535e0252c05640eef6e280581278dc36 with both glibc-2.24 and glibc-2.25, no more build issues - many thanks!"}}
{"actor":{"display_login":"MilhouseVH"}}