I am trying to build AGL(with poky icefish
) as per instructions in https://wiki.automotivelinux.org/agl-distro/source-code
inside a container based off crops/poky
(https://github.com/crops/poky-container/blob/master/Dockerfile
)
While running bitbake agl-demo-platform
, I am getting the following error in perl-native-5.24.4-r0
recipe's do_configure
phase from Configure
script(I am using https://downloads.yoctoproject.org/releases/yocto/yocto-3.1/buildtools/x86_64-buildtools-extended-nativesdk-standalone-3.1.sh
to install buildtools-extended
)
Following are the gcc and ld versions in the SDK
admin@2a517c6c3748:/home/work/agl$ which gcc
/opt/poky/3.1/sysroots/x86_64-pokysdk-linux/usr/bin/gcc
admin@2a517c6c3748:/home/work/agl$ gcc --version
gcc (GCC) 9.3.0
admin@2a517c6c3748://opt/poky/3.1/sysroots/x86_64-pokysdk-linux/usr/bin$ ./x86_64-pokysdk-linux-ld -v
GNU ld (GNU Binutils) 2.34.0.20200220
ERROR: perl-native-5.24.4-r0 do_configure: Function failed: do_configure (log file is located at /home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/temp/log.do_configure.1100)
ERROR: Logfile of failure stored in: /home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/temp/log.do_configure.1100
Log data follows:
| DEBUG: Executing shell function do_configure
| First let's make sure your kit is complete. Checking...
| Would you like to see the instructions? [n]
| Locating common programs...
| Checking compatibility between /home/work/agl/build/tmp/hosttools/echo and builtin echo (if any)...
| Symbolic links are supported.
| Checking how to test for symbolic links...
| You can test for symbolic links with 'test -h'.
| Checking for cross-compile
| No targethost for running compiler tests against defined, running locally
...
| Operating system name? [linux]
| Operating system version? [5.3.0-1019-aws]
| Installation prefix to use? (~name ok)
| [/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr]
| AFS does not seem to be running...
| What installation prefix should I use for installing files? (~name ok)
| [/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr]
| Getting the current patchlevel...
| Build a threading Perl? [y]
| Use which C compiler? [gcc ]
| Checking for GNU cc in disguise and/or its version number...
| Now, how can we feed standard input to your C preprocessor...
| Directories to use for library searches?
| [/usr/local/lib /opt/poky/3.1/sysroots/x86_64-pokysdk-linux/usr/lib /opt/poky/3.1/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/9.3.0/include-fixed /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib /lib64]
| What is the file extension used for shared libraries? [so]
| Make shared library basenames unique? [n]
| Build Perl for SOCKS? [n]
| Try to use long doubles if available? [n]
| Checking for optional libraries...
| What libraries to use? [-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc]
| What optimizer/debugger flag should be used? [-O2]
| Any additional cc flags?
| [-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include]
| Let me guess what the preprocessor flags are...
| Any additional ld flags (NOT including libraries)?
| [-L/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -L/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/work/agl/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -L/usr/local/lib]
| Checking your choice of C compiler and flags for coherency...
| I've tried to compile and run the following simple program:
|
| #include <stdio.h>
| int main() { printf("Ok\n"); return(0); }
|
| I used the command:
|
| gcc -o try -O2 -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -L/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -L/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/work/agl/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -L/usr/local/lib try.c -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
| ./try
|
| and I got the following output:
|
| /opt/poky/3.1/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/9.3.0/../../../../x86_64-pokysdk-linux/bin/ld: cannot find -lnsl<=======
| collect2: error: ld returned 1 exit status
| I can't compile the test program.
| You have a BIG problem. Shall I abort Configure [y]
| Ok. Stopping Configure.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/work/agl/build/tmp/work/x86_64-linux/perl-native/5.24.4-r0/temp/log.do_configure.1100)
NOTE: recipe perl-native-5.24.4-r0: task do_configure: Failed
ERROR: Task (/home/work/agl/external/poky/meta/recipes-devtools/perl/perl-native_5.24.4.bb:do_configure) failed with exit code '1'
...
NOTE: Tasks Summary: Attempted 647 tasks of which 606 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/work/agl/external/poky/meta/recipes-devtools/perl/perl-native_5.24.4.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code
I tried switching to a different SDK 3.1.1 (https://downloads.yoctoproject.org/releases/yocto/yocto-3.1.1/buildtools/x86_64-buildtools-nativesdk-standalone-3.1.1.sh
) but that causes a hang in do_fetch
in bitbake(https://stackoverflow.com/questions/62629159/aglbitbake-agl-demo-platform-hangs-in-task-16
)