0

I am trying to cross compile espeak-ng for target=arm-linux-gnueabihf

The sudo make install step gives the following error :

~:~/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

I have cross compiled using the following :

./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

Configure output

    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

Output for make command:

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

  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

Make install output

~/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

  • The `Exec format error` most probably means that you have compiled the program with different compiler then the target architecture. Most probably `make` prints the compile commands - please show the output of `make` and maybe the output of `configure`. – KamilCuk Apr 24 '20 at 06:22
  • updated the configue and make outputs – Simran Kaur Apr 24 '20 at 10:19
  • Well, `make` is trying to execute `src/espeak-ng` on your local machine - that is going to fail. Inspect what does `--compile-phonemes` and --compile-intonations` do and see if you can do that on your host. – KamilCuk Apr 24 '20 at 10:47
  • I am a beginner at cross compile and espeak can you help provide some reference for --compile-phonemes – Simran Kaur Apr 24 '20 at 12:48

0 Answers0