NetBSD Users Forum

NetBSD Users Forum

You are not logged in.

#1 2020-03-06 01:03:07

starsnet
Moderator
NetBSDFirefox 71.0

FreeSWITCH on NetBSD

клонирую FS:

git clone https://github.com/signalwire/freeswitch.git

и получаю ошибку:

In file included from /usr/pkgsrc/comms/freeswitch/libs/srtp/crypto/include/rdbx.h:50:0,
from /usr/pkgsrc/comms/freeswitch/libs/srtp/include/srtp_priv.h:52,
from src/switch_rtp.c:48:
/usr/pkgsrc/comms/freeswitch/libs/srtp/crypto/include/datatypes.h: In function 'be32_to_cpu':
/usr/pkgsrc/comms/freeswitch/libs/srtp/crypto/include/datatypes.h:286:5: error: implicit declaration of function 'asm'; did you mean 'asin'? [-Werror=implicit-function-declaration]
asm("bswap %0" : "=r"(v) : "0"(v));
^~~
asin
/usr/pkgsrc/comms/freeswitch/libs/srtp/crypto/include/datatypes.h:286:20: error: expected ')' before ':' token
asm("bswap %0" : "=r"(v) : "0"(v));
^
cc1: all warnings being treated as errors
gmake[1]: *** [Makefile:2583: src/libfreeswitch_la-switch_rtp.lo] Error 1
gmake[1]: Leaving directory '/usr/pkgsrc/comms/freeswitch'
gmake: *** [Makefile:1446: all] Error 2

компилирую без поддержки srtp (  ./configure --disable-srtp  ) - всё равно ошибка

Last edited by starsnet (2020-03-06 01:12:25)

Offline

#2 2020-03-06 01:28:23

starsnet
Moderator
NetBSDFirefox 71.0

Re: FreeSWITCH on NetBSD

Победил!

Нашел аж два решения.

1. Решение, правильное.

В файле freeswitch/libs/srtp/crypto/include/datatypes.h
найти блок с ассемблерной вставкой:

#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
static inline uint32_t be32_to_cpu(uint32_t v)
{
    /* optimized for x86. */
    asm("bswap %0" : "=r"(v) : "0"(v));
    return v;
}
#else /* HAVE_X86 */

Синтаксис ассемблерной вставки был неправильный.
Вместо "asm" надо-> "__asm__"

asm("bswap %0" : "=r"(v) : "0"(v)); -> __asm__("bswap %0" : "=r"(v) : "0"(v));


2. Решение. Возможно, производительность упадет:
Нашел здесь: https://nanopdf.com/download/fs-5507-cr … 2tocpu_pdf

Заменить ассемблерную вставку Си-шной функцией:

/* Fall back. */
static inline uint32_t be32_to_cpu(uint32_t v)
{
    /* optimized for x86. */
    asm("bswap %0" : "=r"(v) : "0"(v));
    return v;
}

заменить на:

# define be32_to_cpu(x) ntohl((x))

Last edited by starsnet (2020-03-06 01:38:14)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] CCBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.033 seconds, 7 queries executed - Memory usage: 466.02 KiB (Peak: 962.91 KiB) ]