Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware Build Failing #28

Open
rayxke opened this issue Jun 13, 2024 · 4 comments
Open

Middleware Build Failing #28

rayxke opened this issue Jun 13, 2024 · 4 comments

Comments

@rayxke
Copy link

rayxke commented Jun 13, 2024

Problem

Middleware build is failing.

Environment

Ubuntu Docker Container (from host/ubuntu) on M1 MacBook Air.

Question(s)

Should the "build all" command result in a completed image? I ask because even though I got a build middleware failed result, the install directory has quite a few files so I'm not sure if I need to run another command to create an image? Or is fixing this middleware failure is necessary.

Contents in the install directory after build:
boot.sd elf fip.bin fip_spl.bin fw_payload_uboot.bin ramboot.itb rawimages rootfs tpu_musl_riscv64

Additional Information

Run build_middleware() function 
make: '/root/LicheeRV-Nano-Build/install/soc_sg2002_licheervnano_sd/rootfs' is up to date.
~/LicheeRV-Nano-Build/middleware/v2 ~/LicheeRV-Nano-Build/build
make[1]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/3rdparty'
make[1]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp'
#################################################
#                                               #
#   Compiling '3rdparty libs' Configs as below  #
pushd sensor/sg200x && \
make all && \
popd;
#                                               #
~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x ~/LicheeRV-Nano-Build/middleware/v2/component/isp
#################################################
make[2]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x'
make[2]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/3rdparty/cli'
pushd  gcore_gc4653 && make all && popd
pushd  ov_os04a10 && make all && popd
pushd  sms_sc035gs && make all && popd
pushd  lontium_lt6911 && make all && popd
~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/gcore_gc4653 ~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x
#################################################
~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/ov_os04a10 ~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x
~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/sms_sc035gs ~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x
~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/lontium_lt6911 ~/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x
make[3]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/ov_os04a10'
make[3]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/lontium_lt6911'
make[3]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/gcore_gc4653'
#
make[3]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x'
make[3]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/sms_sc035gs'
# Compiling 'component libs' Configs as below...
# SENSOR_LIST=gcore_gc4653 ov_os04a10 sms_sc035gs lontium_lt6911
#
make[2]: Leaving directory '/root/LicheeRV-Nano-Build/middleware/v2/3rdparty/cli'
#################################################
/root/LicheeRV-Nano-Build/middleware/v2/3rdparty
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/root/LicheeRV-Nano-Build/middleware/v2/3rdparty/inih'
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o gcore_gc4653/gc4653_cmos.o gcore_gc4653/gc4653_cmos.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o gcore_gc4653/gc4653_sensor_ctl.o gcore_gc4653/gc4653_sensor_ctl.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o ov_os04a10/os04a10_sensor_ctl.o ov_os04a10/os04a10_sensor_ctl.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o ov_os04a10/os04a10_cmos.o ov_os04a10/os04a10_cmos.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o sms_sc035gs/sc035gs_sensor_ctl.o sms_sc035gs/sc035gs_sensor_ctl.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o sms_sc035gs/sc035gs_cmos.o sms_sc035gs/sc035gs_cmos.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o lontium_lt6911/lt6911_cmos.o lontium_lt6911/lt6911_cmos.c
riscv64-unknown-linux-musl-gcc -Os -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d -std=gnu11 -g -Wall -Wextra -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/gdbserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libcrypto/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/libz/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/otaserver/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/rsyslog/include -I/root/LicheeRV-Nano-Build/ramdisk/rootfs/public/crontabs/include -mno-ldd -DARCH_SG200X -D__SOC_MARS__   -c -o lontium_lt6911/lt6911_sensor_ctl.o lontium_lt6911/lt6911_sensor_ctl.c
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[2]: *** Waiting for unfinished jobs....
sms_sc035gs/sc035gs_cmos.c:12:10: fatal error: linux/cvi_type.h: No such file or directory
   12 | #include <linux/cvi_type.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
lontium_lt6911/lt6911_cmos.c:12:10: fatal error: linux/cvi_type.h: No such file or directory
   12 | #include <linux/cvi_type.h>
      |          ^~~~~~~~~~~~~~~~~~
make[3]: *** [<builtin>: sms_sc035gs/sc035gs_cmos.o] Error 1
compilation terminated.
gcore_gc4653/gc4653_sensor_ctl.c:14:10: fatal error: linux/vi_snsr.h: No such file or directory
   14 | #include <linux/vi_snsr.h>
      |          ^~~~~~~~~~~~~~~~~
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
sms_sc035gs/sc035gs_sensor_ctl.c:14:10: fatal error: linux/vi_snsr.h: No such file or directory
   14 | #include <linux/vi_snsr.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
ov_os04a10/os04a10_sensor_ctl.c:14:10: fatal error: linux/vi_snsr.h: No such file or directory
   14 | #include <linux/vi_snsr.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
gcore_gc4653/gc4653_cmos.c:12:10: fatal error: linux/cvi_type.h: No such file or directory
   12 | #include <linux/cvi_type.h>
      |          ^~~~~~~~~~~~~~~~~~
make[3]: *** [<builtin>: gcore_gc4653/gc4653_sensor_ctl.o] Error 1
make[3]: *** write jobserver: Bad file descriptor.  Stop.
compilation terminated.
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/ov_os04a10/os04a10_sensor_ctl.c: In function 'os04a10_init':
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/ov_os04a10/os04a10_sensor_ctl.c:257:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
  257 |  system("devmem 0x0300116C 32 0x3");
      |  ^~~~~~
