Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
@ 2016-11-09  7:39 Max Filippov
  2016-11-09  8:03 ` Baruch Siach
  2016-11-16 12:12 ` Thomas Petazzoni
  0 siblings, 2 replies; 10+ messages in thread
From: Max Filippov @ 2016-11-09  7:39 UTC (permalink / raw)
  To: buildroot

RHEL 5.x does have magic.h, but it does not define all expected symbols. In
particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
is using 4.17.

Add substitute defines to allow continued usage of magic but without the
requested exclude checks.

Backported from: b003b2e6f9e54e7b2bde15828b97f5dc285b915e

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 ...fix-compilation-on-RHEL-5.x-due-to-missin.patch | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/e2fsprogs/0003-libsupport-fix-compilation-on-RHEL-5.x-due-to-missin.patch

diff --git a/package/e2fsprogs/0003-libsupport-fix-compilation-on-RHEL-5.x-due-to-missin.patch b/package/e2fsprogs/0003-libsupport-fix-compilation-on-RHEL-5.x-due-to-missin.patch
new file mode 100644
index 0000000..3569a3a
--- /dev/null
+++ b/package/e2fsprogs/0003-libsupport-fix-compilation-on-RHEL-5.x-due-to-missin.patch
@@ -0,0 +1,45 @@
+From b003b2e6f9e54e7b2bde15828b97f5dc285b915e Mon Sep 17 00:00:00 2001
+From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
+Date: Tue, 25 Oct 2016 13:22:39 -0400
+Subject: [PATCH] libsupport: fix compilation on RHEL 5.x due to missing magic
+ define
+
+RHEL 5.x does have magic.h, but it does not define all expected symbols. In
+particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
+is using 4.17.
+
+Add substitute defines to allow continued usage of magic but without the
+requested exclude checks.
+
+Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ lib/support/plausible.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/lib/support/plausible.c b/lib/support/plausible.c
+index 6f0c4bc..0636061 100644
+--- a/lib/support/plausible.c
++++ b/lib/support/plausible.c
+@@ -43,6 +43,17 @@ static const char *(*dl_magic_file)(magic_t, const char *);
+ static int (*dl_magic_load)(magic_t, const char *);
+ static void (*dl_magic_close)(magic_t);
+ 
++/*
++ * NO_CHECK functionality was only added in file 4.20.
++ * Older systems like RHEL 5.x still have file 4.17
++ */
++#ifndef MAGIC_NO_CHECK_COMPRESS
++#define MAGIC_NO_CHECK_COMPRESS 0x0001000
++#endif
++#ifndef MAGIC_NO_CHECK_ELF
++#define MAGIC_NO_CHECK_ELF 0x0010000
++#endif
++
+ #ifdef HAVE_DLOPEN
+ #include <dlfcn.h>
+ 
+-- 
+2.1.4
+
-- 
2.1.4

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-09  7:39 [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic Max Filippov
@ 2016-11-09  8:03 ` Baruch Siach
  2016-11-09  8:18   ` Max Filippov
  2016-11-16 12:12 ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2016-11-09  8:03 UTC (permalink / raw)
  To: buildroot

Hi Max,

On Tue, Nov 08, 2016 at 11:39:02PM -0800, Max Filippov wrote:
> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> is using 4.17.

Instead of relying on host libmagic that may or may not be installed, why not 
add host-file to HOST_E2FSPROGS_DEPENDENCIES?

> Add substitute defines to allow continued usage of magic but without the
> requested exclude checks.
> 
> Backported from: b003b2e6f9e54e7b2bde15828b97f5dc285b915e

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-09  8:03 ` Baruch Siach
@ 2016-11-09  8:18   ` Max Filippov
  2016-11-09  8:24     ` Baruch Siach
  0 siblings, 1 reply; 10+ messages in thread
From: Max Filippov @ 2016-11-09  8:18 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

On Wed, Nov 9, 2016 at 12:03 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> On Tue, Nov 08, 2016 at 11:39:02PM -0800, Max Filippov wrote:
>> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
>> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
>> is using 4.17.
>
> Instead of relying on host libmagic that may or may not be installed, why not
> add host-file to HOST_E2FSPROGS_DEPENDENCIES?

My first reaction was to look if the issue is addressed in the package mainline,
and that's how e2fsprogs mainline decided to deal with that. So the next
version bump of e2fsprogs will make host-libmagic not necessary, there's
probably no reason to introduce that dependency?

"libmagic installed" vs. "not installed" is handled well by e2fsprogs, it's
"installed, but too old" case that fails.

-- 
Thanks.
-- Max

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-09  8:18   ` Max Filippov
@ 2016-11-09  8:24     ` Baruch Siach
  2016-11-09 10:37       ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2016-11-09  8:24 UTC (permalink / raw)
  To: buildroot

Hi Max,

On Wed, Nov 09, 2016 at 12:18:07AM -0800, Max Filippov wrote:
> On Wed, Nov 9, 2016 at 12:03 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> > On Tue, Nov 08, 2016 at 11:39:02PM -0800, Max Filippov wrote:
> >> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> >> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> >> is using 4.17.
> >
> > Instead of relying on host libmagic that may or may not be installed, why not
> > add host-file to HOST_E2FSPROGS_DEPENDENCIES?
> 
> My first reaction was to look if the issue is addressed in the package mainline,
> and that's how e2fsprogs mainline decided to deal with that. So the next
> version bump of e2fsprogs will make host-libmagic not necessary, there's
> probably no reason to introduce that dependency?
> 
> "libmagic installed" vs. "not installed" is handled well by e2fsprogs, it's
> "installed, but too old" case that fails.

We would generally like to avoid dependency on host libraries as much as 
possible since it reduces the build reproducibility. But as this is just a 
host tool I'm not sure we care.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-09  8:24     ` Baruch Siach
@ 2016-11-09 10:37       ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-11-09 10:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 9 Nov 2016 10:24:35 +0200, Baruch Siach wrote:

> On Wed, Nov 09, 2016 at 12:18:07AM -0800, Max Filippov wrote:
> > On Wed, Nov 9, 2016 at 12:03 AM, Baruch Siach <baruch@tkos.co.il> wrote:  
> > > On Tue, Nov 08, 2016 at 11:39:02PM -0800, Max Filippov wrote:  
> > >> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> > >> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> > >> is using 4.17.  
> > >
> > > Instead of relying on host libmagic that may or may not be installed, why not
> > > add host-file to HOST_E2FSPROGS_DEPENDENCIES?  
> > 
> > My first reaction was to look if the issue is addressed in the package mainline,
> > and that's how e2fsprogs mainline decided to deal with that. So the next
> > version bump of e2fsprogs will make host-libmagic not necessary, there's
> > probably no reason to introduce that dependency?
> > 
> > "libmagic installed" vs. "not installed" is handled well by e2fsprogs, it's
> > "installed, but too old" case that fails.  
> 
> We would generally like to avoid dependency on host libraries as much as 
> possible since it reduces the build reproducibility. But as this is just a 
> host tool I'm not sure we care.

We do care.

So in this case, it would be better (if possible) to completely disable
the use of libmagic by host-e2fsprogs. This way, the behavior is
consistent on both machines that have libmagic installed and those who
don't.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-09  7:39 [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic Max Filippov
  2016-11-09  8:03 ` Baruch Siach
@ 2016-11-16 12:12 ` Thomas Petazzoni
  2016-11-16 14:00   ` Baruch Siach
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2016-11-16 12:12 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  8 Nov 2016 23:39:02 -0800, Max Filippov wrote:
> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> is using 4.17.
> 
> Add substitute defines to allow continued usage of magic but without the
> requested exclude checks.
> 
> Backported from: b003b2e6f9e54e7b2bde15828b97f5dc285b915e
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Can you try:

E2FSPROGS_CONF_ENV += \
	ac_cv_header_magic_h=no \
  	ac_cv_lib_magic_magic_file=no

instead of this patch?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-16 12:12 ` Thomas Petazzoni
@ 2016-11-16 14:00   ` Baruch Siach
  2016-11-16 14:22     ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2016-11-16 14:00 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Nov 16, 2016 at 01:12:31PM +0100, Thomas Petazzoni wrote:
> On Tue,  8 Nov 2016 23:39:02 -0800, Max Filippov wrote:
> > RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> > particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> > is using 4.17.
> > 
> > Add substitute defines to allow continued usage of magic but without the
> > requested exclude checks.
> > 
> > Backported from: b003b2e6f9e54e7b2bde15828b97f5dc285b915e
> > 
> > Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> 
> Can you try:
> 
> E2FSPROGS_CONF_ENV += \
> 	ac_cv_header_magic_h=no \
>   	ac_cv_lib_magic_magic_file=no
> 
> instead of this patch?

Do you mean HOST_E2FSPROGS_CONF_ENV?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-16 14:00   ` Baruch Siach
@ 2016-11-16 14:22     ` Thomas Petazzoni
  2016-11-16 19:14       ` Max Filippov
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2016-11-16 14:22 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 16 Nov 2016 16:00:15 +0200, Baruch Siach wrote:

> > E2FSPROGS_CONF_ENV += \
> > 	ac_cv_header_magic_h=no \
> >   	ac_cv_lib_magic_magic_file=no
> > 
> > instead of this patch?  
> 
> Do you mean HOST_E2FSPROGS_CONF_ENV?

Yes, indeed, it's for the host variant of the package.

Thanks for correcting me on this,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-16 14:22     ` Thomas Petazzoni
@ 2016-11-16 19:14       ` Max Filippov
  2016-11-16 22:30         ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Max Filippov @ 2016-11-16 19:14 UTC (permalink / raw)
  To: buildroot

On Wed, Nov 16, 2016 at 6:22 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> On Wed, 16 Nov 2016 16:00:15 +0200, Baruch Siach wrote:
>
>> > E2FSPROGS_CONF_ENV += \
>> >     ac_cv_header_magic_h=no \
>> >     ac_cv_lib_magic_magic_file=no
>> >
>> > instead of this patch?
>>
>> Do you mean HOST_E2FSPROGS_CONF_ENV?
>
> Yes, indeed, it's for the host variant of the package.
>
> Thanks for correcting me on this,

Works for me, thank you.

-- 
Thanks.
-- Max

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

* [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic
  2016-11-16 19:14       ` Max Filippov
@ 2016-11-16 22:30         ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-11-16 22:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 16 Nov 2016 11:14:34 -0800, Max Filippov wrote:

> >> > E2FSPROGS_CONF_ENV += \
> >> >     ac_cv_header_magic_h=no \
> >> >     ac_cv_lib_magic_magic_file=no
> >> >
> >> > instead of this patch?  
> >>
> >> Do you mean HOST_E2FSPROGS_CONF_ENV?  
> >
> > Yes, indeed, it's for the host variant of the package.
> >
> > Thanks for correcting me on this,  
> 
> Works for me, thank you.

Great, could you send a proper patch that implements this solution then?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-11-16 22:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09  7:39 [Buildroot] [PATCH] package/e2fsprogs: backport build fix for rhel5 due to missing magic Max Filippov
2016-11-09  8:03 ` Baruch Siach
2016-11-09  8:18   ` Max Filippov
2016-11-09  8:24     ` Baruch Siach
2016-11-09 10:37       ` Thomas Petazzoni
2016-11-16 12:12 ` Thomas Petazzoni
2016-11-16 14:00   ` Baruch Siach
2016-11-16 14:22     ` Thomas Petazzoni
2016-11-16 19:14       ` Max Filippov
2016-11-16 22:30         ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox