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

failed to build rock5b #13

Open
edwardzhou opened this issue Feb 24, 2023 · 30 comments
Open

failed to build rock5b #13

edwardzhou opened this issue Feb 24, 2023 · 30 comments

Comments

@edwardzhou
Copy link

following the instruction in READE for build rock5b, got below error

  CC      examples/standalone/hello_world.o
  LD      examples/standalone/hello_world
  OBJCOPY examples/standalone/hello_world.srec
  OBJCOPY examples/standalone/hello_world.bin
  LDS     u-boot.lds
  LD      u-boot
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: in function `fdt_fixup_modules':
/root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_u_boot_list_2_driver_2_rockchip_otp' which may bind externally can not be used when making a shared object; recompile with -fPIC
/root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164:(.text.rk_board_dm_fdt_fixup+0xc): dangerous relocation: unsupported relocation
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: /root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
make[2]: *** [Makefile:1284: u-boot] Error 1
make[1]: *** [Makefile:461: __build_one_by_one] Error 2
make[1]: Leaving directory '/root/buildroot/output/build/uboot-stable-5.10-rock5'
make: *** [boot/uboot/uboot.mk:533: /root/buildroot/output/build/uboot-stable-5.10-rock5/.stamp_dotconfig] Error 2
@c3charvat
Copy link

Got the same thing

@prubin100
Copy link

prubin100 commented May 2, 2023

Has this been looked into yet? I am seeing the exact same error as OP when building for the Rock 5b (RK3588).

@flatmax
Copy link
Owner

flatmax commented May 2, 2023

I just did a test build and there were no failures. I got a full image compiled.

Can you confirm that you have all of the requirements installed ? Even python2 ?

@prubin100
Copy link

Thank you for following up.

I had not installed python2 as the readme indicated it was needed if building for the cm3 and rock3 derivatives. That said, I did install it, ran make clean and then re-ran make and hit the same error:

  CC      examples/standalone/hello_world.o
  LD      examples/standalone/libstubs.o
  LD      examples/standalone/hello_world
  OBJCOPY examples/standalone/hello_world.srec
  OBJCOPY examples/standalone/hello_world.bin
  LD      u-boot
/home/paul/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: in function `fdt_fixup_modules':
/home/paul/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
/home/paul/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_u_boot_list_2_driver_2_rockchip_otp' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/paul/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164:(.text.rk_board_dm_fdt_fixup+0xc): dangerous relocation: unsupported relocation
/home/paul/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: /home/paul/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
make[3]: *** [Makefile:1284: u-boot] Error 1
make[2]: *** [Makefile:461: __build_one_by_one] Error 2
make[1]: *** [boot/uboot/uboot.mk:533: /home/paul/buildroot/output/build/uboot-stable-5.10-rock5/.stamp_dotconfig] Error 2
make: *** [Makefile:84: _all] Error 2

@flatmax
Copy link
Owner

flatmax commented May 3, 2023

What system are you building on ? OS ?

@prubin100
Copy link

prubin100 commented May 3, 2023

I was originally using Ubuntu Desktop 20.04 LTS running under VMWare (under Windows 11). It had been some time since I had built that VM, so I made a fresh VM with Ubuntu Desktop 23.04. Unfortunately, I encountered the same error.

For the sake of completeness, with the fresh version of 23.04 installed, I performed the following from the /home/paul directory:

  1. Cloned buildroot: git clone git://git.busybox.net/buildroot buildroot
  2. Installed prerequisites: sudo apt-get install -y build-essential gcc g++ autoconf automake libtool bison flex gettext
    sudo apt-get install -y patch texinfo wget git gawk curl lzma bc quilt
  3. Tried to install Python 2. This failed (E: Package 'python2' has no installation candidate): sudo apt install python2
  4. Cloned the external buildroot tree: git clone https://github.com/flatmax/buildroot.rockchip.git buildroot.rockchip.ext
  5. Ran the shell script for the Raxda Rock 5b board: source buildroot.rockchip.ext/setup.rock5b.sh /home/paul/buildroot
  6. Made a buildroot dowloads directory: mkdir ../buildroot.dl
  7. ran make

I ran the build without having python 2 since installing it on my 20.04 VM did not make a difference.

I did note the following prompts were not automatically answered by the build, but I do not believe my responses resulted in the build error(s) I am seeing:

Support Rockchip RK3528 (ROCKCHIP_RK3528) [N/y/?] (NEW)
Support Rockchip RK3562 (ROCKCHIP_RK3562) [N/y/?] (NEW)
Rockchip hotkey (ROCKCHIP_HOTKEY) [Y/n/?] (NEW)
Print log to linux pstore buffer (PSTORE) [N/y/?] (NEW)
Support BL33 runs as AArch32 mode (SPL_ATF_AARCH32_BL33) [N/y/?] (NEW)
Enable GPIO hog support (GPIO_HOG) [N/y/?] (NEW)
SKYHIGH SPI flash support (SPI_NAND_SKYHIGH) [Y/n/?] (NEW)
BOYA SPI flash support (SPI_FLASH_BOYA) [N/y/?] (NEW)
NORMEM SPI flash support (SPI_FLASH_NORMEM) [N/y/?] (NEW)
Maxim deserializer panel driver (DRM_PANEL_MAXIM_DESERIALIZER) [N/y/?] (NEW)
Rockchip TVE Support (DRM_ROCKCHIP_TVE) [N/y/?] (NEW)

Thanks again for the help; I must be doing something wrong.

@flatmax
Copy link
Owner

flatmax commented May 3, 2023

ok - a few issues here...

You need to checkout a particular version of buildroot. According to the readme :

git checkout 2022.05

Second of all I am pretty sure that the version of uboot sourced still required python2. Here are a few solution ideas for that problem :
1] Downgrade ubuntu to one which provides python2 as an installation candidate
2] Workout how to install the simplest implementation of python2 on your current ubuntu system.
3] Check if they have updated uboot yet to use python3 : https://github.com/radxa/u-boot/tree/stable-5.10-rock5 . If they have then bump the version of uboot to download in the board's config file.

@prubin100
Copy link

Once again, thank you for the follow up.

I actually had done the git checkout 2022.05, but did neglect to put it into my notes. Thank you for catching that.

I went all the way back to Ubuntu 18.04 and had not issues getting python installed. It did require sudo apt install python-minimal, but performing python2 -v shows 2,7.17 installed.

I did check the repo you reference and it does indeed still require python2, but there is a check in the make file to see if python2 is installed and an error is thrown if it is not found. I do not see that error, so I think there is a different issue.

The following is what I did under Ubuntu 18.04 and still I see the same error.

  1. Cloned buildroot: git clone git://git.busybox.net/buildroot buildroot
  2. Checkout for Rock 5b tested with version: git checkout 2022.05
  3. Installed prerequisites: sudo apt-get install -y build-essential gcc g++ autoconf automake libtool bison flex gettext
  4. sudo apt-get install -y patch texinfo wget git gawk curl lzma bc quilt
  5. Install python2: sudo apt install python-minimal
  6. Cloned the external buildroot tree: git clone https://github.com/flatmax/buildroot.rockchip.git buildroot.rockchip.ext
  7. Ran the shell script for the Raxda Rock 5b board: source buildroot.rockchip.ext/setup.rock5b.sh /home/paul/buildroot
  8. Made a buildroot dowloads directory: mkdir ../buildroot.dl
  9. ran make

May I please ask what environment you used to run a test build?

@flatmax
Copy link
Owner

flatmax commented May 4, 2023

I've built this on various machines, ubuntu 22.04 and 22.10 for example.

@flatmax
Copy link
Owner

flatmax commented May 10, 2023

It is possible that pre-reqs are missing yes. When/if you find them, please let me know.

@akkusativk
Copy link

akkusativk commented Jun 6, 2023

I got it working for the Rock 5b. Here are my steps:

  1. I use the buildroot branch "2022.05.x", which corresponds to the tag 2022.05.3 (commit 4dc1fffca0)

However this caused uboot to break during build due to some code references which could not be resolved. I had a look and was confident, that the code which caused the error is not needed for the RK3588 (but for some other SoC), so I created the following patch.

  1. Copy the following contents into a file "buildroot.rockchip.ext/patches.rk3588/uboot/004-rockchip-otp.patch":
Index: uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c
===================================================================
--- uboot-stable-5.10-rock5.orig/arch/arm/mach-rockchip/rk3588/rk3588.c
+++ uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c
@@ -1161,8 +1161,10 @@
 	u8 cpu_mask;
 	int ret;
 
-	ret = uclass_get_device_by_driver(UCLASS_MISC,
-					  DM_GET_DRIVER(rockchip_otp), &dev);
+	/* ret = uclass_get_device_by_driver(UCLASS_MISC, */
+					  /* DM_GET_DRIVER(rockchip_otp), &dev); */
+	return 0;
+
 	if (ret) {
 		printf("can't get otp device, ret=%d\n", ret);
 		return ret;

Afterwards it did build and I could boot it.

@flatmax would you like that we change the recommended version in the readme to "2022.05.x"or tag "2022.05.3" and add the patch to your repo? If so (I have actually never done this before) how should I do it? May I create a pull request?

@akkusativk
Copy link

@edwardzhou the actual reason why I tried buildroot version "2022.05.x" aka. tag "2022.05.3", is, that I also got some error during compilation before. I however don't recall it. But it might have been the same as you. After changing I then ran into the uboot issue, hence I created the abovementioned patch.

@akkusativk
Copy link

@prubin100 I just realize, that my patch (at first glance) corresponds to the error you report. Maybe just try integrating my patch - it might work.

@prubin100
Copy link

Hi @akkusativk. Thank you for spending time on this issue and posting your findings. Curiously, I was still not able to build following your suggestion. I still receive the same error. It's as if the "buildroot.rockchip.ext/patches.rk3588/uboot/004-rockchip-otp.patch" file is being ignored - the lines of code it seeks to comment out look to still be compiling and thus the same error. I am not an expert on buildroot, but it does seem like the patch file should have been processed by virtue of its location.

@bmclapham1973
Copy link

@flatmax I am also unable to successfully compile. I have the same result as @prubin100. The only difference in my setup is that I attempted it on Debian 12. Thoughts?

@akkusativk Applying the patch you described had no impact on my result.

@flatmax
Copy link
Owner

flatmax commented Jun 15, 2023

@prubin100 @bmclapham1973 please describe your issues here. What is the error you face ?

Here are my steps (switch for your correct paths below) :

source ~/temp/buildroot.rockchip/setup.rock5b.sh /home/name.unencrypted/buildroot.rk3588/
make distclean
git checkout 2022.05
source ~/temp/buildroot.rockchip/setup.rock5b.sh /home/name.unencrypted/buildroot.rk3588/
make

@bmclapham1973
Copy link

Here is my error:

CC drivers/usb/gadget/f_fastboot.o
CC lib/display_options.o
LD lib/built-in.o
LD drivers/usb/gadget/built-in.o
LD u-boot
/app/buildroot/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: in function fdt_fixup_modules': /app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to _u_boot_list_2_driver_2_rockchip_otp'
/app/buildroot/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _u_boot_list_2_driver_2_rockchip_otp' which may bind externally can not be used when making a shared object; recompile with -fPIC /app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164:(.text.rk_board_dm_fdt_fixup+0xc): dangerous relocation: unsupported relocation /app/buildroot/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: /app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to _u_boot_list_2_driver_2_rockchip_otp'
make[2]: *** [Makefile:1284: u-boot] Error 1
make[1]: *** [Makefile:461: __build_one_by_one] Error 2
make[1]: Leaving directory '/app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5'
make: *** [boot/uboot/uboot.mk:533: /app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5/.stamp_dotconfig] Error 2

@bmclapham1973
Copy link

@flatmax I got the same error after following your same steps:

source ~/temp/buildroot.rockchip/setup.rock5b.sh /home/name.unencrypted/buildroot.rk3588/
make distclean
git checkout 2022.05
source ~/temp/buildroot.rockchip/setup.rock5b.sh /home/name.unencrypted/buildroot.rk3588/
make

@flatmax
Copy link
Owner

flatmax commented Jun 15, 2023

can you confirm you have python2 on your system ?

what is the output of python2 when you execute it ?!

@bmclapham1973
Copy link

@flatmax
bash: python2: command not found

@prubin100
Copy link

@flatmax I also tried the additional steps you recommended. I did not get the error I had previously seen and which @bmclapham1973 is now seeing but instead a new error. Below is the section of the output leading up to and including the build error. It's odd, it can't find a file related to openssl but clearly in a section related to the rk3588 when the error occurs.

For what it's worth I had previously reverted (per my comments above) to Ubuntu 18.04 and installed python2, but doing so never helped with the error I had been seeing and which @bmclapham1973 is seeing now.

I am going to make clean and try the build again to see if it was a fluke or recurs.


`# As the kernel gets compiled before root filesystems are

built, we create a fake cpio file. It'll be

replaced later by the real cpio archive, and the kernel will be

rebuilt using the linux-rebuild-with-initramfs target.

/usr/bin/sed -i -e "/\<CONFIG_DEVTMPFS\>/d" /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
echo 'CONFIG_DEVTMPFS=y' >> /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
/usr/bin/sed -i -e "/\<CONFIG_DEVTMPFS_MOUNT\>/d" /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
echo 'CONFIG_DEVTMPFS_MOUNT=y' >> /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
/usr/bin/sed -i -e "/\<CONFIG_GCC_PLUGINS\>/d" /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
echo '# CONFIG_GCC_PLUGINS is not set' >> /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config

configuration written to .config

linux 52f51a2b5ba178f331af62260d2da86d7472c14b Configuring
linux 52f51a2b5ba178f331af62260d2da86d7472c14b Building
/usr/bin/sed -i -e "/\<CONFIG_GCC_PLUGINS\>/d" /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
echo '# CONFIG_GCC_PLUGINS is not set' >> /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b//.config
PATH="/home/paul/buildroot/output/host/bin:/home/paul/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" PKG_CONFIG="/home/paul/buildroot/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/paul/buildroot/output/host/lib/pkgconfig:/home/paul/buildroot/output/host/share/pkgconfig" BR_BINARIES_DIR=/home/paul/buildroot/output/images KCFLAGS=-Wno-attribute-alias DTC_FLAGS=-@ /usr/bin/make -j3 HOSTCC="/usr/bin/gcc -O2 -I/home/paul/buildroot/output/host/include -L/home/paul/buildroot/output/host/lib -Wl,-rpath,/home/paul/buildroot/output/host/lib" ARCH=arm64 INSTALL_MOD_PATH=/home/paul/buildroot/output/target CROSS_COMPILE="/home/paul/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-" WERROR=0 DEPMOD=/home/paul/buildroot/output/host/sbin/depmod INSTALL_MOD_STRIP=1 -C /home/paul/buildroot/output/build/linux-52f51a2b5ba178f331af62260d2da86d7472c14b all
SYNC include/config/auto.conf.cmd
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/expr.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
WRAP arch/arm64/include/generated/uapi/asm/errno.h
WRAP arch/arm64/include/generated/uapi/asm/ioctl.h
WRAP arch/arm64/include/generated/uapi/asm/ioctls.h
WRAP arch/arm64/include/generated/uapi/asm/ipcbuf.h
WRAP arch/arm64/include/generated/uapi/asm/msgbuf.h
WRAP arch/arm64/include/generated/uapi/asm/poll.h
WRAP arch/arm64/include/generated/uapi/asm/resource.h
WRAP arch/arm64/include/generated/uapi/asm/sembuf.h
WRAP arch/arm64/include/generated/uapi/asm/shmbuf.h
WRAP arch/arm64/include/generated/uapi/asm/siginfo.h
HOSTCC scripts/dtc/dtc.o
WRAP arch/arm64/include/generated/uapi/asm/socket.h
WRAP arch/arm64/include/generated/uapi/asm/sockios.h
WRAP arch/arm64/include/generated/uapi/asm/stat.h
WRAP arch/arm64/include/generated/uapi/asm/swab.h
WRAP arch/arm64/include/generated/uapi/asm/termbits.h
WRAP arch/arm64/include/generated/uapi/asm/termios.h
WRAP arch/arm64/include/generated/uapi/asm/types.h
UPD include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/early_ioremap.h
WRAP arch/arm64/include/generated/asm/mcs_spinlock.h
WRAP arch/arm64/include/generated/asm/qrwlock.h
WRAP arch/arm64/include/generated/asm/qspinlock.h
WRAP arch/arm64/include/generated/asm/set_memory.h
WRAP arch/arm64/include/generated/asm/user.h
WRAP arch/arm64/include/generated/asm/bugs.h
WRAP arch/arm64/include/generated/asm/delay.h
WRAP arch/arm64/include/generated/asm/div64.h
WRAP arch/arm64/include/generated/asm/dma-mapping.h
WRAP arch/arm64/include/generated/asm/dma.h
WRAP arch/arm64/include/generated/asm/emergency-restart.h
WRAP arch/arm64/include/generated/asm/hw_irq.h
WRAP arch/arm64/include/generated/asm/irq_regs.h
WRAP arch/arm64/include/generated/asm/kdebug.h
WRAP arch/arm64/include/generated/asm/kmap_types.h
WRAP arch/arm64/include/generated/asm/local.h
WRAP arch/arm64/include/generated/asm/local64.h
WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm64/include/generated/asm/mmiowb.h
WRAP arch/arm64/include/generated/asm/msi.h
WRAP arch/arm64/include/generated/asm/serial.h
WRAP arch/arm64/include/generated/asm/switch_to.h
WRAP arch/arm64/include/generated/asm/trace_clock.h
WRAP arch/arm64/include/generated/asm/unaligned.h
WRAP arch/arm64/include/generated/asm/vga.h
HOSTCC scripts/dtc/flattree.o
UPD include/config/kernel.release
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
UPD include/generated/utsrelease.h
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
YACC scripts/dtc/dtc-parser.tab.[ch]
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTCC scripts/kallsyms
HOSTCC scripts/genksyms/genksyms.o
YACC scripts/genksyms/parse.tab.[ch]
DTCO arch/arm64/boot/dts/rockchip/overlay/rock-5ab-camera-imx415.dtbo
HOSTCC scripts/resource_tool
DTCO arch/arm64/boot/dts/rockchip/overlay/rock-5a-radxa-display-10fhd.dtbo
LEX scripts/genksyms/lex.lex.c
HOSTCC scripts/genksyms/parse.tab.o
DTCO arch/arm64/boot/dts/rockchip/overlay/rock-5b-radxa-display-10fhd.dtbo
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c0-m1.dtbo
HOSTCC scripts/genksyms/lex.lex.o
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c1-m0.dtbo
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c3-m1.dtbo
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c7-m3.dtbo
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c8-m4.dtbo
HOSTCC scripts/sorttable
HOSTLD scripts/genksyms/genksyms
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-pwm2-m1.dtbo
HOSTCC scripts/asn1_compiler
DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-pwm3-m1.dtbo
HOSTCC scripts/extract-cert
scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
21 | #include <openssl/bio.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:95: scripts/extract-cert] Error 1
`

@flatmax
Copy link
Owner

flatmax commented Jun 16, 2023

@flatmax bash: python2: command not found

please install python2 and try again. It should work.
You see the problem is that the uboot version Radxa are using requires python2 and possibly python3. I believe Radxa are putting in changes to remove python2 dependencies - but we can integrate those changes later.

@flatmax
Copy link
Owner

flatmax commented Jun 16, 2023

@prubin100 that is a lot of information you are printing - I can't see anything I need there. Is it trying to compile Linux ?

@bmclapham1973
Copy link

@flatmax bash: python2: command not found

please install python2 and try again. It should work. You see the problem is that the uboot version Radxa are using requires python2 and possibly python3. I believe Radxa are putting in changes to remove python2 dependencies - but we can integrate those changes later.

I am planning to install python 2.7 from source since it's not available via apt anymore. Do you have another suggestion for installing python2 on Debian 12?

@flatmax
Copy link
Owner

flatmax commented Jun 16, 2023

That was a problem for me as well - I can't remember how I solved it. Give it a go - it should be ok.

@prubin100
Copy link

Based on the following two lines it does look to me like it is trying to compile Linux:

linux 52f51a2b5ba178f331af62260d2da86d7472c14b Configuring
linux 52f51a2b5ba178f331af62260d2da86d7472c14b Building

The two lines just prior to the compilation error are what made me think it is related to the RK3358 code:

DTCO arch/arm64/boot/dts/rockchip/overlay/rk3588-pwm3-m1.dtbo
HOSTCC scripts/extract-cert

@flatmax
Copy link
Owner

flatmax commented Jun 16, 2023

ok - I am a little unsure why it is having trouble.
What host system are you building on ?
Are you sure you have checked out the correct version of buildroot ?

@akkusativk
Copy link

akkusativk commented Jun 25, 2023

@prubin100 do you still have the issue, that the patch is not applied? If so, maybe buildroot does not apply the patch, because it thinks, that all patches for the package were already applied. Buildroot uses so called "stamp files" (e.g. '.stamp_downloaded', '.stamp_extracted', '.stamp_patched') to monitor the "progress" of packages, e.g., whether the patches for some packes were already applied or not. If the stamp file ist present, then a new compilation will cause the particular step to NOT be executed again. I.e., if there is already a '.stamp_patched' in your uboot BUILD folder (i.e., buildroot/output/build/uboot-versionXYZ/.stamp_patched), then no patches will be applied, if you rebuild. This then also means, that any new patch you add afterwards will not be applied.

I know 3 things you can do:

  • clean the whole buildroot and rebuild everything by e.g., executing make distclean - this will take lots of time unnecessary
  • clean only the uboot BUILD folder by manually removing it, e.g., by executing rm -rd buildroot/output/build/uboot-<version>
  • use buildroot command to clean the build folder, i.e., make uboot-dirclean

I like the last option best. Afterwards you could try to first only rebuild uboot, by using make uboot-rebuild. Then you could see, whether the patch gets applied and whether it fixes your rockchip-uboot issues.

For more info about how to rebuild packages in buildroot, see here: https://buildroot.org/downloads/manual/manual.html#rebuild-pkg

I hope this helps :)

@akkusativk
Copy link

@prubin100 regarding the other issue "fatal error: openssl/bio.h: No such file or directory", I had the same one recently. For me, installing libssl-dev did the trick, like described here: TinkerBoard/debian_kernel#26

@akkusativk
Copy link

@prubin100 @bmclapham1973 what you could also try to do just as a test: You could try to just manually apply the changes of my patch to the source file. Therefore you would have to open /app/buildroot/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c, go to line 1164 and then manually apply the changes of my patch. It should then work. However, beware that

a) the patch is then not used by buildroot, else there will be an error, because the patch cannot be properly applied once you already made the change manually
b) the build will only work as long as the uboot build folder is then preserved in the patched state. After a make distclean or a make uboot-dirclean the fix will of course be lost again

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

6 participants