]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gcc-runtime: Fix build when using gold
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 13 Jul 2022 22:12:06 +0000 (23:12 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Jul 2022 22:20:56 +0000 (23:20 +0100)
If gold is enabled as the default linker, it errors trying to link
to our dummy library empty file and this turns off things which should
be present in libstdc++.

For example, _GLIBCXX_HAVE_S_ISREG isn't defined and HAVE_S_ISREG in
libstdc++-v3/config.h isn't set properly.

Instead of just creating an empty file, create an empty elf binary
instead which addresses the issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-runtime.inc

index c39a0caf8a74738aead91fc0fc07ec7f8141ed01..7e920df2d3439b7d193dfc07c4d7f8daa934d297 100644 (file)
@@ -68,7 +68,8 @@ do_configure () {
        # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
        # tests. Create a dummy empty lib for the purposes of configure.
        mkdir -p ${WORKDIR}/dummylib
-       touch ${WORKDIR}/dummylib/libstdc++.so
+       touch ${WORKDIR}/dummylib/dummylib.c
+       ${CC} ${WORKDIR}/dummylib/dummylib.c -shared -o ${WORKDIR}/dummylib/libstdc++.so
        for d in libgcc ${RUNTIMETARGET}; do
                echo "Configuring $d"
                rm -rf ${B}/${TARGET_SYS}/$d/