Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
@ 2012-08-21 16:20 Matthew McClintock
  2012-08-21 17:54 ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: Matthew McClintock @ 2012-08-21 16:20 UTC (permalink / raw)
  To: openembedded-core

kmod will fail to build with the following error because O_CLOEXEC is
not defined:

| libkmod/libkmod-module.c: In function 'kmod_module_get_initstate':
| libkmod/libkmod-module.c:1640: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-module.c:1640: error: (Each undeclared identifier is reported only once
| libkmod/libkmod-module.c:1640: error: for each function it appears in.)
| libkmod/libkmod-module.c: In function 'kmod_module_get_refcnt':
| libkmod/libkmod-module.c:1754: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-module.c: In function 'kmod_module_get_sections':
| libkmod/libkmod-module.c:1913: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-file.c: In function 'kmod_file_open':
| libkmod/libkmod-file.c:282: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-file.c:282: error: (Each undeclared identifier is reported only once
| libkmod/libkmod-file.c:282: error: for each function it appears in.)

Since we are only using kmod-native for depmod, and it's a non-threaded
user of this libary being built this should be safe to override O_CLOEXEC.

Keep in mind this is ONLY effecting the native builds and not what is
being shipped in the root file system.

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
 meta/recipes-kernel/kmod/kmod-native_git.bb |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
