Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2712 closed defect (fixed)

Build 7292 compile not work (edit: only with openwrt?!), Build 7291 ok

Reported by: The_Raven Owned by:
Priority: major Component: General
Severity: medium Keywords:
Cc: gf@… Sensitive: no

Description

Revision

7292

Issue Description

Does not compile

When the issue occurs

When try to compile

How the issue is reproducable

Compile it and you see it. ;-)

This is the Error:
oscam.c: In function 'add_job':
oscam.c:4167: warning: implicit declaration of function 'pthread_getcpuclockid'
/tmp/ccPeS3JH.o: In function `add_job':
oscam.c:(.text.add_job+0x570): undefined reference to `pthread_getcpuclockid'
collect2: ld returned 1 exit status

Attachments (1)

oscam-pthread_getcpuclockid.c.diff (742 bytes ) - added by gf 12 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by cybero2912, 12 years ago

cannot confirm this problem

compiled 7292 for i386 with simplebuild without any error

comment:2 by The_Raven, 12 years ago

Checked again and it looks that it happens only if crosscompile! Nativ build works!

comment:3 by cybero2912, 12 years ago

cross compile also working (db2)

maybe a specific module is causing the problem which you complile and I don't

comment:4 by The_Raven, 12 years ago

Hm, very strange! db2 works, but can you please test openwrt2.6? Works with 7291 but not with 7292.

comment:5 by The_Raven, 12 years ago

Priority: criticalmajor
Severity: highmedium

comment:6 by cybero2912, 12 years ago

openwrt2.6 also NOT working here

comment:7 by The_Raven, 12 years ago

Summary: Build 7292 compile not work, Build 7291 okBuild 7292 compile not work (edit: only with openwrt?!), Build 7291 ok

comment:8 by gf, 12 years ago

Guys this is an issue with the toolchain. The libc do not define pthread_getcpuclockid. We already have similar problems that were solved here: http://www.streamboard.tv:8001/ticket/2564#comment:4

I think anybody who have this problem should bother the guys that give him such old/broken libc.

comment:9 by gf, 12 years ago

Ok, http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getcpuclockid.html
It seems that this is a new function and it is unsupported under OS X as well. I think it can safely be replaced by times(3).

comment:10 by gf, 12 years ago

Well, I have looked at the pthread_getclockid() usage and I think the following should resolve the situation:

diff --git a/oscam.c b/oscam.c
index 4d16396..7e2d568 100644
--- a/oscam.c
+++ b/oscam.c
@@ -4162,9 +4162,8 @@ void add_job(struct s_client *cl, int8_t action, void *ptr, int32_t len) {
                 //Thread down???
                 pthread_mutex_lock(&cl->thread_lock);
                 if (cl->thread_active) {
-                    clockid_t clock_id;
                     //Just test for invalid thread id:
-                    if (pthread_getcpuclockid(cl->thread, &clock_id) == ESRCH) {
+                    if (pthread_detach(cl->thread) == ESRCH) {
                         cl->thread_active = 0;
                         cs_log("WARNING: %s %s thread died!",  cl->typ=='c'?"client":"reader", username(cl));
                     }

comment:11 by gf, 12 years ago

Cc: gf@… added
Resolution: fixed
Status: newclosed

Fixed in r7294.

comment:12 by The_Raven, 12 years ago

Hm, in german we say "i understand only trainstation" what means: I understand nothing :-)
But works again! Thx for fixing it!

Note: See TracTickets for help on using tickets.