Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119762 - app-admin/showconsole failes to compile against uclibc, missing pthread_yield()
Summary: app-admin/showconsole failes to compile against uclibc, missing pthread_yield()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-20 20:32 UTC by Dan Callaghan
Modified: 2006-03-04 20:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
modified ebuild (showconsole-1.08-r1.ebuild,1.18 KB, text/plain)
2006-03-04 07:36 UTC, Jan Girlich
Details
changes pthread_yield() to sched_yield() (uclibc-pthread.patch,197 bytes, patch)
2006-03-04 07:38 UTC, Jan Girlich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Callaghan 2006-01-20 20:32:18 UTC
showconsole-1.07 and -1.08 fail to compile on systems running uclibc, as it does not seem to provide pthread_yield().

armeb-softfloat-linux-uclibc-gcc  -Os -march=armv5te -mtune=xscale  -D_GNU_SOURCE -DLOG_BUFFER_SIZE=65536 -DTRANS_BUFFER_SIZE=4096 -DBOOT_LOGFILE=\"/var/log/boot.msg\" -D_PATH_BLOG_FIFO=\"/dev/blog\" -Wall -pipe -funroll-loops -c libconsole.c -pthread
libconsole.c: In function `poll':
libconsole.c:442: warning: implicit declaration of function `pthread_yield'
armeb-softfloat-linux-uclibc-gcc  -Os -march=armv5te -mtune=xscale  -D_GNU_SOURCE -DLOG_BUFFER_SIZE=65536 -DTRANS_BUFFER_SIZE=4096 -DBOOT_LOGFILE=\"/var/log/boot.msg\" -D_PATH_BLOG_FIFO=\"/dev/blog\" -Wall -pipe -funroll-loops -o showconsole showconsole.c libconsole.o -pthread
libconsole.o: In function `action':
libconsole.c:(.text+0x498): undefined reference to `pthread_yield'
collect2: ld returned 1 exit status
make: *** [showconsole] Error 1

sched_yield() is the suggested alternative. Here is a patch that changes the only instance of pthread_yield() to sched_yield():

--- showconsole-1.08-orig/libconsole.c  2006-01-21 13:35:43 +1000
+++ showconsole-1.08/libconsole.c       2006-01-21 13:39:47 +1000
@@ -439,7 +439,7 @@
                ret = 0;
        }
     } else
-       pthread_yield();
+       sched_yield();

     return ret;
 }

This fixes the problem on my uclibc-0.9.27-r1 system (host type armeb-softfloat-linux-uclibc). Also tested against glibc-2.3.5-r2 (on i686-pc-linux-gnu).
Comment 1 Jan Girlich 2006-03-04 07:34:55 UTC
I modified the showconsole-1.08.ebuild and it work's for me too.

But I don't know if the above patch works only for uclibc or also for glibc and if we need to check what is used within the ebuild.
Comment 2 Jan Girlich 2006-03-04 07:36:07 UTC
Created attachment 81294 [details]
modified ebuild
Comment 3 Jan Girlich 2006-03-04 07:38:23 UTC
Created attachment 81295 [details, diff]
changes pthread_yield() to sched_yield()
Comment 4 solar (RETIRED) gentoo-dev 2006-03-04 08:02:50 UTC
The safe bet is.

#include <features.h>

#ifndef __UCLIBC__
  
#else

#endif
Comment 6 SpanKY gentoo-dev 2006-03-04 20:32:00 UTC
fixed in cvs, thanks for the report