intel / icamerasrc

icamerasrc
24 stars 35 forks source link

Build failed with glibc 2.35 #10

Open KaiChuan-Hsieh opened 2 years ago

KaiChuan-Hsieh commented 2 years ago

Build failed: In file included from /usr/include/glib-2.0/glib/gthread.h:32, from /usr/include/glib-2.0/glib/gasyncqueue.h:32, from /usr/include/glib-2.0/glib.h:32, from /usr/include/gstreamer-1.0/gst/gst.h:27, from /usr/include/gstreamer-1.0/gst/allocators/gstdmabuf.h:24, from gstcamerasrcbufferpool.cpp:56: gstcamerasrcbufferpool.cpp: In function ‘GType gst_camerasrc_meta_api_get_type()’: /usr/include/glib-2.0/glib/gatomic.h:113:19: error: argument 2 of ‘atomic_load’ must not be a pointer to a ‘volatile’ type 113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, ATOMIC_SEQ_CST); \ | ~~~~^~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’ 260 | (!g_atomic_pointer_get (location) && \ | ^~~~~~~~ gstcamerasrcbufferpool.cpp:85:7: note: in expansion of macro ‘g_once_init_enter’ 85 | if (g_once_init_enter (&type)) { | ^~~~~ make[4]: *** [Makefile:642: libgsticamerasrc_la-gstcamerasrcbufferpool.lo] Error 1

In file included from /usr/include/glib-2.0/glib/gthread.h:32, from /usr/include/glib-2.0/glib/gasyncqueue.h:32, from /usr/include/glib-2.0/glib.h:32, from /usr/include/gstreamer-1.0/gst/gst.h:27, from gstcambasesrc.h:47, from gstcambasesrc.cpp:48: gstcambasesrc.cpp: In function ‘GType gst_cam_base_src_get_type()’: /usr/include/glib-2.0/glib/gatomic.h:113:19: error: argument 2 of ‘atomic_load’ must not be a pointer to a ‘volatile’ type 113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, ATOMIC_SEQ_CST); \ | ~~~~^~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’ 260 | (!g_atomic_pointer_get (location) && \ | ^~~~~~~~ gstcambasesrc.cpp:251:7: note: in expansion of macro ‘g_once_init_enter’ 251 | if (g_once_init_enter(&cam_base_src_type)) { | ^~~~~

I apply the patch to workaround it. --- a/src/gstcamerasrcbufferpool.cpp +++ b/src/gstcamerasrcbufferpool.cpp @@ -79,7 +79,7 @@ gst_camerasrc_meta_api_get_type (void) { PERF_CAMERA_ATRACE();