index 96de8b8..4558c7b 100644
--- a/meta/recipes-kernel/kmod/kmod-native_git.bb
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -4,7 +4,7 @@
 require kmod.inc
 inherit native
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 do_install_append (){
 	for tool in depmod insmod lsmod modinfo modprobe rmmod
@@ -12,3 +12,9 @@ do_install_append (){
 		ln -s kmod ${D}${bindir}/$tool
 	done
 }
+
+do_configure_prepend (){
+	if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
+		export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
+	fi
+}
-- 
1.7.9.7





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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 16:20 [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc Matthew McClintock
@ 2012-08-21 17:54 ` Khem Raj
  2012-08-21 17:59   ` McClintock Matthew-B29882
  0 siblings, 1 reply; 16+ messages in thread
From: Khem Raj @ 2012-08-21 17:54 UTC (permalink / raw)
  To: Matthew McClintock; +Cc: openembedded-core

On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
> +
> +do_configure_prepend (){
> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
> +       fi
> +}


IMO It would be safer to create a patch for kmod itself where you
define O_CLOEXEC if it
was not defined before. The above seems a bit risky



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 17:54 ` Khem Raj
@ 2012-08-21 17:59   ` McClintock Matthew-B29882
  2012-08-21 18:06     ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 17:59 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>> +
>> +do_configure_prepend (){
>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>> +       fi
>> +}
>
>
> IMO It would be safer to create a patch for kmod itself where you
> define O_CLOEXEC if it
> was not defined before. The above seems a bit risky

Why is it risky? I only wanted to do this for affected systems. There
is not an easy way to do this with a patch, unless of course I apply
the patch manually.

-M



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 17:59   ` McClintock Matthew-B29882
@ 2012-08-21 18:06     ` Khem Raj
  2012-08-21 18:10       ` McClintock Matthew-B29882
  0 siblings, 1 reply; 16+ messages in thread
From: Khem Raj @ 2012-08-21 18:06 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>>> +
>>> +do_configure_prepend (){
>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>> +       fi
>>> +}
>>
>>
>> IMO It would be safer to create a patch for kmod itself where you
>> define O_CLOEXEC if it
>> was not defined before. The above seems a bit risky
>
> Why is it risky? I only wanted to do this for affected systems. There
> is not an easy way to do this with a patch, unless of course I apply
> the patch manually.

manually gripping at the host installation and then if O_CLOEXEC might
be in comments
and furthermore it if it comes from fcntl.h which is not where you are
looking for
there are few variables like that where its impacting more than
affected systems.


>
> -M



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:06     ` Khem Raj
@ 2012-08-21 18:10       ` McClintock Matthew-B29882
  2012-08-21 18:30         ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 18:10 UTC (permalink / raw)
  To: Khem Raj
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
> <B29882@freescale.com> wrote:
>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>>>> +
>>>> +do_configure_prepend (){
>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>> +       fi
>>>> +}
>>>
>>>
>>> IMO It would be safer to create a patch for kmod itself where you
>>> define O_CLOEXEC if it
>>> was not defined before. The above seems a bit risky
>>
>> Why is it risky? I only wanted to do this for affected systems. There
>> is not an easy way to do this with a patch, unless of course I apply
>> the patch manually.
>
> manually gripping at the host installation and then if O_CLOEXEC might
> be in comments

How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h

> and furthermore it if it comes from fcntl.h which is not where you are
> looking for

I am grepping this file though?

> there are few variables like that where its impacting more than
> affected systems.

I don't follow...

-M



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:10       ` McClintock Matthew-B29882
@ 2012-08-21 18:30         ` Khem Raj
  2012-08-21 18:41           ` Saul Wold
  2012-08-21 18:47           ` McClintock Matthew-B29882
  0 siblings, 2 replies; 16+ messages in thread
From: Khem Raj @ 2012-08-21 18:30 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>> <B29882@freescale.com> wrote:
>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>>>>> +
>>>>> +do_configure_prepend (){
>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>> +       fi
>>>>> +}
>>>>
>>>>
>>>> IMO It would be safer to create a patch for kmod itself where you
>>>> define O_CLOEXEC if it
>>>> was not defined before. The above seems a bit risky
>>>
>>> Why is it risky? I only wanted to do this for affected systems. There
>>> is not an easy way to do this with a patch, unless of course I apply
>>> the patch manually.
>>
>> manually gripping at the host installation and then if O_CLOEXEC might
>> be in comments
>
> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>
>> and furthermore it if it comes from fcntl.h which is not where you are
>> looking for
>
> I am grepping this file though?

I would go into the specific file where its asking for O_CLOEXEC

and add

#ifndef O_CLOEXEC
# define O_CLOEXEC 0
#endif

and be done with it

>
>> there are few variables like that where its impacting more than
>> affected systems.
>
> I don't follow...
>
> -M



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:30         ` Khem Raj
@ 2012-08-21 18:41           ` Saul Wold
  2012-08-21 18:46             ` McClintock Matthew-B29882
  2012-08-21 18:48             ` Khem Raj
  2012-08-21 18:47           ` McClintock Matthew-B29882
  1 sibling, 2 replies; 16+ messages in thread
From: Saul Wold @ 2012-08-21 18:41 UTC (permalink / raw)
  To: Khem Raj
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On 08/21/2012 11:30 AM, Khem Raj wrote:
> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
> <B29882@freescale.com> wrote:
>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>> <B29882@freescale.com> wrote:
>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>>>>>> +
>>>>>> +do_configure_prepend (){
>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>> +       fi
>>>>>> +}
>>>>>
>>>>>
>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>> define O_CLOEXEC if it
>>>>> was not defined before. The above seems a bit risky
>>>>
>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>> is not an easy way to do this with a patch, unless of course I apply
>>>> the patch manually.
>>>
>>> manually gripping at the host installation and then if O_CLOEXEC might
>>> be in comments
>>
>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>
>>> and furthermore it if it comes from fcntl.h which is not where you are
>>> looking for
>>
>> I am grepping this file though?
>
> I would go into the specific file where its asking for O_CLOEXEC
>
> and add
>
> #ifndef O_CLOEXEC
> # define O_CLOEXEC 0
> #endif
>
> and be done with it
>
Wasn't this proposed back a month ago:

http://lists.linuxtogo.org/pipermail/openembedded-core/2012-July/026343.html

And there was discussion about that approach then? I think it was 
rejected due to lack of testing.

Sau!

>>
>>> there are few variables like that where its impacting more than
>>> affected systems.
>>
>> I don't follow...
>>
>> -M
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:41           ` Saul Wold
@ 2012-08-21 18:46             ` McClintock Matthew-B29882
  2012-08-21 18:48             ` Khem Raj
  1 sibling, 0 replies; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 18:46 UTC (permalink / raw)
  To: Saul Wold
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 1:41 PM, Saul Wold <sgw@linux.intel.com> wrote:
> On 08/21/2012 11:30 AM, Khem Raj wrote:
>>
>> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
>> <B29882@freescale.com> wrote:
>>>
>>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>
>>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>>> <B29882@freescale.com> wrote:
>>>>>
>>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>
>>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock
>>>>>> <msm@freescale.com> wrote:
>>>>>>>
>>>>>>> +
>>>>>>> +do_configure_prepend (){
>>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h;
>>>>>>> then
>>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>>> +       fi
>>>>>>> +}
>>>>>>
>>>>>>
>>>>>>
>>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>>> define O_CLOEXEC if it
>>>>>> was not defined before. The above seems a bit risky
>>>>>
>>>>>
>>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>>> is not an easy way to do this with a patch, unless of course I apply
>>>>> the patch manually.
>>>>
>>>>
>>>> manually gripping at the host installation and then if O_CLOEXEC might
>>>> be in comments
>>>
>>>
>>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>>
>>>> and furthermore it if it comes from fcntl.h which is not where you are
>>>> looking for
>>>
>>>
>>> I am grepping this file though?
>>
>>
>> I would go into the specific file where its asking for O_CLOEXEC
>>
>> and add
>>
>> #ifndef O_CLOEXEC
>> # define O_CLOEXEC 0
>> #endif
>>
>> and be done with it
>>
> Wasn't this proposed back a month ago:
>
> http://lists.linuxtogo.org/pipermail/openembedded-core/2012-July/026343.html
>
> And there was discussion about that approach then? I think it was rejected
> due to lack of testing.

Then we had a bit more analysis and discussion on the issue and others
chimed in they had implemented similar work arounds... it's all in
that thread.

-M

>
>
>>>
>>>> there are few variables like that where its impacting more than
>>>> affected systems.
>>>
>>>
>>> I don't follow...
>>>
>>> -M
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:30         ` Khem Raj
  2012-08-21 18:41           ` Saul Wold
@ 2012-08-21 18:47           ` McClintock Matthew-B29882
  2012-08-21 19:13             ` Chris Larson
  1 sibling, 1 reply; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 18:47 UTC (permalink / raw)
  To: Khem Raj
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 1:30 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
> <B29882@freescale.com> wrote:
>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>> <B29882@freescale.com> wrote:
>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock <msm@freescale.com> wrote:
>>>>>> +
>>>>>> +do_configure_prepend (){
>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h; then
>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>> +       fi
>>>>>> +}
>>>>>
>>>>>
>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>> define O_CLOEXEC if it
>>>>> was not defined before. The above seems a bit risky
>>>>
>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>> is not an easy way to do this with a patch, unless of course I apply
>>>> the patch manually.
>>>
>>> manually gripping at the host installation and then if O_CLOEXEC might
>>> be in comments
>>
>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>
>>> and furthermore it if it comes from fcntl.h which is not where you are
>>> looking for
>>
>> I am grepping this file though?
>
> I would go into the specific file where its asking for O_CLOEXEC
>
> and add
>
> #ifndef O_CLOEXEC
> # define O_CLOEXEC 0
> #endif
>
> and be done with it

Well this is seemingly the same way of doing it, just looks like you
always want it applied? I don't think it should always be applied.

If this was it takes to get the build fix in, then I will do it...
please confirm what will be accepted.

-M

>
>>
>>> there are few variables like that where its impacting more than
>>> affected systems.
>>
>> I don't follow...
>>
>> -M
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:41           ` Saul Wold
  2012-08-21 18:46             ` McClintock Matthew-B29882
@ 2012-08-21 18:48             ` Khem Raj
  2012-08-21 19:02               ` Chris Larson
  1 sibling, 1 reply; 16+ messages in thread
From: Khem Raj @ 2012-08-21 18:48 UTC (permalink / raw)
  To: Saul Wold
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 11:41 AM, Saul Wold <sgw@linux.intel.com> wrote:
> On 08/21/2012 11:30 AM, Khem Raj wrote:
>>
>> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
>> <B29882@freescale.com> wrote:
>>>
>>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>
>>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>>> <B29882@freescale.com> wrote:
>>>>>
>>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>
>>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock
>>>>>> <msm@freescale.com> wrote:
>>>>>>>
>>>>>>> +
>>>>>>> +do_configure_prepend (){
>>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h;
>>>>>>> then
>>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>>> +       fi
>>>>>>> +}
>>>>>>
>>>>>>
>>>>>>
>>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>>> define O_CLOEXEC if it
>>>>>> was not defined before. The above seems a bit risky
>>>>>
>>>>>
>>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>>> is not an easy way to do this with a patch, unless of course I apply
>>>>> the patch manually.
>>>>
>>>>
>>>> manually gripping at the host installation and then if O_CLOEXEC might
>>>> be in comments
>>>
>>>
>>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>>
>>>> and furthermore it if it comes from fcntl.h which is not where you are
>>>> looking for
>>>
>>>
>>> I am grepping this file though?
>>
>>
>> I would go into the specific file where its asking for O_CLOEXEC
>>
>> and add
>>
>> #ifndef O_CLOEXEC
>> # define O_CLOEXEC 0
>> #endif
>>
>> and be done with it
>>
> Wasn't this proposed back a month ago:
>
> http://lists.linuxtogo.org/pipermail/openembedded-core/2012-July/026343.html
>
> And there was discussion about that approach then? I think it was rejected
> due to lack of testing.

I think if it worked fine on a system like cents 5.8 then that would
cover the case
as well try it on newer systems where O_CLOEXEC is available that should do it.

>
> Sau!
>
>>>
>>>> there are few variables like that where its impacting more than
>>>> affected systems.
>>>
>>>
>>> I don't follow...
>>>
>>> -M
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>>
>



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:48             ` Khem Raj
@ 2012-08-21 19:02               ` Chris Larson
  2012-08-21 19:11                 ` McClintock Matthew-B29882
  0 siblings, 1 reply; 16+ messages in thread
From: Chris Larson @ 2012-08-21 19:02 UTC (permalink / raw)
  To: Khem Raj
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 11:48 AM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Aug 21, 2012 at 11:41 AM, Saul Wold <sgw@linux.intel.com> wrote:
>> On 08/21/2012 11:30 AM, Khem Raj wrote:
>>>
>>> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
>>> <B29882@freescale.com> wrote:
>>>>
>>>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>
>>>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>>>> <B29882@freescale.com> wrote:
>>>>>>
>>>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>>
>>>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock
>>>>>>> <msm@freescale.com> wrote:
>>>>>>>>
>>>>>>>> +
>>>>>>>> +do_configure_prepend (){
>>>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h;
>>>>>>>> then
>>>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>>>> +       fi
>>>>>>>> +}
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>>>> define O_CLOEXEC if it
>>>>>>> was not defined before. The above seems a bit risky
>>>>>>
>>>>>>
>>>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>>>> is not an easy way to do this with a patch, unless of course I apply
>>>>>> the patch manually.
>>>>>
>>>>>
>>>>> manually gripping at the host installation and then if O_CLOEXEC might
>>>>> be in comments
>>>>
>>>>
>>>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>>>
>>>>> and furthermore it if it comes from fcntl.h which is not where you are
>>>>> looking for
>>>>
>>>>
>>>> I am grepping this file though?
>>>
>>>
>>> I would go into the specific file where its asking for O_CLOEXEC
>>>
>>> and add
>>>
>>> #ifndef O_CLOEXEC
>>> # define O_CLOEXEC 0
>>> #endif
>>>
>>> and be done with it

This does seem like a nicer approach.
-- 
Christopher Larson



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 19:02               ` Chris Larson
@ 2012-08-21 19:11                 ` McClintock Matthew-B29882
  0 siblings, 0 replies; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 19:11 UTC (permalink / raw)
  To: Chris Larson
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 2:02 PM, Chris Larson <clarson@kergoth.com> wrote:
> On Tue, Aug 21, 2012 at 11:48 AM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Tue, Aug 21, 2012 at 11:41 AM, Saul Wold <sgw@linux.intel.com> wrote:
>>> On 08/21/2012 11:30 AM, Khem Raj wrote:
>>>>
>>>> On Tue, Aug 21, 2012 at 11:10 AM, McClintock Matthew-B29882
>>>> <B29882@freescale.com> wrote:
>>>>>
>>>>> On Tue, Aug 21, 2012 at 1:06 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>
>>>>>> On Tue, Aug 21, 2012 at 10:59 AM, McClintock Matthew-B29882
>>>>>> <B29882@freescale.com> wrote:
>>>>>>>
>>>>>>> On Tue, Aug 21, 2012 at 12:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>>>>>>
>>>>>>>> On Tue, Aug 21, 2012 at 9:20 AM, Matthew McClintock
>>>>>>>> <msm@freescale.com> wrote:
>>>>>>>>>
>>>>>>>>> +
>>>>>>>>> +do_configure_prepend (){
>>>>>>>>> +       if ! grep O_CLOEXEC -r ${includedir_native}/bits/fcntl.h;
>>>>>>>>> then
>>>>>>>>> +               export CFLAGS="$CFLAGS -D O_CLOEXEC=0"
>>>>>>>>> +       fi
>>>>>>>>> +}
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> IMO It would be safer to create a patch for kmod itself where you
>>>>>>>> define O_CLOEXEC if it
>>>>>>>> was not defined before. The above seems a bit risky
>>>>>>>
>>>>>>>
>>>>>>> Why is it risky? I only wanted to do this for affected systems. There
>>>>>>> is not an easy way to do this with a patch, unless of course I apply
>>>>>>> the patch manually.
>>>>>>
>>>>>>
>>>>>> manually gripping at the host installation and then if O_CLOEXEC might
>>>>>> be in comments
>>>>>
>>>>>
>>>>> How about grep define.*O_CLOEXEC -r ${includedir_native}/bits/fcntl.h
>>>>>
>>>>>> and furthermore it if it comes from fcntl.h which is not where you are
>>>>>> looking for
>>>>>
>>>>>
>>>>> I am grepping this file though?
>>>>
>>>>
>>>> I would go into the specific file where its asking for O_CLOEXEC
>>>>
>>>> and add
>>>>
>>>> #ifndef O_CLOEXEC
>>>> # define O_CLOEXEC 0
>>>> #endif
>>>>
>>>> and be done with it
>
> This does seem like a nicer approach.

OK - 2v1 ;) I'll respin as a patch.

-M



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 18:47           ` McClintock Matthew-B29882
@ 2012-08-21 19:13             ` Chris Larson
  2012-08-21 19:15               ` McClintock Matthew-B29882
  0 siblings, 1 reply; 16+ messages in thread
From: Chris Larson @ 2012-08-21 19:13 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 11:47 AM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
>> #ifndef O_CLOEXEC
>> # define O_CLOEXEC 0
>> #endif
>>
>> and be done with it
>
> Well this is seemingly the same way of doing it, just looks like you
> always want it applied? I don't think it should always be applied.
>
> If this was it takes to get the build fix in, then I will do it...
> please confirm what will be accepted.

No, on newer systems O_CLOEXEC will be defined, so that #ifndef block
will never be entered, and there'll be no change.
-- 
Christopher Larson



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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-21 19:13             ` Chris Larson
@ 2012-08-21 19:15               ` McClintock Matthew-B29882
  0 siblings, 0 replies; 16+ messages in thread
From: McClintock Matthew-B29882 @ 2012-08-21 19:15 UTC (permalink / raw)
  To: Chris Larson
  Cc: McClintock Matthew-B29882,
	openembedded-core@lists.openembedded.org

On Tue, Aug 21, 2012 at 2:13 PM, Chris Larson <clarson@kergoth.com> wrote:
> On Tue, Aug 21, 2012 at 11:47 AM, McClintock Matthew-B29882
> <B29882@freescale.com> wrote:
>>> #ifndef O_CLOEXEC
>>> # define O_CLOEXEC 0
>>> #endif
>>>
>>> and be done with it
>>
>> Well this is seemingly the same way of doing it, just looks like you
>> always want it applied? I don't think it should always be applied.
>>
>> If this was it takes to get the build fix in, then I will do it...
>> please confirm what will be accepted.
>
> No, on newer systems O_CLOEXEC will be defined, so that #ifndef block
> will never be entered, and there'll be no change.

Right, I was not thinking...

-M



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

* [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
@ 2012-08-24 18:16 Matthew McClintock
  2012-08-27 15:48 ` Saul Wold
  0 siblings, 1 reply; 16+ messages in thread
From: Matthew McClintock @ 2012-08-24 18:16 UTC (permalink / raw)
  To: openembedded-core

kmod will fail to build with the following error because O_CLOEXEC is
not defined:

| libkmod/libkmod-module.c: In function 'kmod_module_get_initstate':
| libkmod/libkmod-module.c:1640: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-module.c:1640: error: (Each undeclared identifier is reported only once
| libkmod/libkmod-module.c:1640: error: for each function it appears in.)
| libkmod/libkmod-module.c: In function 'kmod_module_get_refcnt':
| libkmod/libkmod-module.c:1754: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-module.c: In function 'kmod_module_get_sections':
| libkmod/libkmod-module.c:1913: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-file.c: In function 'kmod_file_open':
| libkmod/libkmod-file.c:282: error: 'O_CLOEXEC' undeclared (first use in this function)
| libkmod/libkmod-file.c:282: error: (Each undeclared identifier is reported only once
| libkmod/libkmod-file.c:282: error: for each function it appears in.)

Since we are only using kmod-native for depmod, and it's a non-threaded
user of this libary being built this should be safe to override O_CLOEXEC.

Keep in mind this is ONLY effecting the native builds and not what is
being shipped in the root file system.

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
v2: use patch instead of munging CFLAGS

 meta/recipes-kernel/kmod/kmod-native_git.bb        |    3 ++-
 .../kmod/kmod/fix-undefined-O_CLOEXEC.patch        |   17 +++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch

diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
index 96de8b8..8cbcdf8 100644
--- a/meta/recipes-kernel/kmod/kmod-native_git.bb
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -4,7 +4,8 @@
 require kmod.inc
 inherit native
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
+SRC_URI += "file://fix-undefined-O_CLOEXEC.patch"
 
 do_install_append (){
 	for tool in depmod insmod lsmod modinfo modprobe rmmod
diff --git a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
new file mode 100644
index 0000000..3177e9a
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Not applicable
+
+Index: git/libkmod/libkmod-private.h
+===================================================================
+--- git.orig/libkmod/libkmod-private.h
++++ git/libkmod/libkmod-private.h
+@@ -1,6 +1,10 @@
+ #ifndef _LIBKMOD_PRIVATE_H_
+ #define _LIBKMOD_PRIVATE_H_
+ 
++#ifndef O_CLOEXEC
++# define O_CLOEXEC 0
++#endif
++
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <syslog.h>
-- 
1.7.9.7





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

* Re: [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc
  2012-08-24 18:16 Matthew McClintock
@ 2012-08-27 15:48 ` Saul Wold
  0 siblings, 0 replies; 16+ messages in thread
From: Saul Wold @ 2012-08-27 15:48 UTC (permalink / raw)
  To: Matthew McClintock; +Cc: openembedded-core

On 08/24/2012 11:16 AM, Matthew McClintock wrote:
> kmod will fail to build with the following error because O_CLOEXEC is
> not defined:
>
> | libkmod/libkmod-module.c: In function 'kmod_module_get_initstate':
> | libkmod/libkmod-module.c:1640: error: 'O_CLOEXEC' undeclared (first use in this function)
> | libkmod/libkmod-module.c:1640: error: (Each undeclared identifier is reported only once
> | libkmod/libkmod-module.c:1640: error: for each function it appears in.)
> | libkmod/libkmod-module.c: In function 'kmod_module_get_refcnt':
> | libkmod/libkmod-module.c:1754: error: 'O_CLOEXEC' undeclared (first use in this function)
> | libkmod/libkmod-module.c: In function 'kmod_module_get_sections':
> | libkmod/libkmod-module.c:1913: error: 'O_CLOEXEC' undeclared (first use in this function)
> | libkmod/libkmod-file.c: In function 'kmod_file_open':
> | libkmod/libkmod-file.c:282: error: 'O_CLOEXEC' undeclared (first use in this function)
> | libkmod/libkmod-file.c:282: error: (Each undeclared identifier is reported only once
> | libkmod/libkmod-file.c:282: error: for each function it appears in.)
>
> Since we are only using kmod-native for depmod, and it's a non-threaded
> user of this libary being built this should be safe to override O_CLOEXEC.
>
> Keep in mind this is ONLY effecting the native builds and not what is
> being shipped in the root file system.
>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> v2: use patch instead of munging CFLAGS
>
>   meta/recipes-kernel/kmod/kmod-native_git.bb        |    3 ++-
>   .../kmod/kmod/fix-undefined-O_CLOEXEC.patch        |   17 +++++++++++++++++
>   2 files changed, 19 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
>
> diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
> index 96de8b8..8cbcdf8 100644
> --- a/meta/recipes-kernel/kmod/kmod-native_git.bb
> +++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
> @@ -4,7 +4,8 @@
>   require kmod.inc
>   inherit native
>
> -PR = "${INC_PR}.0"
> +PR = "${INC_PR}.1"
> +SRC_URI += "file://fix-undefined-O_CLOEXEC.patch"
>
>   do_install_append (){
>   	for tool in depmod insmod lsmod modinfo modprobe rmmod
> diff --git a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
> new file mode 100644
> index 0000000..3177e9a
> --- /dev/null
> +++ b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
> @@ -0,0 +1,17 @@
> +Upstream-Status: Not applicable
> +
> +Index: git/libkmod/libkmod-private.h
> +===================================================================
> +--- git.orig/libkmod/libkmod-private.h
> ++++ git/libkmod/libkmod-private.h
> +@@ -1,6 +1,10 @@
> + #ifndef _LIBKMOD_PRIVATE_H_
> + #define _LIBKMOD_PRIVATE_H_
> +
> ++#ifndef O_CLOEXEC
> ++# define O_CLOEXEC 0
> ++#endif
> ++
> + #include <stdbool.h>
> + #include <stdio.h>
> + #include <syslog.h>
>

Merged into OE-Core

Thanks
	Sau!




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

end of thread, other threads:[~2012-08-27 16:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-21 16:20 [PATCH v2] kmod-native_git.bb: fix builds for hosts with older libc Matthew McClintock
2012-08-21 17:54 ` Khem Raj
2012-08-21 17:59   ` McClintock Matthew-B29882
2012-08-21 18:06     ` Khem Raj
2012-08-21 18:10       ` McClintock Matthew-B29882
2012-08-21 18:30         ` Khem Raj
2012-08-21 18:41           ` Saul Wold
2012-08-21 18:46             ` McClintock Matthew-B29882
2012-08-21 18:48             ` Khem Raj
2012-08-21 19:02               ` Chris Larson
2012-08-21 19:11                 ` McClintock Matthew-B29882
2012-08-21 18:47           ` McClintock Matthew-B29882
2012-08-21 19:13             ` Chris Larson
2012-08-21 19:15               ` McClintock Matthew-B29882
  -- strict thread matches above, loose matches on Subject: below --
2012-08-24 18:16 Matthew McClintock
2012-08-27 15:48 ` Saul Wold

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