[libcamera-devel] Minimum toolchain requirements
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Mar 22 23:54:28 CET 2019
Hi Kieran,
On Fri, Mar 22, 2019 at 10:34:37AM +0000, Kieran Bingham wrote:
> Hi all,
>
> Compiling libcamera with the buildroot test-pkg target (for validating
> the package) fails on the br-arm-full, and sourcery-arm targets.
>
> There are two major issues.
>
> 1) error: use of deleted function
> It seems the compiler is unhappy with the constructor/initiliaser
> lists of severity_(other.severity_) within the log helpers.
It's actually msgStream_(std::move(other.msgStream_)) it's unhappy
about. That's strange, as the compiler should try to use the
std::basic_ostringstream<char>::basic_ostringstream(std::basic_ostringstream<char>&&)
move constructor, not the
std::basic_ostringstream<char>::basic_ostringstream(const
std::basic_ostringstream<char>&) copy constructor (which is rightfully
considered as deleted).
A bit of research led me to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54316. I think we need to
bump our GCC minimum required version.
> 2) error: missing initialiser for member ‘media_device_info::driver’
> The compiler is unhappy with default initialisers for structs
> being "{ }".
https://en.cppreference.com/w/c/language/struct_initialization
The empty initializer is a GCC extension as far as I know. I don't know
if clang allows it as well. It may be safer to fix the code instead.
> Neither of these issues are present on later compiler versions.
>
>
> The toolchain is:
> arm-linux-g++.br_real (Buildroot 2019.02-rc1) 4.9.4
>
> and I specify in the buildroot config:
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
>
>
> What do you think? Should we set a more recent compiler as a dependancy
> perhaps?
>
> Perhaps the following ?
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # C++14
>
> ( I haven't yet tested GCC 5, I'll await to hear general thoughts before
> I go building specific test environments )
I think GCC 5 makes sense, but I would nonetheless fix the struct
initializer issue.
> Rather than paste lots of error logs here - they are available at the
> following pastebin:
>
>
> http://paste.ubuntu.com/p/zGVzrQF4sj/
>
> The 'brief' version is:
>
>
> [5/31] Compiling C++ object 'src/libcamera/4ab8042@@camera at sha/log.cpp.o'.
> FAILED: src/libcamera/4ab8042@@camera at sha/log.cpp.o
> /home/linuxembedded/iob/libcamera/buildroot/libcamera-ci/br-arm-full/host/bin/arm-linux-g++
> -Isrc/libcamera/4ab8042@@camera at sha -Isrc/libcamera -I../src/libcamera
> -Iinclude -I../include -I../src/libcamera/include
> -I/home/linuxembedded/iob/libcamera/buildroot/libcamera-ci/br-arm-full/host/usr/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include
> -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++11 -O3
> -Wno-unused-parameter -fPIC -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 -Os -MD -MQ
> 'src/libcamera/4ab8042@@camera at sha/log.cpp.o' -MF
> 'src/libcamera/4ab8042@@camera at sha/log.cpp.o.d' -o
> 'src/libcamera/4ab8042@@camera at sha/log.cpp.o' -c ../src/libcamera/log.cpp
> ../src/libcamera/log.cpp: In constructor
> ‘libcamera::LogMessage::LogMessage(libcamera::LogMessage&&)’:
> ../src/libcamera/log.cpp:437:29: error: use of deleted function
> ‘std::basic_ostringstream<char>::basic_ostringstream(const
> std::basic_ostringstream<char>&)’
> severity_(other.severity_)
> ^
> In file included from ../src/libcamera/include/log.h:10:0,
> from ../src/libcamera/log.cpp:18:
> /home/linuxembedded/iob/libcamera/buildroot/libcamera-ci/br-arm-full/host/opt/ext-toolchain/arm-buildroot-linux-uclibcgnueabi/include/c++/4.9.4/sstream:387:11:
> note: ‘std::basic_ostringstream<char>::basic_ostringstream(const
> std::basic_ostringstream<char>&)’ is implicitly deleted because the
> default definition would be ill-formed:
> class basic_ostringstream : public basic_ostream<_CharT, _Traits>
> ^
>
> and...
>
>
> [9/31] Compiling C++ object
> 'src/libcamera/4ab8042@@camera at sha/media_device.cpp.o'.
> FAILED: src/libcamera/4ab8042@@camera at sha/media_device.cpp.o
> /home/linuxembedded/iob/libcamera/buildroot/libcamera-ci/br-arm-full/host/bin/arm-linux-g++
> -Isrc/libcamera/4ab8042@@camera at sha -Isrc/libcamera -I../src/libcamera
> -Iinclude -I../include -I../src/libcamera/include
> -I/home/linuxembedded/iob/libcamera/buildroot/libcamera-ci/br-arm-full/host/usr/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include
> -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++11 -O3
> -Wno-unused-parameter -fPIC -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 -Os -MD -MQ
> 'src/libcamera/4ab8042@@camera at sha/media_device.cpp.o' -MF
> 'src/libcamera/4ab8042@@camera at sha/media_device.cpp.o.d' -o
> 'src/libcamera/4ab8042@@camera at sha/media_device.cpp.o' -c
> ../src/libcamera/media_device.cpp
> ../src/libcamera/media_device.cpp: In member function ‘int
> libcamera::MediaDevice::open()’:
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::driver’ [-Werror=missing-field-initializers]
> struct media_device_info info = { };
> ^
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::model’ [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::serial’ [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::bus_info’ [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::media_version’
> [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::hw_revision’ [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::driver_version’
> [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp:158:36: error: missing initialiser for
> member ‘media_device_info::reserved’ [-Werror=missing-field-initializers]
> ../src/libcamera/media_device.cpp: In member function ‘int
> libcamera::MediaDevice::populate()’:
> ../src/libcamera/media_device.cpp:213:40: error: missing initialiser for
> member ‘media_v2_topology::topology_version’
> [-Werror=missing-field-initializers]
> struct media_v2_topology topology = { };
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list