OpenIPC / firmware

Alternative IP Camera firmware from an open community
https://openipc.org
MIT License
1.25k stars 239 forks source link

Compile does not work for xm510 #45

Closed schneemaier closed 3 years ago

schneemaier commented 3 years ago

After a succesful build for xm530 i tried to build the system for xm510. I did not change any setting and on the first try i ended up with the following error

In file included from include/linux/compiler.h:48:0,
                 from include/linux/stddef.h:4,
                 from include/linux/posix_types.h:4,
                 from include/linux/types.h:17,
                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc.h:99:1: fatal error: linux/compiler-gcc7.h: No such file or directory
 #include gcc_header(__GNUC__)
 ^~~~
compilation terminated.
make[3]: *** [/media/schnee/Data2/Workspace/openipc-2.1/output/build/linux-3.0.101/./Kbuild:36: kernel/bounds.s] Error 1
make[2]: *** [Makefile:985: prepare0] Error 2
make[2]: *** Waiting for unfinished jobs....
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
make[2]: Leaving directory '/media/schnee/Data2/Workspace/openipc-2.1/output/build/linux-3.0.101'
make[1]: *** [package/pkg-generic.mk:269: /media/schnee/Data2/Workspace/openipc-2.1/output/build/linux-3.0.101/.stamp_built] Error 2
make[1]: Leaving directory '/media/schnee/Data2/Workspace/openipc-2.1/buildroot-2020.02.12'
make: *** [Makefile:91: all] Error 2

This was an easy fix with copying compiler-gcc7.h from openipc-2.1/br-ext-chip-hisilicon/board/hi3516cv300/kernel/overlay to br-ext-chip-xiongmai/board/xm510/kernel/overlay/include/linux

After this the compile fails wtih the following error:

In file included from tools/env/fw_env.c:40:0:
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:329:3: error: conflicting types for ‘__packed’
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:313:3: note: previous declaration of ‘__packed’ was here
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:371:3: error: conflicting types for ‘__packed’
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:313:3: note: previous declaration of ‘__packed’ was here
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:386:3: error: conflicting types for ‘__packed’
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:313:3: note: previous declaration of ‘__packed’ was here
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:398:3: error: conflicting types for ‘__packed’
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:313:3: note: previous declaration of ‘__packed’ was here
 } __packed;
   ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:412:4: error: conflicting types for ‘__packed’
 }  __packed;
    ^~~~~~~~
/media/schnee/Data2/Workspace/openipc-2.1/output/per-package/fwprintenv-openipc/host/arm-openipc-linux-musleabi/sysroot/usr/include/mtd/ubi-user.h:313:3: note: previous declaration of ‘__packed’ was here
 } __packed;
   ^~~~~~~~
tools/env/fw_env.c: In function ‘detect_env’:
tools/env/fw_env.c:1770:7: warning: ‘return’ with no value, in function returning non-void
       return;
       ^~~~~~
tools/env/fw_env.c:1748:12: note: declared here
 static int detect_env() {
            ^~~~~~~~~~
make[3]: *** [scripts/Makefile.host:114: tools/env/fw_env.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:1925: envtools] Error 2
make[2]: Leaving directory '/media/schnee/Data2/Workspace/openipc-2.1/output/build/fwprintenv-openipc-2020.04'
make[1]: *** [package/pkg-generic.mk:269: /media/schnee/Data2/Workspace/openipc-2.1/output/build/fwprintenv-openipc-2020.04/.stamp_built] Error 2
make[1]: Leaving directory '/media/schnee/Data2/Workspace/openipc-2.1/buildroot-2020.02.12'
make: *** [Makefile:91: all] Error 2

I am not sure where the tools/env/fw_env.c file is which needs some patching

ZigFisher commented 3 years ago

Good afternoon Thank you for the information, I will make a check soon

ZigFisher commented 3 years ago

Fixed, thanks