Re: [PATCH] gcc-runtime: Pass -nostartfiles when building dummy

Jon Mason

On Mon, Jul 18, 2022 at 11:00 PM Khem Raj <raj.khem@...> wrote:

This is a dummy shared object therefore reduce dependencies further by
not requiring the C startup files, we wont use this shared library for
anything useful anyway

Signed-off-by: Khem Raj <raj.khem@...>
This resolved the build break I was seeing in zephyr of
cannot find crt0.o: No such file or directory

Thanks for getting this out so quickly Khem!

meta/recipes-devtools/gcc/ | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/ b/meta/recipes-devtools/gcc/
index 5d74e4494d1..3e1c799ba13 100644
--- a/meta/recipes-devtools/gcc/
+++ b/meta/recipes-devtools/gcc/
@@ -68,8 +68,7 @@ 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/dummylib.c
- ${CC} ${WORKDIR}/dummylib/dummylib.c -shared -o ${WORKDIR}/dummylib/
+ ${CC} -x c /dev/null -nostartfiles -shared -o ${WORKDIR}/dummylib/
for d in libgcc ${RUNTIMETARGET}; do
echo "Configuring $d"
rm -rf ${B}/${TARGET_SYS}/$d/

Join to automatically receive all group messages.