Patchwork uclibc: remove PACKAGE_ARCH, fix compilation on i586

login
register
mail settings
Submitter Phil Blundell
Date June 3, 2011, 11:55 a.m.
Message ID <1307102133.2529.260.camel@phil-desktop>
Download mbox | patch
Permalink /patch/5375/
State New, archived
Headers show

Comments

Phil Blundell - June 3, 2011, 11:55 a.m.
There is no good reason for uclibc to be machine specific.  Remove local
assignment to PACKAGE_ARCH so that it gets the default target
architecture and bump PR for that change.

See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html

Also replace a chunk of anonymous python with a COMPATIBLE_HOST
declaration.

Signed-off-by: Phil Blundell <philb@gnu.org>
---
 .../uclibc/uclibc-git/epoll-asm-fix.patch          |   20 ++++++++++++++++++++
 meta/recipes-core/uclibc/uclibc.inc                |   12 +-----------
 meta/recipes-core/uclibc/uclibc_git.bb             |    5 ++---
 3 files changed, 23 insertions(+), 14 deletions(-)
 create mode 100644 meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
Phil Blundell - June 7, 2011, 9:36 a.m.
Ping?

p.

On Fri, 2011-06-03 at 12:55 +0100, Phil Blundell wrote:
> There is no good reason for uclibc to be machine specific.  Remove local
> assignment to PACKAGE_ARCH so that it gets the default target
> architecture and bump PR for that change.
> 
> See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
> 
> Also replace a chunk of anonymous python with a COMPATIBLE_HOST
> declaration.
> 
> Signed-off-by: Phil Blundell <philb@gnu.org>
Koen Kooi - June 7, 2011, 9:38 a.m.
Op 3 jun 2011, om 13:55 heeft Phil Blundell het volgende geschreven:

> There is no good reason for uclibc to be machine specific.  Remove local
> assignment to PACKAGE_ARCH so that it gets the default target
> architecture and bump PR for that change.
> 
> See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
> 
> Also replace a chunk of anonymous python with a COMPATIBLE_HOST
> declaration.
> 
> Signed-off-by: Phil Blundell <philb@gnu.org>

Not sure if we do this in the OE-core world, but:

Acked-by: Koen Kooi <koen@dominion.thruhere.net>
Saul Wold - June 7, 2011, 3:33 p.m.
On 06/03/2011 04:55 AM, Phil Blundell wrote:
> There is no good reason for uclibc to be machine specific.  Remove local
> assignment to PACKAGE_ARCH so that it gets the default target
> architecture and bump PR for that change.
>
> See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
>
> Also replace a chunk of anonymous python with a COMPATIBLE_HOST
> declaration.
>
> Signed-off-by: Phil Blundell<philb@gnu.org>
> ---
>   .../uclibc/uclibc-git/epoll-asm-fix.patch          |   20 ++++++++++++++++++++

This patch has not comments, Upstream-Status, or Sign-off-by.

Please add these so we have some history to this patch and can determine 
if it should be upstreamed.

Thanks
	Sau!

>   meta/recipes-core/uclibc/uclibc.inc                |   12 +-----------
>   meta/recipes-core/uclibc/uclibc_git.bb             |    5 ++---
>   3 files changed, 23 insertions(+), 14 deletions(-)
>   create mode 100644 meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
>
> diff --git a/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch b/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
> new file mode 100644
> index 0000000..6129081
> --- /dev/null
> +++ b/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
> @@ -0,0 +1,20 @@
> +diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
> +index 85b0cfd..c034b2c 100644
> +--- a/libc/sysdeps/linux/common/epoll.c
> ++++ b/libc/sysdeps/linux/common/epoll.c
> +@@ -67,12 +67,13 @@ extern __typeof(epoll_pwait) __libc_epoll_pwait;
> + int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
> + 						int timeout, const sigset_t *set)
> + {
> ++	int nsig = _NSIG / 8;
> + 	if (SINGLE_THREAD_P)
> +-		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
> ++		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
> + # ifdef __UCLIBC_HAS_THREADS_NATIVE__
> + 	else {
> + 		int oldtype = LIBC_CANCEL_ASYNC ();
> +-		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
> ++		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
> + 		LIBC_CANCEL_RESET (oldtype);
> + 		return result;
> + 	}
> diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
> index c1bc422..a2c6ee5 100644
> --- a/meta/recipes-core/uclibc/uclibc.inc
> +++ b/meta/recipes-core/uclibc/uclibc.inc
> @@ -36,21 +36,11 @@ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
>   sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
>   "
>
> -#
>   # For now, we will skip building of a gcc package if it is a uclibc one
>   # and our build is not a uclibc one, and we skip a glibc one if our build
>   # is a uclibc build.
> -#
> -# See the note in gcc/gcc_3.4.0.oe
> -#
> +COMPATIBLE_HOST = ".*-uclibc.*"
>
> -python __anonymous () {
> -    import bb, re
> -    uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
> -    if not uc_os:
> -        raise bb.parse.SkipPackage("incompatible with target %s" %
> -                                   bb.data.getVar('TARGET_OS', d, 1))
> -}
>   PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
>   DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>              virtual/${TARGET_PREFIX}gcc-intermediate \
> diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
> index eded2fb..33c6ec8 100644
> --- a/meta/recipes-core/uclibc/uclibc_git.bb
> +++ b/meta/recipes-core/uclibc/uclibc_git.bb
> @@ -2,11 +2,9 @@ SRCREV="71d63ed75648da9b0b71afabb9c60aaad792c55c"
>
>   require uclibc.inc
>   PV = "0.9.31+0.9.32rc3"
> -PR = "${INC_PR}.2"
> +PR = "${INC_PR}.3"
>   PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
>
> -#recent versions uclibc require real kernel headers
> -PACKAGE_ARCH = "${MACHINE_ARCH}"
>   FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}"
>
>   SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
> @@ -29,5 +27,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
>   	file://remove_attribute_optimize_Os.patch \
>   	file://append_UCLIBC_EXTRA_CFLAGS.patch \
>   	file://compile-arm-fork-with-O2.patch \
> +	file://epoll-asm-fix.patch \
>   	"
>   S = "${WORKDIR}/git"
Phil Blundell - June 7, 2011, 3:51 p.m.
On Tue, 2011-06-07 at 08:33 -0700, Saul Wold wrote:
> This patch has not comments, Upstream-Status, or Sign-off-by.
> 
> Please add these so we have some history to this patch and can determine 
> if it should be upstreamed.

Is there some documentation which describes how Upstream-Status is meant
to be set?

Thanks

p.
Saul Wold - June 7, 2011, 3:59 p.m.
On 06/07/2011 08:51 AM, Phil Blundell wrote:
> On Tue, 2011-06-07 at 08:33 -0700, Saul Wold wrote:
>> This patch has not comments, Upstream-Status, or Sign-off-by.
>>
>> Please add these so we have some history to this patch and can determine
>> if it should be upstreamed.
>
> Is there some documentation which describes how Upstream-Status is meant
> to be set?
>
Mark Hatle has been working on the doc and a draft is out on the oe-dev 
alias, search for subject:

[oe] Commit and Patch message guidelines - fifth draft

I think he will be sending another draft this week, but the core info is 
there.

Sau!

> Thanks
>
> p.
>
>
>
Mark Hatle - June 7, 2011, 4 p.m.
On 6/7/11 10:51 AM, Phil Blundell wrote:
> On Tue, 2011-06-07 at 08:33 -0700, Saul Wold wrote:
>> This patch has not comments, Upstream-Status, or Sign-off-by.
>>
>> Please add these so we have some history to this patch and can determine 
>> if it should be upstreamed.
> 
> Is there some documentation which describes how Upstream-Status is meant
> to be set?

Blame me.. the submission guide info has been sent out in draft, and I'm working
to get the final version done today.

Below is the chunk on the upstream status (from the last revision -- the fifth
revision):

Patch Header Recommendations
----------------------------
In order to keep track of patches and ultimately reduce the number of patches
that are required to be maintained, we need to track the status of the patches
that are created. The following items are specific to patches applied by recipes.

In addition to the items mentioned above, we also want to track if it's
appropriate to get this particular patch into the upstream project. Since we
want to track this information, we need a consistent tag and set of status that
can be searched.

While adding this tracking information to the patch headers is currently optional,
it is highly recommended and some maintainers may require it.  It is optional at
this time so that it can be evaluated as to it's usefulness over time.  Existing
patches will be modified with the tag as they are modified.

As mentioned in the above, be sure to include any URL to bug tracking, mailing
lists or other reference material pertaining to the patch. Then add a new tag
"Upstream-Status:" which contains one of the following items:

   Pending
   - No determination has been made yet or not yet submitted to upstream

   Submitted [where]
   - Submitted to upstream, waiting approval
   - Optionally include where it was submitted, such as the author, mailing
     list, etc.

   Accepted
   - Accepted in upstream, expect it to be removed at next update, include
     expected version info

   Backport
   - Backported from new upstream version, because we are at a fixed version,
     include upstream version info

   Denied
   - Not accepted by upstream, include reason in patch

   Inappropriate [reason]
   - The patch is not appropriate for upstream, include a brief reason on the
     same line enclosed with []
     reason can be:
       not author (You are not the author and do not intend to upstream this,
                   source must be listed in the comments)
       native
       licensing
       configuration
       enable feature
       disable feature
       bugfix (add bug URL here)
       embedded specific
       no upstream (the upstream is no longer available -- dead project)
       other (give details in comments)

The various "Inappropriate [reason]" status items are meant to indicate that the
person reasonable for adding this patch to the system does not intend to upstream
the patch for a specific reason.  Unless otherwise noted, another person could
submit this patch to the upstream, if they do the status should be changed to
"Submitted [where]", and an additional signed-off-by: line added to the patch by
the person claiming responsibility for upstreaming.

For example, if the patch has been submitted upstream:

   rpm: Adjusted the foo setting in bar

   [RPM Ticket #65] -- http://rpm5.org/cvs/tktview?tn=65,5

   The foo setting in bar was decreased from X to X-50% in order to
   ensure we don't exhaust all system memory with foobar threads.

   Upstream-Status: Submitted [rpm5-devel@rpm5.org]

   Signed-off-by: Joe Developer <joe.developer@example.com>

A future commit can change the value to "Accepted" or "Denied" as appropriate.
Khem Raj - June 7, 2011, 5:43 p.m.
On Tue, Jun 7, 2011 at 2:36 AM, Phil Blundell <pb@pbcl.net> wrote:
> Ping?

Both changes are fine.

change from being machine specific is futuristic it will not work for
all architectures that
uclibc supports but is sufficient for what we support/use in oe for now.

Acked-by: Khem Raj <raj.khem@gmail.com>

>
> p.
>
> On Fri, 2011-06-03 at 12:55 +0100, Phil Blundell wrote:
>> There is no good reason for uclibc to be machine specific.  Remove local
>> assignment to PACKAGE_ARCH so that it gets the default target
>> architecture and bump PR for that change.
>>
>> See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
>>
>> Also replace a chunk of anonymous python with a COMPATIBLE_HOST
>> declaration.
>>
>> Signed-off-by: Phil Blundell <philb@gnu.org>
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Koen Kooi - June 7, 2011, 5:48 p.m.
Op 7 jun 2011, om 19:43 heeft Khem Raj het volgende geschreven:

> On Tue, Jun 7, 2011 at 2:36 AM, Phil Blundell <pb@pbcl.net> wrote:
>> Ping?
> 
> Both changes are fine.
> 
> change from being machine specific is futuristic it will not work for
> all architectures that
> uclibc supports but is sufficient for what we support/use in oe for now.

If uclibc is *really* machine specific then everything that links against it should be machine specific as well. Since, as you say, the current configs are rather generic we should make that clear by making uclibc stop pretending to be machine specific.

regards,

Koen
Khem Raj - June 7, 2011, 5:59 p.m.
On Tue, Jun 7, 2011 at 10:48 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 7 jun 2011, om 19:43 heeft Khem Raj het volgende geschreven:
>
>> On Tue, Jun 7, 2011 at 2:36 AM, Phil Blundell <pb@pbcl.net> wrote:
>>> Ping?
>>
>> Both changes are fine.
>>
>> change from being machine specific is futuristic it will not work for
>> all architectures that
>> uclibc supports but is sufficient for what we support/use in oe for now.
>
> If uclibc is *really* machine specific then everything that links against it should be machine specific as well. Since, as you say, the current configs are rather generic we should make that clear by making uclibc stop pretending to be machine specific.
>

intention is to break that machine dependency if any. Since it used
kconfig like kernel

many things like tune options and some workarounds creeped in, uclibc
is intended to be made
clear of those and be machine independent thats why I am ok with this patch

> regards,
>
> Koen
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Richard Purdie - June 7, 2011, 8:36 p.m.
On Tue, 2011-06-07 at 10:36 +0100, Phil Blundell wrote:
> Ping?

I'm not against this move at all but before this patch merges we should
really have a cleanup which removes the *.machine configuration files
from the uclibc recipe directory along with all the machine specific
overrides that are in use instead making them arch specific.

Any volunteers?

Cheers,

Richard


> p.
> 
> On Fri, 2011-06-03 at 12:55 +0100, Phil Blundell wrote:
> > There is no good reason for uclibc to be machine specific.  Remove local
> > assignment to PACKAGE_ARCH so that it gets the default target
> > architecture and bump PR for that change.
> > 
> > See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
> > 
> > Also replace a chunk of anonymous python with a COMPATIBLE_HOST
> > declaration.
> > 
> > Signed-off-by: Phil Blundell <philb@gnu.org>
> 
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Khem Raj - June 8, 2011, 1:28 a.m.
On Tue, Jun 7, 2011 at 1:36 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2011-06-07 at 10:36 +0100, Phil Blundell wrote:
>> Ping?
>
> I'm not against this move at all but before this patch merges we should
> really have a cleanup which removes the *.machine configuration files
> from the uclibc recipe directory along with all the machine specific
> overrides that are in use instead making them arch specific.
>
> Any volunteers?
>

Yes thats in my todo list.

> Cheers,
>
> Richard
>
>
>> p.
>>
>> On Fri, 2011-06-03 at 12:55 +0100, Phil Blundell wrote:
>> > There is no good reason for uclibc to be machine specific.  Remove local
>> > assignment to PACKAGE_ARCH so that it gets the default target
>> > architecture and bump PR for that change.
>> >
>> > See http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/003064.html
>> >
>> > Also replace a chunk of anonymous python with a COMPATIBLE_HOST
>> > declaration.
>> >
>> > Signed-off-by: Phil Blundell <philb@gnu.org>
>>
>>
>>
>> _______________________________________________
>> 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
>
Phil Blundell - June 10, 2011, 2:02 p.m.
On Tue, 2011-06-07 at 21:36 +0100, Richard Purdie wrote:
> I'm not against this move at all but before this patch merges we should
> really have a cleanup which removes the *.machine configuration files
> from the uclibc recipe directory along with all the machine specific
> overrides that are in use instead making them arch specific.

Okay, fair enough.  I've resent the other, unrelated changes as separate
patches and we can deal with PACKAGE_ARCH when the time is right.

p.

Patch

diff --git a/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch b/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
new file mode 100644
index 0000000..6129081
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/epoll-asm-fix.patch
@@ -0,0 +1,20 @@ 
+diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
+index 85b0cfd..c034b2c 100644
+--- a/libc/sysdeps/linux/common/epoll.c
++++ b/libc/sysdeps/linux/common/epoll.c
+@@ -67,12 +67,13 @@ extern __typeof(epoll_pwait) __libc_epoll_pwait;
+ int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
+ 						int timeout, const sigset_t *set)
+ {
++	int nsig = _NSIG / 8;
+ 	if (SINGLE_THREAD_P)
+-		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
++		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+ # ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ 	else {
+ 		int oldtype = LIBC_CANCEL_ASYNC ();
+-		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
++		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+ 		LIBC_CANCEL_RESET (oldtype);
+ 		return result;
+ 	}
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
index c1bc422..a2c6ee5 100644
--- a/meta/recipes-core/uclibc/uclibc.inc
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -36,21 +36,11 @@  cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
 "
 
-#
 # For now, we will skip building of a gcc package if it is a uclibc one
 # and our build is not a uclibc one, and we skip a glibc one if our build
 # is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
+COMPATIBLE_HOST = ".*-uclibc.*"
 
-python __anonymous () {
-    import bb, re
-    uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
-    if not uc_os:
-        raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   bb.data.getVar('TARGET_OS', d, 1))
-}
 PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
 DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            virtual/${TARGET_PREFIX}gcc-intermediate \
diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
index eded2fb..33c6ec8 100644
--- a/meta/recipes-core/uclibc/uclibc_git.bb
+++ b/meta/recipes-core/uclibc/uclibc_git.bb
@@ -2,11 +2,9 @@  SRCREV="71d63ed75648da9b0b71afabb9c60aaad792c55c"
 
 require uclibc.inc
 PV = "0.9.31+0.9.32rc3"
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
 PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
 
-#recent versions uclibc require real kernel headers
-PACKAGE_ARCH = "${MACHINE_ARCH}"
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}"
 
 SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
@@ -29,5 +27,6 @@  SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
 	file://remove_attribute_optimize_Os.patch \
 	file://append_UCLIBC_EXTRA_CFLAGS.patch \
 	file://compile-arm-fork-with-O2.patch \
+	file://epoll-asm-fix.patch \
 	"
 S = "${WORKDIR}/git"