Skip to contentSkip to conversation

package/libcamera: fix uclibc/musl compile with libexecinfo enabled

PATCH Superseded Peter Seiderer 1 participant 2 messages Jan 31, 2022 – Feb 1, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libcamera: fix uclibc/musl compile with libexecinfo enabled

- depend and link against libexecinfo if enabled to fix linking failure in case execinfo.h is detected, see libcamera-40f5fddca7f774944a53f58eeaebc4db79c373d8/meson.build:

32 if cc.has_header_symbol('execinfo.h', 'backtrace')
33 config_h.set('HAVE_BACKTRACE', 1)
34 endif

- libexecinfo already depends on !BR2_TOOLCHAIN_USES_GLIBC

Fixes:

- http://autobuild.buildroot.net/results/a1077815895ab847c5ca82ec17c7d13fe97cff53

.../powerpc-buildroot-linux-uclibc/bin/ld: src/libcamera/base/libcamera-base.so.p/log.cpp.o: in function `libcamera::Logger::backtrace()':
log.cpp:(.text+0x34b0): undefined reference to `backtrace'
.../powerpc-buildroot-linux-uclibc/bin/ld: log.cpp:(.text+0x34c0): undefined reference to `backtrace_symbols'

---
 package/libcamera/libcamera.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libcamera/libcamera.mk +5 -0
index 524cf07e03..9be45d248a 100644
@@ -99,4 +99,9 @@ else
 LIBCAMERA_CONF_OPTS += -Dtracing=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
+LIBCAMERA_DEPENDENCIES += libexecinfo
+LIBCAMERA_LDFLAGS += -lexecinfo
+endif
+
 $(eval $(meson-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 28 lines · Peter Seiderer

- depend and link against libexecinfo if enabled to fix linking failure in case execinfo.h is detected, see libcamera-40f5fddca7f774944a53f58eeaebc4db79c373d8/meson.build:

32 if cc.has_header_symbol('execinfo.h', 'backtrace')
33 config_h.set('HAVE_BACKTRACE', 1)
34 endif

- libexecinfo already depends on !BR2_TOOLCHAIN_USES_GLIBC

Fixes:

- http://autobuild.buildroot.net/results/a1077815895ab847c5ca82ec17c7d13fe97cff53

.../powerpc-buildroot-linux-uclibc/bin/ld: src/libcamera/base/libcamera-base.so.p/log.cpp.o: in function `libcamera::Logger::backtrace()':
log.cpp:(.text+0x34b0): undefined reference to `backtrace'
.../powerpc-buildroot-linux-uclibc/bin/ld: log.cpp:(.text+0x34c0): undefined reference to `backtrace_symbols'

---
 package/libcamera/libcamera.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libcamera/libcamera.mk +0 -0
index 524cf07e03..9be45d248a 100644

package/libcamera/libcamera.mk else · line 104

Quoted 6 lines
package/libcamera/libcamera.mk +3 -0
@@ -99,4 +99,9 @@ else
 LIBCAMERA_CONF_OPTS += -Dtracing=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
+LIBCAMERA_DEPENDENCIES += libexecinfo
+LIBCAMERA_LDFLAGS += -lexecinfo

Should be:

	LIBCAMERA_LDFLAGS = $(TARGET_LDFLAGS) -lexecinfo

Updated patch will follow...

Regards,
Peter

package/libcamera/libcamera.mk else · line 107

Quoted 3 lines
package/libcamera/libcamera.mk +2 -0
+endif
+
 $(eval $(meson-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot