From 57623e3e5dc6360d60ccd01ab5ea260ae6b1278f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 5 Aug 2026 10:09:17 -0700 Subject: [PATCH] libsdl-image: Fix link failure by pointing OBJC at CC configure.in calls AC_PROG_OBJC and libSDL_image_la_SOURCES carries an Objective-C source, so automake selects Objective-C as the link language for the library and emits: libSDL_image_la_LINK = $(LIBTOOL) ... --mode=link $(OBJCLD) \ $(AM_OBJCFLAGS) $(OBJCFLAGS) ... OBJCLD = $(OBJC) AC_PROG_OBJC detects a bare compiler carrying none of TOOLCHAIN_OPTIONS, so while compilation goes through $(CC) and is fine, the link drops --sysroot and the tune flags and falls over: ld.lld: error: cannot open crtbeginS.o: No such file or directory ld.lld: error: unable to find library -lpng ld.lld: error: unable to find library -ljpeg ld.lld: error: unable to find library -ltiff ld.lld: error: unable to find library -lz ld.lld: error: unable to find library -lSDL Export OBJC as CC so the link gets the full toolchain options. configure.in already forces OBJCFLAGS=$CFLAGS, so that needs nothing. Signed-off-by: Khem Raj --- meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb b/meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb index 29fb8cb4aa..4b4cf4e62d 100644 --- a/meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb +++ b/meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb @@ -17,6 +17,14 @@ inherit autotools pkgconfig export SDL_CONFIG = "${STAGING_BINDIR_CROSS}/sdl-config" +# configure.in runs AC_PROG_OBJC and libSDL_image_la_SOURCES carries an +# Objective-C file, so automake picks Objective-C as the link language and +# links via $(OBJCLD) = $(OBJC) instead of $(CC). AC_PROG_OBJC detects a bare +# compiler with none of the toolchain options, so the link loses --sysroot and +# the tune flags and then fails to find crtbeginS.o, -lz, -lSDL and friends. +# Point OBJC at the full CC; configure.in already forces OBJCFLAGS=$CFLAGS. +export OBJC = "${CC}" + # Disable the run-time loading of the libs and bring back the soname dependencies. EXTRA_OECONF += "--disable-jpg-shared --disable-png-shared -disable-tif-shared"