首页 > 解决方案 > espeak-ng 交叉编译使安装问题

问题描述

我正在尝试为 target=arm-linux-gnueabihf 交叉编译 espeak-ng

sudo make install 步骤给出以下错误:

~:~/Downloads/Dependencies/espeak-ng-master$ sudo make install
[sudo] password for abc: 
ESPEAK_DATA_PATH=../Downloads/Dependencies/espeak-ng-master src/espeak-ng --compile-intonations && \
    ESPEAK_DATA_PATH=../Downloads/Dependencies/espeak-ng-master src/espeak-ng --compile-phonemes && \
    touch phsource/phonemes.stamp
src/espeak-ng: line 117: ../Downloads/Dependencies/espeak-ng-master/src/.libs/espeak-ng: cannot execute binary file: Exec format error
src/espeak-ng: line 117: ../Downloads/Dependencies/espeak-ng-master/src/.libs/espeak-ng: Success
Makefile:2590: recipe for target 'phsource/phonemes.stamp' failed
make: *** [phsource/phonemes.stamp] Error 126

我使用以下代码进行了交叉编译:

./configure   CC=arm-linux-gnueabihf-gcc -prefix /opt/myproject-sysroot/usr --build=$MACHTYPE --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

make -B src/speak-ng src/espeak-ng

配置输出

    Configuration for eSpeak NG complete.

        Source code location:          .

        C99 Compiler:                  arm-linux-gnueabihf-gcc
        C99 Compiler flags:            -Wunused-parameter -Wunused -Wuninitialized -Wreturn-type -Wmissing-prototypes -Wimplicit -g -O2 -std=c99

        Sonic:                         no
        PCAudioLib:                    no

        gradle (Android):              gradle
        ndk-build (Android):           

        Klatt:                         yes
        MBROLA:                        yes
        Async:                         yes

        Extended Dictionaries:
            Russian:                   no
            Chinese (Mandarin):        no
            Chinese (Cantonese):       no

~/Downloads/Dependencies/ESPEAK/espeak-ng-master$ sudo make -B src/speak-ng src/espeak-ng

make 命令的输出:

---------------
-----------

  CC       src/libespeak-ng/src_libespeak_ng_la-tr_languages.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-voices.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-wavegen.lo
src/libespeak-ng/wavegen.c: In function ‘WavegenFill’:
src/libespeak-ng/wavegen.c:1400:17: warning: variable ‘p_start’ set but not used [-Wunused-but-set-variable]
  unsigned char *p_start;
                 ^~~~~~~
  CC       src/libespeak-ng/src_libespeak_ng_la-klatt.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-mbrowrap.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-espeak_command.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-event.lo
  CC       src/libespeak-ng/src_libespeak_ng_la-fifo.lo
  CCLD     src/libespeak-ng.la
arm-linux-gnueabihf-ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     src/speak-ng
  CC       src/espeak-ng.o
src/espeak-ng.c: In function ‘main’:
src/espeak-ng.c:744:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(p_text, 1, filesize, f_text);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CCLD     src/espeak-ng

制作安装输出

~/Downloads/Dependencies/ESPEAK/espeak-ng-master$ sudo make LIBDIR=/opt/myproject-sysroot/usr install

ESPEAK_DATA_PATH=../Downloads/Dependencies/ESPEAK/espeak-ng-master src/espeak-ng --compile-intonations && \
    ESPEAK_DATA_PATH=../Downloads/Dependencies/ESPEAK/espeak-ng-master src/espeak-ng --compile-phonemes && \
    touch phsource/phonemes.stamp
src/espeak-ng: line 117: ../Downloads/Dependencies/ESPEAK/espeak-ng-master/src/.libs/espeak-ng: cannot execute binary file: Exec format error
src/espeak-ng: line 117: ../Downloads/Dependencies/ESPEAK/espeak-ng-master/src/.libs/espeak-ng: Success
Makefile:2590: recipe for target 'phsource/phonemes.stamp' failed
make: *** [phsource/phonemes.stamp] Error 126

标签: linuxcross-compilingespeak

解决方案


推荐阅读