All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include sys/sysmacros.h for getting major() definition
@ 2016-12-18 19:49 Khem Raj
  2016-12-18 20:11 ` Andrei Borzenkov
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-12-18 19:49 UTC (permalink / raw)
  To: grub-devel; +Cc: Khem Raj

glibc 2.25 has deprecated inclusion of <sys/sysmacros.h> by <sys/types.h>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 grub-core/osdep/linux/getroot.c | 2 +-
 grub-core/osdep/unix/getroot.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 09e7e6e..5923d17 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 #include <sys/stat.h>
-#include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
index 4bf37b0..5aaa086 100644
--- a/grub-core/osdep/unix/getroot.c
+++ b/grub-core/osdep/unix/getroot.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 #include <sys/stat.h>
-#include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <unistd.h>
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 19:49 [PATCH] include sys/sysmacros.h for getting major() definition Khem Raj
@ 2016-12-18 20:11 ` Andrei Borzenkov
  2016-12-18 20:38   ` Khem Raj
  0 siblings, 1 reply; 10+ messages in thread
From: Andrei Borzenkov @ 2016-12-18 20:11 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Khem Raj

18.12.2016 22:49, Khem Raj пишет:
> glibc 2.25 has deprecated inclusion of <sys/sysmacros.h> by <sys/types.h>
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  grub-core/osdep/linux/getroot.c | 2 +-
>  grub-core/osdep/unix/getroot.c  | 2 +-

There are more files using major()

>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
> index 09e7e6e..5923d17 100644
> --- a/grub-core/osdep/linux/getroot.c
> +++ b/grub-core/osdep/linux/getroot.c
> @@ -20,7 +20,7 @@
>  #include <config.h>
>  
>  #include <sys/stat.h>
> -#include <sys/types.h>
> +#include <sys/sysmacros.h>

We already do it:

#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif

If this check fails, please debug why it fails and fix check.

>  #include <assert.h>
>  #include <fcntl.h>
>  #include <unistd.h>
> diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
> index 4bf37b0..5aaa086 100644
> --- a/grub-core/osdep/unix/getroot.c
> +++ b/grub-core/osdep/unix/getroot.c
> @@ -20,7 +20,7 @@
>  #include <config.h>
>  
>  #include <sys/stat.h>
> -#include <sys/types.h>
> +#include <sys/sysmacros.h>
>  #include <assert.h>
>  #include <fcntl.h>
>  #include <unistd.h>
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 20:11 ` Andrei Borzenkov
@ 2016-12-18 20:38   ` Khem Raj
  2016-12-18 20:41     ` Andrei Borzenkov
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-12-18 20:38 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2072 bytes --]

Hi Andrei

> On Dec 18, 2016, at 12:11 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 
> 18.12.2016 22:49, Khem Raj пишет:
>> glibc 2.25 has deprecated inclusion of <sys/sysmacros.h> by <sys/types.h>
>> 
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> grub-core/osdep/linux/getroot.c | 2 +-
>> grub-core/osdep/unix/getroot.c  | 2 +-
> 
> There are more files using major()
> 
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
>> index 09e7e6e..5923d17 100644
>> --- a/grub-core/osdep/linux/getroot.c
>> +++ b/grub-core/osdep/linux/getroot.c
>> @@ -20,7 +20,7 @@
>> #include <config.h>
>> 
>> #include <sys/stat.h>
>> -#include <sys/types.h>
>> +#include <sys/sysmacros.h>
> 
> We already do it:
> 
> #if defined(MAJOR_IN_MKDEV)
> #include <sys/mkdev.h>
> #elif defined(MAJOR_IN_SYSMACROS)
> #include <sys/sysmacros.h>
> #endif
> 
> If this check fails, please debug why it fails and fix check.
> 

Thanks for your review. On further investigation the issue seems to be autoconf related
with commit
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>

grub is using AC_HEADER_MAJOR to find this out, however the check is failing
AC_HEADER_MAJOR is unable to detect that these macros are
now spewing warning messages if sys/sysmacros.h is not included
and this becomes an error with -Werror


>> #include <assert.h>
>> #include <fcntl.h>
>> #include <unistd.h>
>> diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
>> index 4bf37b0..5aaa086 100644
>> --- a/grub-core/osdep/unix/getroot.c
>> +++ b/grub-core/osdep/unix/getroot.c
>> @@ -20,7 +20,7 @@
>> #include <config.h>
>> 
>> #include <sys/stat.h>
>> -#include <sys/types.h>
>> +#include <sys/sysmacros.h>
>> #include <assert.h>
>> #include <fcntl.h>
>> #include <unistd.h>
>> 
> 


