Skip to content

SBE fails to build on Fedora33 #4075

@klauskiwi

Description

@klauskiwi

This was created to track the following issue reported on the mailing-list: https://lists.ozlabs.org/pipermail/openpower-firmware/2021-March/000630.html

In basic terms, looks like recent changes to Fedora33 are apparently dynamically linking the binaries readelf/nm to some kerberos cryptographic library.

And during SBE's build, the Makefile is overriding the LD_LIBRARY_PATH:
SBE_COMMIT_ID=$(SBE_VERSION) $(MAKE) -C $(@D) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib CROSS_COMPILER_PATH=$(PPE42_GCC_BIN) all which is causing the python script readAndParseElf.py to use the readelf from the underlying distro (i.e., from the default path) while using a LD_LIBRARY_PATH prepared for the op-build toolchain, which causes the undefined symbol error below:

 Generating /home/stewart/op-build/output/build/sbe-5799af7203689edc9590544b520595f05d9ce7ca/images/sbe_seeprom_DD2.out
readelf: symbol lookup error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b
219040
make[3]: *** [Makefile:165: output_sbe_image] Error 255
make[2]: *** [Makefile:181: all] Error 2
make[2]: Leaving directory '/home/stewart/op-build/output/build/sbe-5799af7203689edc9590544b520595f05d9ce7ca/src/build'
make[1]: *** [Makefile:39: axone] Error 2
make[1]: *** Waiting for unfinished jobs....
readelf: symbol lookup error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b
219760
make[3]: *** [Makefile:165: output_sbe_image] Error 255
make[2]: *** [Makefile:181: all] Error 2
make[2]: Leaving directory '/home/stewart/op-build/output/build/sbe-5799af7203689edc9590544b520595f05d9ce7ca/src/build'
make[1]: *** [Makefile:36: DD2] Error 2
make[1]: Leaving directory '/home/stewart/op-build/output/build/sbe-5799af7203689edc9590544b520595f05d9ce7ca'
make: *** [package/pkg-generic.mk:250: /home/stewart/op-build/output/build/sbe-5799af7203689edc9590544b520595f05d9ce7ca/.stamp_built] Error 2
make: Leaving directory '/home/stewart/op-build/buildroot'

I tried to fix that with this commit (130d044) but that causes the failure of building SBE using devtoolset-8 on a RHEL7 (x86_64) host (see my message https://lists.ozlabs.org/pipermail/openpower-firmware/2021-March/000631.html)

I have since then tried a few different iterations on PR #4028 but the fundamental problem is that the SBE build system sometimes requires native utilities (i.e.m, readelf and nm?) while sometimes requiring tools/libraries from op-build toolchain, and still at other times requiring the ppe toolchain.

I believe that a potential solution would be to call ${CROSS_PREFIX}nm and readelf if they are needed to deal with cross-compiled binaries, while calling just nm / readelf if the native version is desired, without the need to use LD_LIBRARY_PATH. But that would require testing and debugging beyond the scope of op-build, so I'm expecting this to the SBE driven by team for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions