[Home]

Summary:ASTERISK-24663: [patch] Unnamed semaphore autoconf check fails on cross compilation
Reporter:abelbeck (abelbeck)Labels:
Date Opened:2015-01-05 16:30:57.000-0600Date Closed:2015-01-14 20:21:20.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:General
Versions:13.1.0 Frequency of
Occurrence
Related
Issues:
Environment:AstLinux 1.2Attachments:( 0) asterisk-13-anonymous-semaphores.patch
Description:The Asterisk 13 configure.ac checks for HAS_WORKING_SEMAPHORE but does not have an option for cross-compiling so it fails with an exit.
{noformat}
checking for working unnamed semaphores... configure: error: in `/home/user/astlinux/1.0/output/build/asterisk-13.1.0':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
{noformat}

Attached is patch that defaults to "HAS_WORKING_SEMAPHORE 1" if cross-compiling is detected.  I'm not sure if this is correct default, but seems to work for cross-compiling Linux.

If this is worth a configure option, I'll leave that to the autoconf gurus.

Comments:By: abelbeck (abelbeck) 2015-01-05 16:32:15.141-0600

Default to "HAS_WORKING_SEMAPHORE 1" when cross-compiling.

By: abelbeck (abelbeck) 2015-01-05 21:35:16.283-0600

Here is where this configure.ac change was made, Sep 30 18:26:27 2013

http://svnview.digium.com/svn/asterisk?view=revision&revision=400178

Context always helps.


By: Matt Jordan (mjordan) 2015-01-12 10:20:05.399-0600

Just curious, what were you cross-compiling to?

By: abelbeck (abelbeck) 2015-01-12 11:02:31.117-0600

# uname -a
Linux pbx4 3.2.62-astlinux #1 SMP PREEMPT Sun Jan 11 09:56:52 CST 2015 i686 GNU/Linux

We use eglibc via a crosstool-ng toolchain and the Buildroot environment.

Since these are embedded devices, selecting the most efficient method "HAS_WORKING_SEMAPHORE 1" is good.

By: abelbeck (abelbeck) 2015-01-12 11:12:34.491-0600

Hey Matt, it just occurred to me you were asking a more general question...

Most any x86 board is our target, for example:

PC Engines APU1 Dual Core AMD T40E
http://doc.astlinux.org/userdoc:board_pcengines_apu

Lanner FW-7525B Atom C2358 Fanless Appliance
http://doc.astlinux.org/userdoc:board_lanner_fw-7525b

The new Atom C2000 boards are a great target.

By: Matt Jordan (mjordan) 2015-01-14 20:11:11.015-0600

The {{autoconf}} entry looks correct.

Doing a quick Google, it appears like anything that is POSIX compliant should have a {{semaphore.h}}, so it's probably reasonable to default it to True when cross-compiling.