невозможно выполнить двоичный файл: ошибка формата Exec для пользовательского слоя Yocto - PullRequest
0 голосов
/ 04 мая 2018

Я хочу создать слой Yocto для репозитория CANBOAT для платы phyBOARD Mira , который будет подключен к NMEA2000 на лодке. Я хотел бы прочитать различные значения PGN и сохранить его в базе данных.

Конфигурация

У меня есть виртуальная машина Linux (Ubuntu 16.04 LTS)

Linux ubuntu 4.13.0-39-generic #44~16.04.1-Ubuntu SMP Thu Apr 5 16:43:10 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

У меня есть все слои meta в папке с именем sources в $YOCTO_DIR. В sources я создал слой meta-canboat со следующей структурой:

├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-canboat
    └── canboat
        └── canboat.bb

canboat.bb основан на Yocto-Mega-Manual для Makefile

SUMMARY = "CANBOAT"
SECTION = "base"
LICENSE = "GPLv3"
#DEPENDS = "xsltproc"

LIC_FILES_CHKSUM = "file://GPL;md5=05507c6da2404b0e88fe5a152fd12540"

S = "${WORKDIR}/git"

SRC_URI = "git://github.com/canboat/canboat.git;branch=${SRCBRANCH}"
SRCBRANCH = "master"
SRCREV = "93b2ebfb334d7a9750b6947d3a4af9b091be2432"

do_compile() {// this is not necessary for Yocto
    make
}
do_install() { // for Makefile Packages do_install is necessary
   oe_runmake install DESTDIR=${D}
}

сборка и ошибка

в каталоге build, который я выполняю

  bitbake canboat

и получите журнал ошибок:

| DEBUG: Executing shell function do_compile
| mkdir -p rel/linux-x86_64
| for dir in actisense-serial analyzer n2kd nmea0183 ip group-function candump2analyzer socketcan-writer; do make -C $dir; done
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/actisense-serial'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/actisense-serial -I../common actisense-serial.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/actisense-serial'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/analyzer -I../common pgn.c analyzer.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/n2kd'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/n2kd -I../common main.c gps_ais.c nmea0183.c ../common/common.c -lm
| cp n2kd_monitor ../rel/linux-x86_64/n2kd_monitor
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/n2kd'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/nmea0183'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/nmea0183-serial  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -I../common nmeareader.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/nmea0183'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/ip'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/iptee  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -I../common iptee.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/ip'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/group-function'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/command-group-function -I../common command.c ../common/common.c
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/request-group-function -I../common request.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/group-function'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/candump2analyzer'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/candump2analyzer -I../common candump2analyzer.c ../common/common.c -lm
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/candump2analyzer'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/socketcan-writer'
| arm-phytec-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3   -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3=  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/socketcan-writer -I../analyzer -I../common socketcan-writer.c ../analyzer/pgn.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/socketcan-writer'
| make -C analyzer json
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| ../rel/linux-x86_64/analyzer -explain-xml >pgns.xml && xsltproc pgns2json.xslt pgns.xml >pgns.json

| / bin / sh: ../rel/linux-x86_64/analyzer: невозможно выполнить двоичный файл: ошибка формата Exec

| Makefile:33: recipe for target 'json' failed
| make[1]: *** [json] Error 126
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| Makefile:29: recipe for target 'all' failed
| make: *** [all] Error 2
| WARNING: /opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/temp/run.do_compile.47581:1 exit 2 from 'make'
| ERROR: Function failed: do_compile (log file is located at /opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/temp/log.do_compile.47581)

Я понимаю, что может быть несовместимость для -x86_64 двоичных файлов на gnueabi платформах. Как я могу скомпилировать этот репозиторий, чтобы преодолеть эту несовместимость?

GitHub Repo

мета-canboat

1 Ответ

0 голосов
/ 04 мая 2018

Ответ зависит от того, что делает двоичный файл: зависят ли результаты двоичного файла от архитектуры, на которой работает инструмент? Если вы добавите детали к вопросу, кто-то может предоставить более подробный ответ.

Вариант 1. Если результаты инструмента не зависят от архитектуры, вы можете сначала скомпилировать «нативную» (то есть сборку хоста) версию canboat, а затем убедиться, что целевая сборка зависит от нативной и использует инструменты из родная сборка. Это будет означать небольшие изменения в рецепте и некоторые изменения в Makefiles

Вариант 2: Если результаты зависят от арки, возможно, вам придется использовать qemu для запуска инструмента.

Есть примеры обоих случаев внутри убогих источников.

Возможен и третий вариант: если файлы не нужны для успешной сборки, вы можете запустить инструмент в сценарии postinstall при первой загрузке / установке (и изменить систему сборки, чтобы она не выполнялась во время сборки) .

...