Unable to build perl due to invalid ELF header in /usr/lib/libc.so

Recently, I am experiencing a perl build failure which I cannot explain.

...
LD_LIBRARY_PATH=/scratch/union/build_dir/target-x86_64_musl/perl/perl-5.40.0  perl -f pod/buildtoc -q
perl: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
make[3]: *** [makefile:422: pod/perltoc.pod] Error 127
make[3]: Leaving directory '/scratch/union/build_dir/target-x86_64_musl/perl/perl-5.40.0'
make[2]: *** [Makefile:166: /scratch/union/build_dir/target-x86_64_musl/perl/perl-5.40.0/.built] Error 2
make[2]: Leaving directory '/scratch/union/feeds/packages/lang/perl'

As a sanity check, I ran a make distclean and rebuilt my toolchain but I am seeing the same failure. Here is a complete build log.

Does this indicate that the build system is using the host system's libc.so rather than the toolchain's version? I did not see anything recent commits to packages/lang/perl/ that might explain this within the timeframe of the breakage.

Thanks in advance for suggestions.

did you update the feeds after distclean ?

scripts/feeds update
scripts/feeds install -a

Yes, same result though

That looks like absolute path in the build system, not relative to the cross-compile toolchain.

1 Like
1 Like

Just to clarify - what target are you building for?

And maybe more on your build environment - are you using Docker?

The path is odd here...