[phosphor-ipmi-flash]: stdplus build failed before building the host-tool on the Host

Patrick Williams patrick at stwcx.xyz
Tue Jun 28 21:20:53 AEST 2022


On Tue, Jun 28, 2022 at 08:43:34AM +0000, Chris Chen (TPI) wrote:
> And each library and tool is built successful(only one thing that is I had to disable C++20 for the ipmi-blob-tool, others were fine) untilI started to build the stdplus. I encountered a build failed issue as below. It looks like there is a problem for using libfmt.a, I tried to figure out a solution on google but nothing is related to this. Could anyone help on this? Thanks.

Do you know why you disabled C++20?  This shouldn't have been necessary
and some of our code now requires C++20.

> 
> =====
> archer at archer-ArcherCityM:stdplus$
> archer at archer-ArcherCityM:stdplus$ meson setup -Dexamples=false -Dtests=disabled builddir
> The Meson build system
> Version: 0.61.2
> Source dir: /home/archer/Downloads/host-tool/stdplus
> Build dir: /home/archer/Downloads/host-tool/stdplus/builddir
> Build type: native build
> Project name: stdplus
> Project version: 0.1
> C++ compiler for the host machine: c++ (gcc 11.2.0 "c++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0")
> C++ linker for the host machine: c++ ld.bfd 2.38
> Host machine cpu family: x86_64
> Host machine cpu: x86_64
> Found pkg-config: /usr/bin/pkg-config (0.29.2)
> Run-time dependency fmt found: YES 8.1.2

Where did this `fmt` come from?  Ubuntu has `libfmt-dev` that you can
install which is version 8.1.1 on Jammy right now.

> Library dl found: YES
> Run-time dependency liburing found: YES 2.0
> Build targets in project: 1
> 
> stdplus 0.1
> 
>   User defined options
>     examples: false
>     tests   : disabled
> 
> Found ninja-1.10.1 at /usr/bin/ninja
> archer at archer-ArcherCityM:stdplus$
> archer at archer-ArcherCityM:stdplus$
> archer at archer-ArcherCityM:stdplus$ ninja -C builddir
> ninja: Entering directory `builddir'
> [9/9] Linking target src/libstdplus.so.0.1
> FAILED: src/libstdplus.so.0.1
> c++  -o src/libstdplus.so.0.1 src/libstdplus.so.0.1.p/stdplus_exception.cpp.o src/libstdplus.so.0.1.p/stdplus_signal.cpp.o src/libstdplus.so.0.1.p/stdplus_dl.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_create.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_dupable.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_impl.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_managed.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_mmap.cpp.o src/libstdplus.so.0.1.p/stdplus_fd_ops.cpp.o src/libstdplus.so.0.1.p/stdplus_io_uring.cpp.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libstdplus.so.0 /usr/local/lib/libfmt.a -ldl /usr/lib/x86_64-linux-gnu/liburing.so -Wl,--end-group
> /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): warning: relocation against `stdout@@GLIBC_2.2.5' in read-only section `.text'
> /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

However you obtained your libfmt, it was compiled incorrectly.  It
shouldn't have a static library but a dynamic one.

The `libfmt-dev` package has `libfmt.so` which should be sufficient for
linking as a shared library.

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20220628/5aed4e54/attachment.sig>


More information about the openbmc mailing list