Buildroot building tip

Post Reply
extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Buildroot building tip

Post by extphy »

Hi All,

Could someone please advice, how to patch kernel in repo based buildroot build? Previously, I used custom kernel patch path in menuconfig, but as I can see, now there is a "amlogic-4.9" setting set.

The patch I need to apply fixes redefinition of yylloc:

Code: Select all

>>> linux amlogic-4.9-dev Building
PATH="/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/bin:/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/sbin:/home/eugene/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin" BR_BINARIES_DIR=/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/images /usr/bin/make -j9 HOSTCC="/usr/bin/gcc -O2 -I/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/include -L/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/lib -Wl,-rpath,/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/lib" ARCH=arm64 INSTALL_MOD_PATH=/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/target CROSS_COMPILE="/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-" DEPMOD=/home/eugene/dev/armv8/c4_buildroot/output/odroidc4/host/sbin/depmod LOADADDR="0x1008000" INSTALL_MOD_STRIP=1 -C /home/eugene/dev/armv8/c4_buildroot/output/odroidc4/build/linux-amlogic-4.9-dev Image.gz
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     scripts/mod/devicetable-offsets.h
  HOSTLD  scripts/dtc/dtc
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[4]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Error 1
make[3]: *** [scripts/Makefile.build:648: scripts/dtc] Error 2
make[2]: *** [Makefile:562: scripts] Error 2
There is a patch for C2 buildroot:

Code: Select all

--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -39,7 +39,7 @@ LINECOMMENT   "//".*\n
 #include "srcpos.h"
 #include "dtc-parser.tab.h"

-YYLTYPE yylloc;
+extern YYLTYPE yylloc;

 /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
 #define        YY_USER_ACTION \
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
index ee1d8c3..699c3e5 100644
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
@@ -73,7 +73,7 @@
 #include "dtc.h"
 #include "srcpos.h"

-YYLTYPE yylloc;
+extern YYLTYPE yylloc;

 extern int yylex(void);
 extern void print_error(char const *fmt, ...);
It needs to be applied to C4 too I believe.
These users thanked the author extphy for the post:
odroid (Mon Jun 07, 2021 3:24 pm)

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest