[libcamera-devel] [PATCH] ipa: tweak constant expressions that fail to be determined on ppc64el

Olivier Gayot olivier.gayot at canonical.com
Sun Oct 16 14:03:13 CEST 2022


Hi Laurent,

On 10/15/22 18:39, Laurent Pinchart wrote:

> Could you provide the exact compiler version ? Looking at
> https://bugzilla.redhat.com/show_bug.cgi?id=1538817#c11, I'd like to
> know if newer gcc versions still fail to compile libcamera for ppc64el.

I initially witnessed this error when building with GCC version 12 (that 
is the default version in soon-to-be-released Ubuntu 22.10):

gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1) [1]

but I also reproduced the error with GCC 11:

gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) [2]

I created a compiler explorer snippet that shows the failure on a 
reduced test-case:

https://godbolt.org/z/1jhEqb78z

> A comment in the bug report also claims
> 
> "The IBM long double format is too weird and not everything in it is
> possible to be evaluated at compile time."
> 
> which sounds hard to believe.

I agree that it sounds like a broad claim, especially because other 
compilers (e.g., clang) build the above snippet successfully. Ideally I 
will raise this to GCC upstream to see if there is something that can be 
done.

> 
> Anyway, the change below looks OK to me. Once you provide the compiler
> version I'll add that to the commit message and push the patch.
> 
Thanks! I appreciate your help!
Olivier


[1] $ g++ -v 

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/powerpc64le-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: powerpc64le-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
11.2.0-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs 
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-11 
--program-prefix=powerpc64le-linux-gnu- --enable-shared 
--enable-linker-build-id --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --libdir=/usr/lib 
--enable-nls --enable-bootstrap --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-gnu-unique-object 
--enable-plugin --enable-default-pie --with-system-zlib 
--enable-libphobos-checking=release --with-target-system-zlib=auto 
--with-libphobos-druntime-only=yes --enable-objc-gc=auto 
--enable-secureplt --with-cpu=power9 --enable-targets=powerpcle-linux 
--disable-multilib --enable-multiarch --disable-werror 
--with-long-double-128 
--enable-offload-targets=nvptx-none=/build/gcc-11-Nc1dG4/gcc-11-11.2.0/debian/tmp-nvptx/usr 
--without-cuda-driver --enable-checking=release 
--build=powerpc64le-linux-gnu --host=powerpc64le-linux-gnu 
--target=powerpc64le-linux-gnu --with-build-config=bootstrap-lto-lean 
--enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1)

[2] $ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/powerpc64le-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: powerpc64le-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
12.2.0-3ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs 
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-12 
--program-prefix=powerpc64le-linux-gnu- --enable-shared 
--enable-linker-build-id --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --libdir=/usr/lib 
--enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new 
--enable-gnu-unique-object --enable-plugin --enable-default-pie 
--with-system-zlib --enable-libphobos-checking=release 
--with-target-system-zlib=auto --with-libphobos-druntime-only=yes 
--enable-objc-gc=auto --enable-secureplt --with-cpu=power9 
--enable-targets=powerpcle-linux --disable-multilib --enable-multiarch 
--disable-werror --with-long-double-128 
--enable-offload-targets=nvptx-none=/build/gcc-12-0eaJL7/gcc-12-12.2.0/debian/tmp-nvptx/usr 
--enable-offload-defaulted --without-cuda-driver 
--enable-checking=release --build=powerpc64le-linux-gnu 
--host=powerpc64le-linux-gnu --target=powerpc64le-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1)


More information about the libcamera-devel mailing list