Yate 的 64 位 ARM64 Raspberry Pi 的编译头文件?

问题描述 投票:0回答:2

当我尝试在 Raspberry Pi 4 上的 64 位 (ARM64) Ubuntu 21.04 上编译 Nuand 的 Yate 软件时,出现架构支持标头错误:

~/software/bts/yate$ make
make -C ./engine all
make[1]: Entering directory '/home/parallels/software/bts/yate/engine'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/parallels/software/bts/yate/engine'
make -C ./modules all
make[1]: Entering directory '/home/parallels/software/bts/yate/modules'
make -C ../libs/miniwebrtc
make[2]: Entering directory '/home/parallels/software/bts/yate/libs/miniwebrtc'
g++ -Wall   -I. -I./audio/common/processing -I./audio/common/vad -I./audio/processing/aec -I./audio/processing/aecm -I./audio/processing/agc -I./audio/processing/ns -I./audio/processing/utility -I./system_wrappers -O2 -Wno-overloaded-virtual  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -DWEBRTC_NS_FLOAT=true -c -o audio/common/resampler/resampler.o audio/common/resampler/resampler.cc
In file included from ./audio/common/processing/signal_processing_library.h:22,
                 from audio/common/resampler/resampler.cc:19:
./typedefs.h:104:2: error: #error Please add support for your architecture in typedefs.h
  104 | #error Please add support for your architecture in typedefs.h
      |  ^~~~~
make[2]: *** [Makefile:263: audio/common/resampler/resampler.o] Error 1
make[2]: Leaving directory '/home/parallels/software/bts/yate/libs/miniwebrtc'
make[1]: *** [Makefile:448: ../libs/miniwebrtc/libminiwebrtc.a] Error 2
make[1]: Leaving directory '/home/parallels/software/bts/yate/modules'
make: *** [Makefile:186: modules] Error 2

当我检查 typedefs.h 标头时,我发现尚未添加 arm64 支持:

/*
 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

// This file contains platform-specific typedefs and defines.
#ifndef WEBRTC_TYPEDEFS_H_
#define WEBRTC_TYPEDEFS_H_

// Reserved words definitions
// TODO(andrew): Look at removing these.
#define WEBRTC_EXTERN extern
#define G_CONST const
#define WEBRTC_INLINE extern __inline

// Define WebRTC preprocessor identifiers based on the current build platform.
// TODO(andrew): Clean these up. We can probably remove everything in this
// block.
//   - TARGET_MAC_INTEL and TARGET_MAC aren't used anywhere.
//   - In the few places where TARGET_PC is used, it should be replaced by
//     something more specific.
//   - Do we really support PowerPC? Probably not. Remove WEBRTC_MAC_INTEL
//     from build/common.gypi as well.
#if defined(WIN32)
    // Windows & Windows Mobile.
    #if !defined(WEBRTC_TARGET_PC)
        #define WEBRTC_TARGET_PC
    #endif
#elif defined(__APPLE__)
    // Mac OS X.
    #if defined(__LITTLE_ENDIAN__ )
        #if !defined(WEBRTC_TARGET_MAC_INTEL)
            #define WEBRTC_TARGET_MAC_INTEL
        #endif
    #else
        #if !defined(WEBRTC_TARGET_MAC)
            #define WEBRTC_TARGET_MAC
        #endif
    #endif
#else
    // Linux etc.
    #if !defined(WEBRTC_TARGET_PC)
        #define WEBRTC_TARGET_PC
    #endif
#endif

// Derived from Chromium's build/build_config.h
// Processor architecture detection.  For more info on what's defined, see:
//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
//   http://www.agner.org/optimize/calling_conventions.pdf
//   or with gcc, run: "echo | gcc -E -dM -"
// TODO(andrew): replace WEBRTC_LITTLE_ENDIAN with WEBRTC_ARCH_LITTLE_ENDIAN?
#if defined(_M_X64) || defined(__x86_64__)
#define WEBRTC_ARCH_X86_FAMILY
#define WEBRTC_ARCH_X86_64
#define WEBRTC_ARCH_64_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#elif defined(_M_IX86) || defined(__i386__)
#define WEBRTC_ARCH_X86_FAMILY
#define WEBRTC_ARCH_X86
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#elif defined(__ARMEL__)
// TODO(andrew): We'd prefer to control platform defines here, but this is
// currently provided by the Android makefiles. Commented to avoid duplicate
// definition warnings.
//#define WEBRTC_ARCH_ARM
// TODO(andrew): Chromium uses the following two defines. Should we switch?
//#define WEBRTC_ARCH_ARM_FAMILY
//#define WEBRTC_ARCH_ARMEL
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#elif defined(__mips__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_BIG_ENDIAN
#elif defined(__powerpc64__)
#define WEBRTC_ARCH_PPC64 1
#define WEBRTC_ARCH_64_BITS
#ifdef __LITTLE_ENDIAN__
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#else
#define WEBRTC_ARCH_BIG_ENDIAN
#define WEBRTC_BIG_ENDIAN
#endif
#elif defined(__powerpc__)
#define WEBRTC_ARCH_PPC 1
#define WEBRTC_ARCH_32_BITS
#ifdef __LITTLE_ENDIAN__
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#else
#define WEBRTC_ARCH_BIG_ENDIAN
#define WEBRTC_BIG_ENDIAN
#endif

#else
#error Please add support for your architecture in typedefs.h
#endif

#if defined(__SSE2__) || defined(_MSC_VER)
#define WEBRTC_USE_SSE2
#endif

#if defined(WEBRTC_TARGET_PC)

#if !defined(_MSC_VER)
  #include <stdint.h>
#else
    // Define C99 equivalent types.
    // Since MSVC doesn't include these headers, we have to write our own
    // version to provide a compatibility layer between MSVC and the WebRTC
    // headers.
    typedef signed char         int8_t;
    typedef signed short        int16_t;
    typedef signed int          int32_t;
    typedef signed long long    int64_t;
    typedef unsigned char       uint8_t;
    typedef unsigned short      uint16_t;
    typedef unsigned int        uint32_t;
    typedef unsigned long long  uint64_t;
#endif

#if defined(WIN32)
    typedef __int64             WebRtc_Word64;
    typedef unsigned __int64    WebRtc_UWord64;
#else
    typedef int64_t             WebRtc_Word64;
    typedef uint64_t            WebRtc_UWord64;
#endif
    typedef int32_t             WebRtc_Word32;
    typedef uint32_t            WebRtc_UWord32;
    typedef int16_t             WebRtc_Word16;
    typedef uint16_t            WebRtc_UWord16;
    typedef char                WebRtc_Word8;
    typedef uint8_t             WebRtc_UWord8;

    // Define endian for the platform
    #define WEBRTC_LITTLE_ENDIAN

#elif defined(WEBRTC_TARGET_MAC_INTEL)
    #include <stdint.h>

    typedef int64_t             WebRtc_Word64;
    typedef uint64_t            WebRtc_UWord64;
    typedef int32_t             WebRtc_Word32;
    typedef uint32_t            WebRtc_UWord32;
    typedef int16_t             WebRtc_Word16;
    typedef char                WebRtc_Word8;
    typedef uint16_t            WebRtc_UWord16;
    typedef uint8_t             WebRtc_UWord8;

    // Define endian for the platform
    #define WEBRTC_LITTLE_ENDIAN

#else
    #error "No platform defined for WebRTC type definitions (typedefs.h)"
#endif

#endif  // WEBRTC_TYPEDEFS_H_

因此我向制造商 Nuand 报告了此错误,但他们没有快速响应如何解决这些问题。那么如果我手动添加对树莓派的支持,添加对 ARM64 的支持而不导致编译后出错的正确方法是什么?

我尝试过:

#elif defined(__aarch64__)
#define WEBRTC_ARCH_64_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN

但它并没有产生一个有效的 Yate 二进制文件:

make[1]: Leaving directory '/home/yate/yate-rc-2/yate/conf.d'
make: *** [Makefile:259: install-api] Error 1
c arm64
2个回答
1
投票

您应用的补丁确实是为arm64构建Yate所必需的

如果运行 install-noapi,安装将顺利完成:

sudo make install-noapi

0
投票

您好,我的设备是bladeRF Micro XA4,我无法修复此错误,您能帮助我吗?

© www.soinside.com 2019 - 2024. All rights reserved.