Opened 9 years ago

Closed 9 years ago

#1912 closed defect (fixed)

Build error on Alpine linux (musl libc)

Reported by: riza Owned by: bennylp
Priority: normal Milestone: release-2.5
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

When building on Alpine linux, this error was raised:

../src/pj/os_core_unix.c: In function 'init_mutex':
../src/pj/os_core_unix.c:1107:40: error: 'PTHREAD_MUTEX_FAST_NP' undeclared (first use in this function)
  rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP);
                                        ^

It seems that PTHREAD_MUTEX_FAST_NP and PTHREAD_MUTEX_RECURSIVE_NP is not portable, as the NP suffix indicates a non-portable extension to the POSIX standard.

Reference:

Next error was due to the use of an internal struct field
__sched_priority:

../src/samples/siprtp.c:1136:7: error: 'struct sched_param' has no member named '__sched_priority'
     tp.__sched_priority = max_prio;
       ^

variables and fields that starts with "__" are for internal use and
should in general not be used in applications.

Reference:

Change History (1)

comment:1 Changed 9 years ago by riza

  • Resolution set to fixed
  • Status changed from new to closed

In 5277:

Fixed #1912: Build Error on Alpine linux (musl libc).

Note: See TracTickets for help on using tickets.