How to handle odd libc.so from Yocto GCC cross-compiler when running modules_prepare?

When attempting to set up an environment for cross-compiling for Yocto Linux, I am getting an unusual build error when it’s building some of the host tools used by the Linux kernel. This seems to be due to an unusual libc.so library file that is actually an LD linker script. Due to that linker script, when I run make modules_prepare in the Linux kernel source tree for my Yocto target, it fails while building the extract-cert host utility:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>/usr/bin/ld: cannot find /lib64/libc.so.6: No such file or directory
/usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a: No such file or directory
</code>
<code>/usr/bin/ld: cannot find /lib64/libc.so.6: No such file or directory /usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a: No such file or directory </code>
/usr/bin/ld: cannot find /lib64/libc.so.6: No such file or directory
/usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a: No such file or directory

The specific build command that is failing is this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>gcc -Wp,-MMD,scripts/.extract-cert.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -o scripts/extract-cert scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto
</code>
<code>gcc -Wp,-MMD,scripts/.extract-cert.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -o scripts/extract-cert scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto </code>
gcc -Wp,-MMD,scripts/.extract-cert.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -o scripts/extract-cert scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto

However, the failure can be reduced to just this command:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>gcc scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto
</code>
<code>gcc scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto </code>
gcc scripts/extract-cert.c -L/opt/windriver/wrlinux/22.33/sysroots/core2-64-wrs-linux/usr/lib64 -lcrypto

Removing the -L library path option from GCC is enough to make either command above succeed. It seems to be due to the libc.so file found inside that folder which has this contents:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
</code>
<code>/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) </code>
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a  AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )

Another valid workaround seems to be removing that libc.so file from that folder. After doing that, the make modules_prepare command succeeds and I can now build external modules with that source tree.

The specific version of Yocto I am building is Wind River Linux LTS 22. The build of the image itself was successful and it is booted and running. The host system is Ubuntu Linux 22.04.4 LTS. The SDK was build using the populate_sdk task with bitbake after adding modifying TOOLCHAIN_TARGET_TASK to include kernel-devsrc so the SDK would include the kernel sources. The SDK was installed onto the same system.

Once the SDK was installed, I ran make modules_prepare in the kernel build tree that came with the SDK in order to build the module next. However, it failed with the aforementioned error. What is the correct resolution for this? What is the goal of that file above and how do I avoid it interfering with the build of the kernel? Is there a way to get Yocto to pre-prepare the kernel sources so that this step is not needed? If not, what should be done so the SDK installer that Yocto builds can at least be prepared without that libc.so-related error?

I expect to be able to prepare the kernel sources after a fresh install of the kernel without triggering build errors at a minimum. Ideally, I’d like for the SDK to prepare the sources automatically as part of the install so I can immediately go to building kernel modules with it.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật