Ticket #1912 (closed defect: fixed)

Opened 20 months ago

Last modified 20 months ago

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

comment:1 Changed 20 months ago by riza

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

In 5277:

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

Note: See TracTickets for help on using tickets.