[-- Attachment #2: Type: text/html, Size: 3567 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 20:38   ` Khem Raj
@ 2016-12-18 20:41     ` Andrei Borzenkov
  2016-12-18 20:44       ` Khem Raj
  0 siblings, 1 reply; 10+ messages in thread
From: Andrei Borzenkov @ 2016-12-18 20:41 UTC (permalink / raw)
  To: Khem Raj; +Cc: The development of GNU GRUB

18.12.2016 23:38, Khem Raj пишет:
> 
> Thanks for your review. On further investigation the issue seems to be autoconf related
> with commit
> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
> 
> grub is using AC_HEADER_MAJOR to find this out, however the check is failing

Please attach config.log.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 20:41     ` Andrei Borzenkov
@ 2016-12-18 20:44       ` Khem Raj
  2016-12-18 20:57         ` Andrei Borzenkov
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-12-18 20:44 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]


> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 
> 18.12.2016 23:38, Khem Raj пишет:
>> 
>> Thanks for your review. On further investigation the issue seems to be autoconf related
>> with commit
>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>> 
>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
> 
> Please attach config.log.
> 
> 

Its big so instead I pasted it here
http://sprunge.us/DFBP <http://sprunge.us/DFBP>



[-- Attachment #2: Type: text/html, Size: 1539 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 20:44       ` Khem Raj
@ 2016-12-18 20:57         ` Andrei Borzenkov
  2016-12-19  0:12           ` Khem Raj
  0 siblings, 1 reply; 10+ messages in thread
From: Andrei Borzenkov @ 2016-12-18 20:57 UTC (permalink / raw)
  To: Khem Raj; +Cc: The development of GNU GRUB

18.12.2016 23:44, Khem Raj пишет:
> 
>> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
>> 18.12.2016 23:38, Khem Raj пишет:
>>>
>>> Thanks for your review. On further investigation the issue seems to be autoconf related
>>> with commit
>>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>>>
>>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
>>
>> Please attach config.log.
>>
>>

This should be fixed in autoconf commit
e17a30e987d7ee695fb4294a82d987ec3dc9b974 which will be in 2.70. I do not
know what plans there are to release it. Can you test if using current
autoconf GIT fixes this? You will need to rebuild configure using
updated autoconf.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-18 20:57         ` Andrei Borzenkov
@ 2016-12-19  0:12           ` Khem Raj
  2016-12-19 16:39             ` Andrei Borzenkov
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-12-19  0:12 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]


> On Dec 18, 2016, at 12:57 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 
> 18.12.2016 23:44, Khem Raj пишет:
>> 
>>> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>> 
>>> 18.12.2016 23:38, Khem Raj пишет:
>>>> 
>>>> Thanks for your review. On further investigation the issue seems to be autoconf related
>>>> with commit
>>>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>>>> 
>>>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
>>> 
>>> Please attach config.log.
>>> 
>>> 
> 
> This should be fixed in autoconf commit
> e17a30e987d7ee695fb4294a82d987ec3dc9b974 which will be in 2.70. I do not
> know what plans there are to release it. Can you test if using current
> autoconf GIT fixes this? You will need to rebuild configure using
> updated autoconf.

I backported that patch into 2.69 and this fixed the issue. This patch can be dropped since its not needed with 2.70+
and with the above back port for older autoconf.

[-- Attachment #2: Type: text/html, Size: 6617 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-19  0:12           ` Khem Raj
@ 2016-12-19 16:39             ` Andrei Borzenkov
  2016-12-20 20:13               ` Khem Raj
  0 siblings, 1 reply; 10+ messages in thread
From: Andrei Borzenkov @ 2016-12-19 16:39 UTC (permalink / raw)
  To: Khem Raj, floppym; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

19.12.2016 03:12, Khem Raj пишет:
> 
>> On Dec 18, 2016, at 12:57 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
>> 18.12.2016 23:44, Khem Raj пишет:
>>>
>>>> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>>>
>>>> 18.12.2016 23:38, Khem Raj пишет:
>>>>>
>>>>> Thanks for your review. On further investigation the issue seems to be autoconf related
>>>>> with commit
>>>>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>>>>>
>>>>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
>>>>
>>>> Please attach config.log.
>>>>
>>>>
>>
>> This should be fixed in autoconf commit
>> e17a30e987d7ee695fb4294a82d987ec3dc9b974 which will be in 2.70. I do not
>> know what plans there are to release it. Can you test if using current
>> autoconf GIT fixes this? You will need to rebuild configure using
>> updated autoconf.
> 
> I backported that patch into 2.69 and this fixed the issue. This patch can be dropped since its not needed with 2.70+
> and with the above back port for older autoconf.
> 

We cannot really force everyone to use bleeding edge that is not even
released. Could you please test attached patch with plain autoconf 2.69
or below?

[-- Attachment #2: glibc-2.25-header_major.patch --]
[-- Type: text/x-patch, Size: 1529 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: fix check for sys/sysmacros.h under glibc 2.25+

glibc 2.25 still includes sys/sysmacros.h in sys/types.h but also emits
deprecation warning. So test for sys/types.h succeeds in configure but later
compilation fails because we use -Werror by default.

While this is fixed in current autoconf GIT, we really cannot force everyone
to use bleeding edge (that is not even released right now). So run test under
-Werror as well to force proper detection.

This should have no impact on autoconf 2.70+ as AC_HEADER_MAJOR in this version
simply checks for header existence.

Reported and tested by Khem Raj <raj.khem@gmail.com>

---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index dc56564..4e980c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -389,7 +389,14 @@ fi
 # Check for functions and headers.
 AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
+
+# glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation
+# warning which causes compilation failure later with -Werror. So use -Werror here
+# as well to force proper sys/sysmacros.h detection.
+SAVED_CFLAGS="$CFLAGS"
+CFLAGS="$HOST_CFLAGS -Werror"
 AC_HEADER_MAJOR
+CFLAGS="$SAVED_CFLAGS"
 
 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
 #include <sys/param.h>
-- 
tg: (ce95549..) u/glibc-2.25-header_major (depends on: master)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-19 16:39             ` Andrei Borzenkov
@ 2016-12-20 20:13               ` Khem Raj
  2016-12-22 19:49                 ` Andrei Borzenkov
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-12-20 20:13 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: floppym, The development of GNU GRUB


> On Dec 19, 2016, at 8:39 AM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 
> 19.12.2016 03:12, Khem Raj пишет:
>> 
>>> On Dec 18, 2016, at 12:57 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>> 
>>> 18.12.2016 23:44, Khem Raj пишет:
>>>> 
>>>>> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>>>> 
>>>>> 18.12.2016 23:38, Khem Raj пишет:
>>>>>> 
>>>>>> Thanks for your review. On further investigation the issue seems to be autoconf related
>>>>>> with commit
>>>>>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>>>>>> 
>>>>>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
>>>>> 
>>>>> Please attach config.log.
>>>>> 
>>>>> 
>>> 
>>> This should be fixed in autoconf commit
>>> e17a30e987d7ee695fb4294a82d987ec3dc9b974 which will be in 2.70. I do not
>>> know what plans there are to release it. Can you test if using current
>>> autoconf GIT fixes this? You will need to rebuild configure using
>>> updated autoconf.
>> 
>> I backported that patch into 2.69 and this fixed the issue. This patch can be dropped since its not needed with 2.70+
>> and with the above back port for older autoconf.
>> 
> 
> We cannot really force everyone to use bleeding edge that is not even
> released. Could you please test attached patch with plain autoconf 2.69
> or below?
> <glibc-2.25-header_major.patch>

This seemed to work in my environment.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] include sys/sysmacros.h for getting major() definition
  2016-12-20 20:13               ` Khem Raj
@ 2016-12-22 19:49                 ` Andrei Borzenkov
  0 siblings, 0 replies; 10+ messages in thread
From: Andrei Borzenkov @ 2016-12-22 19:49 UTC (permalink / raw)
  To: Khem Raj; +Cc: floppym, The development of GNU GRUB

20.12.2016 23:13, Khem Raj пишет:
> 
>> On Dec 19, 2016, at 8:39 AM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
>> 19.12.2016 03:12, Khem Raj пишет:
>>>
>>>> On Dec 18, 2016, at 12:57 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>>>
>>>> 18.12.2016 23:44, Khem Raj пишет:
>>>>>
>>>>>> On Dec 18, 2016, at 12:41 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>>>>>
>>>>>> 18.12.2016 23:38, Khem Raj пишет:
>>>>>>>
>>>>>>> Thanks for your review. On further investigation the issue seems to be autoconf related
>>>>>>> with commit
>>>>>>> http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c <http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7a5b301e3adb8e054288518a325135a1883c1c6c>
>>>>>>>
>>>>>>> grub is using AC_HEADER_MAJOR to find this out, however the check is failing
>>>>>>
>>>>>> Please attach config.log.
>>>>>>
>>>>>>
>>>>
>>>> This should be fixed in autoconf commit
>>>> e17a30e987d7ee695fb4294a82d987ec3dc9b974 which will be in 2.70. I do not
>>>> know what plans there are to release it. Can you test if using current
>>>> autoconf GIT fixes this? You will need to rebuild configure using
>>>> updated autoconf.
>>>
>>> I backported that patch into 2.69 and this fixed the issue. This patch can be dropped since its not needed with 2.70+
>>> and with the above back port for older autoconf.
>>>
>>
>> We cannot really force everyone to use bleeding edge that is not even
>> released. Could you please test attached patch with plain autoconf 2.69
>> or below?
>> <glibc-2.25-header_major.patch>
> 
> This seemed to work in my environment.
> 

Committed. Thanks!


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-12-22 19:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-18 19:49 [PATCH] include sys/sysmacros.h for getting major() definition Khem Raj
2016-12-18 20:11 ` Andrei Borzenkov
2016-12-18 20:38   ` Khem Raj
2016-12-18 20:41     ` Andrei Borzenkov
2016-12-18 20:44       ` Khem Raj
2016-12-18 20:57         ` Andrei Borzenkov
2016-12-19  0:12           ` Khem Raj
2016-12-19 16:39             ` Andrei Borzenkov
2016-12-20 20:13               ` Khem Raj
2016-12-22 19:49                 ` Andrei Borzenkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.