lontium_lt6911/lt6911_sensor_ctl.c:14:10: fatal error: linux/vi_snsr.h: No such file or directory
   14 | #include <linux/vi_snsr.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:279: all_sensor] Error 1
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[1]: *** [Makefile:9: all] Error 2
make[1]: Leaving directory '/root/LicheeRV-Nano-Build/middleware/v2/component/isp'
make: *** [Makefile:49: component] Error 2
make: *** Waiting for unfinished jobs....
ov_os04a10/os04a10_cmos.c:13:10: fatal error: linux/cvi_type.h: No such file or directory
   13 | #include <linux/cvi_type.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/lontium_lt6911/lt6911_sensor_ctl.c: In function 'lt6911_probe':
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/lontium_lt6911/lt6911_sensor_ctl.c:193:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
  193 |  system("devmem 0x0300116C 32 0x3");
      |  ^~~~~~
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/sms_sc035gs/sc035gs_sensor_ctl.c: In function sc035gs_linear_1296P30_init':
/root/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/sms_sc035gs/sc035gs_sensor_ctl.c:212:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
  212 |  system("devmem 0x0300116C 32 0x3");
      |  ^~~~~~
[riscv64-unknown-linux-musl-gcc] lt6911_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[riscv64-unknown-linux-musl-gcc] sc035gs_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[riscv64-unknown-linux-musl-gcc] lt6911_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
[riscv64-unknown-linux-musl-gcc] os04a10_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[riscv64-unknown-linux-musl-gcc] gc4653_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[riscv64-unknown-linux-musl-gcc] sc035gs_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
[riscv64-unknown-linux-musl-gcc] ini.o
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[1]: *** [Makefile:8: all] Error 1
make[1]: Leaving directory '/root/LicheeRV-Nano-Build/middleware/v2/3rdparty'
make: *** [Makefile:41: 3rdparty] Error 2
 build middleware failed !! 
~/LicheeRV-Nano-Build/build
root@c058ed84e6c2:~/LicheeRV-Nano-Build# [riscv64-unknown-linux-musl-gcc] gc4653_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
[riscv64-unknown-linux-musl-gcc] os04a10_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
@rayxke
Copy link
Author

rayxke commented Jun 15, 2024

Looks like this is a problem with Docker for MacOS. I was just able to build the image using Ubuntu on Docker for Windows 11. I'll update if I find anything that helps with Docker for MacOS.

@rayxke
Copy link
Author

rayxke commented Jun 16, 2024

Adding more info in case anyone else tries to debug this problem. I was able to get the build_middleware function to complete by disabling parallel execution. I did this by changing Line 239 in the envsetup_soc.sh from

make -j${nrpoc}

to

make -j1

Now I'm running into problems with the br-pack-rootfs function which also has parallel execution enabled. However, disabling parallel execution has not resolved this build failure. Will update with the build fail logs as well as any progress in debugging.

@yohcha
Copy link

yohcha commented Jun 25, 2024

Same errors in ArchLinux.

@yohcha
Copy link

yohcha commented Jun 26, 2024

Using ubuntu docker (host/ubuntu) with command build_middleware, still have those problems.

INFORMATION:

Apptainer> build_middleware
 Run build_middleware() function
make: '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/install/soc_sg2002_licheervnano_sd/rootfs' is up to date.
~/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2 ~/code/licheerv_nano/LicheeRV-Nano-Build/build
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty'
make[1]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp'
#################################################
#                                               #
pushd sensor/sg200x && \
make all && \
popd;
#   Compiling '3rdparty libs' Configs as below  #
~/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x ~/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp
#                                               #
make[2]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x'
#################################################
make[2]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty/cli'
#################################################
#
# Compiling 'component libs' Configs as below...
# SENSOR_LIST=gcore_gc4653 ov_os04a10 sms_sc035gs lontium_lt6911
#
#################################################
pushd  gcore_gc4653 && make all && popd
~/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/gcore_gc4653 ~/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x
make[3]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/gcore_gc4653'
make[2]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty/cli'
/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty
make[2]: Entering directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty/inih'
/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/gcore_gc4653/gc4653_cmos.c:12:10: fatal error: linux/cvi_type.h: No such file or directory
   12 | #include <linux/cvi_type.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:22: /home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/sg200x/gcore_gc4653/gc4653_cmos.o] Error 1
make[3]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x/gcore_gc4653'
make[2]: *** [Makefile:78: gcore_gc4653] Error 2
make[2]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp/sensor/cv182x'
make[1]: *** [Makefile:9: all] Error 2
make[1]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/component/isp'
make: *** [Makefile:49: component] Error 2
make: *** Waiting for unfinished jobs....
[riscv64-unknown-linux-musl-gcc] ini.o
[LINK][riscv64-unknown-linux-musl-ar] libini.a
[LINK][riscv64-unknown-linux-musl-ld] libini.so
make[2]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty/inih'
/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty
make[1]: Leaving directory '/home/yohcha/code/licheerv_nano/LicheeRV-Nano-Build/middleware/v2/3rdparty'
 build middleware failed !!
~/code/licheerv_nano/LicheeRV-Nano-Build/build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants