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

build fails with a fatal error: config.h: No such file or directory #15

Open
nihalpasham opened this issue Jan 10, 2023 · 2 comments
Open

Comments

@nihalpasham
Copy link

tried to build the imx8mevk target and ran into the following compilation error.

Output:

npashi@regionaltantrums: /mnt/shared/devspace/rust/projects/exp/punchboot$ make SHELL='sh -x' CROSS_COMPILE=aarch64-linux-gnu- BOARD=board/imx8mevk MKIMAGE=mkimage_imx8
+ which python3
+ BOARD=board/imx8mevk /bin/python3 scripts/genconfig.py
scripts/genconfig.py: [Errno 21] Is a directory: 'Kconfig'
+ mkdir -p build-imx8mevk
+ which bpak
+ git describe --abbrev=4 --dirty --always --tags
+ echo GEN build-imx8mevk/keystore.c
GEN build-imx8mevk/keystore.c
+ /usr/local/bin/bpak generate keystore --name pb pki/internal_keystore.bpak --decorate
+ aarch64-linux-gnu-gcc -c -std=c99 -Os -nostdlib -nostartfiles -ffunction-sections -fdata-sections -fno-omit-frame-pointer -DPB_VERSION="v0.10.0-dirty" -DLOGLEVEL=3 -DTIMING_REPORT=0 -fno-common -fno-builtin -ffreestanding -fno-exceptions -fstack-usage -MMD -MP -I lib/fdt/include -I lib/uuid/ -I. -I include/ -I lib/ -I include -I include/pb/libc -I board/imx8mevk/include -Wall -Wextra -Wunused-result -Wunused -Wdisabled-optimization -Wvla -Wshadow -Wno-unused-parameter -Wextra -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Waggregate-return -I include/pb/xlat_tables -I include/pb/xlat_tables/aarch64 -march=armv8-a -DAARCH64 -mstrict-align -mgeneral-regs-only -I arch/armv8a/include -I include/pb/libc/aarch64 -I plat/imx8m/include build-imx8mevk/keystore.c -o build-imx8mevk/keystore.o
+ git describe --abbrev=4 --dirty --always --tags
+ mkdir -p build-imx8mevk
+ echo CC main.c
CC main.c
+ aarch64-linux-gnu-gcc -c -std=c99 -Os -nostdlib -nostartfiles -ffunction-sections -fdata-sections -fno-omit-frame-pointer -DPB_VERSION="v0.10.0-dirty" -DLOGLEVEL=3 -DTIMING_REPORT=0 -fno-common -fno-builtin -ffreestanding -fno-exceptions -fstack-usage -MMD -MP -I lib/fdt/include -I lib/uuid/ -I. -I include/ -I lib/ -I include -I include/pb/libc -I board/imx8mevk/include -Wall -Wextra -Wunused-result -Wunused -Wdisabled-optimization -Wvla -Wshadow -Wno-unused-parameter -Wextra -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Waggregate-return -I include/pb/xlat_tables -I include/pb/xlat_tables/aarch64 -march=armv8-a -DAARCH64 -mstrict-align -mgeneral-regs-only -I arch/armv8a/include -I include/pb/libc/aarch64 -I plat/imx8m/include main.c -o build-imx8mevk/main.o
In file included from main.c:12:
include/pb/pb.h:18:10: fatal error: config.h: No such file or directory
   18 | #include <config.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:152: build-imx8mevk/main.o] Error 1

On another note: I've been working on a similar project - rustBoot and am looking to add support for the NXP i.MX8 chip-set. I'm hoping you could point me in the right direction w.r.t a couple of questions.

  1. I couldn't find documentation on NXP's container format. Would you happen to know where I could find details on the container-layout (i.e. which bytes mean what). Also is there a tool (of some sort) that can be used to inspect these containers.
  2. I presume ROM-code uses container (fields) to determine where to load and execute the next-stage bootloader.
@jonasblixt
Copy link
Owner

jonasblixt commented Jan 16, 2023 via email

@nihalpasham
Copy link
Author

nihalpasham commented Jan 16, 2023

The missing config.h makes me wonder if you copied a configuration, try copying "configs/imx8mevk_defconfig" to ".config" in the source root.

without a .config in the source root, I get a different make error.

npashi@regionaltantrums: /mnt/shared/devspace/rust/projects/exp/punchboot$ make SHELL='sh -x' CROSS_COMPILE=aarch64-linux-gnu- BOARD=board/imx8mevk MKIMAGE=mkimage_imx8
+ which python3
+ BOARD=board/imx8mevk /bin/python3 scripts/genconfig.py
scripts/genconfig.py: [Errno 21] Is a directory: 'Kconfig'
+ mkdir -p build-imx8mevk
Makefile:23: .config: No such file or directory
make: *** No rule to make target '.config'. Stop.

with the new changes pulled-in, I seem to still run into the same error.

npashi@regionaltantrums: /mnt/shared/devspace/rust/projects/exp/punchboot$ git pull
Already up to date.
npashi@regionaltantrums: /mnt/shared/devspace/rust/projects/exp/punchboot$ cp configs/imx8mevk_defconfig .config
npashi@regionaltantrums: /mnt/shared/devspace/rust/projects/exp/punchboot$ make SHELL='sh -x' CROSS_COMPILE=aarch64-linux-gnu- BOARD=board/imx8mevk MKIMAGE=mkimage_imx8
+ which python3
+ BOARD=board/imx8mevk /bin/python3 scripts/genconfig.py
scripts/genconfig.py: [Errno 21] Is a directory: 'Kconfig'
+ mkdir -p build-imx8mevk
+ which bpak
+ git describe --abbrev=4 --dirty --always --tags
+ echo GEN build-imx8mevk/keystore.c
GEN build-imx8mevk/keystore.c
+ /usr/local/bin/bpak generate keystore --name pb pki/internal_keystore.bpak --decorate
+ aarch64-linux-gnu-gcc -c -std=c99 -Os -nostdlib -nostartfiles -ffunction-sections -fdata-sections -fno-omit-frame-pointer -DPB_VERSION="v0.10.0-2-g4df9-dirty" -DLOGLEVEL=3 -DTIMING_REPORT=0 -fno-common -fno-builtin -ffreestanding -fno-exceptions -fstack-usage -MMD -MP -I lib/fdt/include -I lib/uuid/ -I. -I include/ -I lib/ -I include -I include/pb/libc -I board/imx8mevk/include -Wall -Wextra -Wunused-result -Wunused -Wdisabled-optimization -Wvla -Wshadow -Wno-unused-parameter -Wextra -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Waggregate-return -I include/pb/xlat_tables -I include/pb/xlat_tables/aarch64 -march=armv8-a -DAARCH64 -mstrict-align -mgeneral-regs-only -I arch/armv8a/include -I include/pb/libc/aarch64 -I plat/imx8m/include build-imx8mevk/keystore.c -o build-imx8mevk/keystore.o
+ git describe --abbrev=4 --dirty --always --tags
+ mkdir -p build-imx8mevk
+ echo CC main.c
CC main.c
+ aarch64-linux-gnu-gcc -c -std=c99 -Os -nostdlib -nostartfiles -ffunction-sections -fdata-sections -fno-omit-frame-pointer -DPB_VERSION="v0.10.0-2-g4df9-dirty" -DLOGLEVEL=3 -DTIMING_REPORT=0 -fno-common -fno-builtin -ffreestanding -fno-exceptions -fstack-usage -MMD -MP -I lib/fdt/include -I lib/uuid/ -I. -I include/ -I lib/ -I include -I include/pb/libc -I board/imx8mevk/include -Wall -Wextra -Wunused-result -Wunused -Wdisabled-optimization -Wvla -Wshadow -Wno-unused-parameter -Wextra -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Waggregate-return -I include/pb/xlat_tables -I include/pb/xlat_tables/aarch64 -march=armv8-a -DAARCH64 -mstrict-align -mgeneral-regs-only -I arch/armv8a/include -I include/pb/libc/aarch64 -I plat/imx8m/include main.c -o build-imx8mevk/main.o
In file included from main.c:12:
include/pb/pb.h:18:10: fatal error: config.h: No such file or directory
   18 | #include <config.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:152: build-imx8mevk/main.o] Error 1

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