Compile issue in arm64 of Ubuntu 23.10
Describe the bug
Error compiling in Ubuntu 23.10 with arm64 architecture, but succeeded in both 22.04 & 23.04 with same build rules. Seems to be compatibility issue with higher build tools.
Build Log:
[ 35%] Building C object bin/CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o
cd /<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/bin && /usr/bin/gcc-12 -DAVIF_DLL -DDT_HAVE_SIGNAL_TRACE -DGDK_DISABLE_DEPRECATED -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_24 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_MIN_REQUIRED -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DHAVE_CONFIG_H -DHAVE_GAME -DHAVE_GMIC -DHAVE_GPHOTO2 -DHAVE_GRAPHICSMAGICK -DHAVE_ICU -DHAVE_IMATH -DHAVE_ISO_CODES -DHAVE_KWALLET -DHAVE_LIBAVIF=1 -DHAVE_LIBEXIV2_WITH_ISOBMFF=1 -DHAVE_LIBHEIF=1 -DHAVE_LIBJXL -DHAVE_LIBRAW=1 -DHAVE_LIBSECRET -DHAVE_MAP -DHAVE_OPENCL -DHAVE_OPENEXR -DHAVE_OPENJPEG -DHAVE_OSMGPSMAP_110_OR_NEWER -DHAVE_OSMGPSMAP_NEWER_THAN_110 -DHAVE_PRINT -DHAVE_SQLITE_324_OR_NEWER -DHAVE_VISIBILITY -DHAVE_WEBP -DLIBHEIF_EXPORTS -DLIBRAW_NODLL -DSQLITE_CORE -DSQLITE_ENABLE_ICU -DUSE_COLORDGTK -DUSE_LUA -D_RELEASE -D_XOPEN_SOURCE=700 -Dlib_darktable_EXPORTS -I/<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/bin -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/src/external/LuaAutoC -I/<<PKGBUILDDIR>>/src/external/whereami/src -I/<<PKGBUILDDIR>>/src/external/LibRaw -isystem /<<PKGBUILDDIR>>/src/external -isystem /<<PKGBUILDDIR>>/src/external/OpenCL -isystem /usr/include/glib-2.0 -isystem /usr/lib/aarch64-linux-gnu/glib-2.0/include -isystem /usr/include/gtk-3.0 -isystem /usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/fribidi -isystem /usr/include/cairo -isystem /usr/include/pixman-1 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/atk-1.0 -isystem /usr/include/at-spi2-atk/2.0 -isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib/aarch64-linux-gnu/dbus-1.0/include -isystem /usr/include/libxml2 -isystem /usr/include/lensfun -isystem /usr/include/librsvg-2.0 -isystem /usr/include/json-glib-1.0 -isystem /usr/include/openjpeg-2.5 -isystem /usr/include/libsecret-1 -isystem /usr/include/GraphicsMagick -isystem /usr/include/lua5.4 -isystem /usr/include/osmgpsmap-1.0 -isystem /usr/include/libsoup-2.4 -isystem /usr/include/colord-1 -isystem /usr/include/Imath -isystem /usr/include/OpenEXR -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/darktable-1:4.6.0-0build1~mantic -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wmaybe-uninitialized -Wno-unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member -fopenmp -mtune=generic -g -O3 -DNDEBUG -O3 -ffast-math -fno-finite-math-only -fexpensive-optimizations -std=c99 -fPIC -MD -MT bin/CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o -MF CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o.d -o CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o -c /<<PKGBUILDDIR>>/src/common/bilateralcl.c
/<<PKGBUILDDIR>>/src/common/bilateral.c:468:6: warning: GCC does not currently support mixed size types for ‘simd’ functions
468 | void dt_bilateral_slice_to_output(const dt_bilateral_t *const b,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/src/common/bilateral.c:420:6: warning: GCC does not currently support mixed size types for ‘simd’ functions
420 | void dt_bilateral_slice(const dt_bilateral_t *const b,
| ^~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/src/common/bilateral.c: In function ‘_ZGVnN1vva64_dt_bilateral_splat’:
/<<PKGBUILDDIR>>/src/common/bilateral.c:297:1: error: unrecognizable insn:
297 | }
| ^
(insn 565 564 566 3 (set (mem/c:TF (plus:DI (reg/f:DI 31 sp)
(const_int 512 [0x200])) [66 S16 A8])
(reg:TF 54 v22)) -1
(expr_list:REG_DEAD (reg:TF 54 v22)
(nil)))
during RTL pass: sched_fusion
/<<PKGBUILDDIR>>/src/common/bilateral.c:297:1: internal compiler error: in get_attr_type, at config/aarch64/aarch64.md:24188
0x1751e57 internal_error(char const*, ...)
???:0
0x670023 fancy_abort(char const*, int, char const*)
???:0
0x66e3fb _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
???:0
0x66e42f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
???:0
0x11b25af get_attr_type(rtx_insn*)
???:0
0x160acff schedule_block(basic_block_def**, void*)
???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
[ 35%] Building C object bin/CMakeFiles/lib_darktable.dir/common/box_filters.c.o
cd /<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/bin && /usr/bin/gcc-12 -DAVIF_DLL -DDT_HAVE_SIGNAL_TRACE -DGDK_DISABLE_DEPRECATED -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_24 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_MIN_REQUIRED -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DHAVE_CONFIG_H -DHAVE_GAME -DHAVE_GMIC -DHAVE_GPHOTO2 -DHAVE_GRAPHICSMAGICK -DHAVE_ICU -DHAVE_IMATH -DHAVE_ISO_CODES -DHAVE_KWALLET -DHAVE_LIBAV
And full log: https://launchpadlibrarian.net/704828500/buildlog_ubuntu-mantic-arm64.darktable_1%3A4.6.0-0build1~mantic_BUILDING.txt.gz
Steps to reproduce
None
Expected behavior
No response
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you obtain darktable from?
downloaded from www.darktable.org
darktable version
4.6.0
What OS are you using?
Linux
What is the version of your OS?
Ubuntu 23.10
Describe your system?
Ubuntu 23.10, arm64
Are you using OpenCL GPU in darktable?
None
If yes, what is the GPU card and driver?
No response
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response
This is a compiler bug, not darktable’s. But probably it’s a good idea to add some kind of workaround.
This is a compiler bug, not darktable’s. But probably it’s a good idea to add some kind of workaround.
To be more specific this looks like GCC bug 96341, which has been fixed by commit f5fc001a84a7db ("aarch64: enable mixed-types for aarch64 simdclones")
More likely a different GCC issue, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053405 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111677
But probably it’s a good idea to add some kind of workaround.
The workaround is to build w/ -DUSE_OPENMP=OFF on arm64 when using GCC for now.
The workaround is to build w/
-DUSE_OPENMP=OFFon arm64 when using GCC for now.
Alternatively one can disable stack-protector-strong (Debian GCC sets it by default).
Thank you @kmilos and @asheplyakov, has successfully built the package for arm64
Thank you @kmilos and @asheplyakov, has successfully built the package for arm64
If the problem is solved, I'm closing this issue.