termux-user-repository / tur

A place for all types of Termux packages.
Other
463 stars 87 forks source link

[Help] darktable x86_64 compilation error #833

Closed knyipab closed 8 months ago

knyipab commented 8 months ago

I am adding a new package darktable (https://www.darktable.org/). I managed to get aarch64 compilation successful but x86_64 does not (FYI 32-bit are not supported by official source), with strange linker errors error: relocation refers to a symbol in a discarded section. I am not very familiar with compilation and really grateful for help.

The code is avilabale at the darktable branch: https://github.com/knyipab/tur/blob/darktable/tur/darktable/build.sh.

The build log is available at https://github.com/knyipab/tur/actions/runs/7945273863/job/21691739193#step:7:7049, with excerpt below:

Thanks for any help!

[475/954] Building C object bin/CMakeFiles/lib_darktable.dir/lua/widget/separator.c.o
[476/954] Building C object bin/CMakeFiles/lib_darktable.dir/lua/widget/slider.c.o
[477/954] Building C object bin/CMakeFiles/lib_darktable.dir/lua/widget/stack.c.o
[478/954] Building C object bin/CMakeFiles/lib_darktable.dir/lua/widget/text_view.c.o
[479/954] Building C object bin/CMakeFiles/lib_darktable.dir/lua/widget/widget.c.o
[480/954] Linking C shared library bin/libdarktable.so
FAILED: bin/libdarktable.so 
: && /home/builder/.termux-build/_cache/android-r26b-api-24-v1/bin/x86_64-linux-android-clang --target=x86_64-none-linux-android --gcc-toolchain=/home/builder/.termux-build/_cache/android-r26b-api-24-v1 --sysroot=/home/builder/.termux-build/_cache/android-r26b-api-24-v1/sysroot -fPIC -fstack-protector-strong -Oz --target=x86_64-linux-android24  -I/data/data/com.termux/files/usr/include -fopenmp-version=45 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wthread-safety -Wno-unknown-pragmas -Wno-error=varargs -Wno-error=address-of-packed-member -fopenmp=libomp -mtune=generic -msse2 -g -O2 -g -DNDEBUG -O2 -ftree-vectorize  -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now --target=x86_64-linux-android24 -shared -Wl,-soname,libdarktable.so -o bin/libdarktable.so bin/CMakeFiles/lib_darktable.dir/version_gen.c.o bin/CMakeFiles/lib_darktable.dir/bauhaus/bauhaus.c.o bin/CMakeFiles/lib_darktable.dir/common/act_on.c.o bin/CMakeFiles/lib_darktable.dir/common/atomic.c.o bin/CMakeFiles/lib_darktable.dir/common/bilateral.c.o bin/CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o bin/CMakeFiles/lib_darktable.dir/common/box_filters.c.o bin/CMakeFiles/lib_darktable.dir/common/cache.c.o bin/CMakeFiles/lib_darktable.dir/common/calculator.c.o bin/CMakeFiles/lib_darktable.dir/common/collection.c.o bin/CMakeFiles/lib_darktable.dir/common/color_harmony.c.o bin/CMakeFiles/lib_darktable.dir/common/color_picker.c.o bin/CMakeFiles/lib_darktable.dir/common/color_vocabulary.c.o bin/CMakeFiles/lib_darktable.dir/common/colorlabels.c.o bin/CMakeFiles/lib_darktable.dir/common/colorspaces.c.o bin/CMakeFiles/lib_darktable.dir/common/curl_tools.c.o bin/CMakeFiles/lib_darktable.dir/common/curve_tools.c.o bin/CMakeFiles/lib_darktable.dir/common/custom_primaries.c.o bin/CMakeFiles/lib_darktable.dir/common/darktable.c.o bin/CMakeFiles/lib_darktable.dir/common/database.c.o bin/CMakeFiles/lib_darktable.dir/common/datetime.c.o bin/CMakeFiles/lib_darktable.dir/common/dbus.c.o bin/CMakeFiles/lib_darktable.dir/common/distance_transform.c.o bin/CMakeFiles/lib_darktable.dir/common/dlopencl.c.o bin/CMakeFiles/lib_darktable.dir/common/dng_opcode.c.o bin/CMakeFiles/lib_darktable.dir/common/dtpthread.c.o bin/CMakeFiles/lib_darktable.dir/common/dwt.c.o bin/CMakeFiles/lib_darktable.dir/common/dynload.c.o bin/CMakeFiles/lib_darktable.dir/common/eaw.c.o bin/CMakeFiles/lib_darktable.dir/common/exif.cc.o bin/CMakeFiles/lib_darktable.dir/common/file_location.c.o bin/CMakeFiles/lib_darktable.dir/common/film.c.o bin/CMakeFiles/lib_darktable.dir/common/gaussian.c.o bin/CMakeFiles/lib_darktable.dir/common/gpx.c.o bin/CMakeFiles/lib_darktable.dir/common/grouping.c.o bin/CMakeFiles/lib_darktable.dir/common/guided_filter.c.o bin/CMakeFiles/lib_darktable.dir/common/heal.c.o bin/CMakeFiles/lib_darktable.dir/common/histogram.c.o bin/CMakeFiles/lib_darktable.dir/common/history.c.o bin/CMakeFiles/lib_darktable.dir/common/history_snapshot.c.o bin/CMakeFiles/lib_darktable.dir/common/image.c.o bin/CMakeFiles/lib_darktable.dir/common/image_cache.c.o bin/CMakeFiles/lib_darktable.dir/common/image_compression.c.o bin/CMakeFiles/lib_darktable.dir/common/imagebuf.c.o bin/CMakeFiles/lib_darktable.dir/common/import_session.c.o bin/CMakeFiles/lib_darktable.dir/common/interpolation.c.o bin/CMakeFiles/lib_darktable.dir/common/iop_group.c.o bin/CMakeFiles/lib_darktable.dir/common/iop_order.c.o bin/CMakeFiles/lib_darktable.dir/common/iop_profile.c.o bin/CMakeFiles/lib_darktable.dir/common/l10n.c.o bin/CMakeFiles/lib_darktable.dir/common/locallaplacian.c.o bin/CMakeFiles/lib_darktable.dir/common/locallaplaciancl.c.o bin/CMakeFiles/lib_darktable.dir/common/map_locations.c.o bin/CMakeFiles/lib_darktable.dir/common/matrices.c.o bin/CMakeFiles/lib_darktable.dir/common/metadata.c.o bin/CMakeFiles/lib_darktable.dir/common/metadata_export.c.o bin/CMakeFiles/lib_darktable.dir/common/mipmap_cache.c.o bin/CMakeFiles/lib_darktable.dir/common/module.c.o bin/CMakeFiles/lib_darktable.dir/common/nlmeans_core.c.o bin/CMakeFiles/lib_darktable.dir/common/noiseprofiles.c.o bin/CMakeFiles/lib_darktable.dir/common/opencl.c.o bin/CMakeFiles/lib_darktable.dir/common/pdf.c.o bin/CMakeFiles/lib_darktable.dir/common/presets.c.o bin/CMakeFiles/lib_darktable.dir/common/pwstorage/backend_kwallet.c.o bin/CMakeFiles/lib_darktable.dir/common/pwstorage/pwstorage.c.o bin/CMakeFiles/lib_darktable.dir/common/ratings.c.o bin/CMakeFiles/lib_darktable.dir/common/resource_limits.c.o bin/CMakeFiles/lib_darktable.dir/common/selection.c.o bin/CMakeFiles/lib_darktable.dir/common/splines.cpp.o bin/CMakeFiles/lib_darktable.dir/common/styles.c.o bin/CMakeFiles/lib_darktable.dir/common/system_signal_handling.c.o bin/CMakeFiles/lib_darktable.dir/common/tags.c.o bin/CMakeFiles/lib_darktable.dir/common/undo.c.o bin/CMakeFiles/lib_darktable.dir/common/usermanual_url.c.o bin/CMakeFiles/lib_darktable.dir/common/utility.c.o bin/CMakeFiles/lib_darktable.dir/common/variables.c.o bin/CMakeFiles/lib_darktable.dir/common/wb_presets.c.o bin/CMakeFiles/lib_darktable.dir/control/conf.c.o bin/CMakeFiles/lib_darktable.dir/control/control.c.o bin/CMakeFiles/lib_darktable.dir/control/crawler.c.o bin/CMakeFiles/lib_darktable.dir/control/jobs.c.o bin/CMakeFiles/lib_darktable.dir/control/jobs/control_jobs.c.o bin/CMakeFiles/lib_darktable.dir/control/jobs/develop_jobs.c.o bin/CMakeFiles/lib_darktable.dir/control/jobs/film_jobs.c.o bin/CMakeFiles/lib_darktable.dir/control/jobs/image_jobs.c.o bin/CMakeFiles/lib_darktable.dir/control/progress.c.o bin/CMakeFiles/lib_darktable.dir/control/signal.c.o bin/CMakeFiles/lib_darktable.dir/develop/blend.c.o bin/CMakeFiles/lib_darktable.dir/develop/blend_gui.c.o bin/CMakeFiles/lib_darktable.dir/develop/blends/blendif_lab.c.o bin/CMakeFiles/lib_darktable.dir/develop/blends/blendif_raw.c.o bin/CMakeFiles/lib_darktable.dir/develop/blends/blendif_rgb_hsl.c.o bin/CMakeFiles/lib_darktable.dir/develop/blends/blendif_rgb_jzczhz.c.o bin/CMakeFiles/lib_darktable.dir/develop/borders_helper.c.o bin/CMakeFiles/lib_darktable.dir/develop/develop.c.o bin/CMakeFiles/lib_darktable.dir/develop/format.c.o bin/CMakeFiles/lib_darktable.dir/develop/imageop.c.o bin/CMakeFiles/lib_darktable.dir/develop/imageop_gui.c.o bin/CMakeFiles/lib_darktable.dir/develop/imageop_math.c.o bin/CMakeFiles/lib_darktable.dir/develop/lightroom.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/brush.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/circle.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/ellipse.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/gradient.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/group.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/masks.c.o bin/CMakeFiles/lib_darktable.dir/develop/masks/path.c.o bin/CMakeFiles/lib_darktable.dir/develop/pixelpipe.c.o bin/CMakeFiles/lib_darktable.dir/develop/tiling.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/button.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/culling.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/drawingarea.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/expander.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/gradientslider.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/icon.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/paint.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/range.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/resetlabel.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/sidepanel.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail_btn.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbtable.c.o bin/CMakeFiles/lib_darktable.dir/dtgtk/togglebutton.c.o bin/CMakeFiles/lib_darktable.dir/gui/about.c.o bin/CMakeFiles/lib_darktable.dir/gui/accelerators.c.o bin/CMakeFiles/lib_darktable.dir/gui/color_picker_proxy.c.o bin/CMakeFiles/lib_darktable.dir/gui/gtk.c.o bin/CMakeFiles/lib_darktable.dir/gui/gtkentry.c.o bin/CMakeFiles/lib_darktable.dir/gui/guides.c.o bin/CMakeFiles/lib_darktable.dir/gui/hist_dialog.c.o bin/CMakeFiles/lib_darktable.dir/gui/import_metadata.c.o bin/CMakeFiles/lib_darktable.dir/gui/preferences.c.o bin/CMakeFiles/lib_darktable.dir/gui/presets.c.o bin/CMakeFiles/lib_darktable.dir/gui/styles_dialog.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_gm.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_im.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_jpeg.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_module.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_pfm.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_png.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_pnm.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_qoi.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_rgbe.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_tiff.c.o bin/CMakeFiles/lib_darktable.dir/libs/lib.c.o bin/CMakeFiles/lib_darktable.dir/views/view.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_exr.cc.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_jpegxl.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_webp.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_heif.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_libraw.c.o bin/CMakeFiles/lib_darktable.dir/imageio/imageio_j2k.c.o bin/CMakeFiles/lib_darktable.dir/common/sqliteicu.c.o bin/CMakeFiles/lib_darktable.dir/lua/cairo.c.o bin/CMakeFiles/lib_darktable.dir/lua/call.c.o bin/CMakeFiles/lib_darktable.dir/lua/configuration.c.o bin/CMakeFiles/lib_darktable.dir/lua/database.c.o bin/CMakeFiles/lib_darktable.dir/lua/events.c.o bin/CMakeFiles/lib_darktable.dir/lua/film.c.o bin/CMakeFiles/lib_darktable.dir/lua/format.c.o bin/CMakeFiles/lib_darktable.dir/lua/gettext.c.o bin/CMakeFiles/lib_darktable.dir/lua/glist.c.o bin/CMakeFiles/lib_darktable.dir/lua/gui.c.o bin/CMakeFiles/lib_darktable.dir/lua/guides.c.o bin/CMakeFiles/lib_darktable.dir/lua/image.c.o bin/CMakeFiles/lib_darktable.dir/lua/init.c.o bin/CMakeFiles/lib_darktable.dir/lua/lib.c.o bin/CMakeFiles/lib_darktable.dir/lua/lua.c.o bin/CMakeFiles/lib_darktable.dir/lua/lualib.c.o bin/CMakeFiles/lib_darktable.dir/lua/luastorage.c.o bin/CMakeFiles/lib_darktable.dir/lua/modules.c.o bin/CMakeFiles/lib_darktable.dir/lua/password.c.o bin/CMakeFiles/lib_darktable.dir/lua/preferences.c.o bin/CMakeFiles/lib_darktable.dir/lua/print.c.o bin/CMakeFiles/lib_darktable.dir/lua/storage.c.o bin/CMakeFiles/lib_darktable.dir/lua/styles.c.o bin/CMakeFiles/lib_darktable.dir/lua/tags.c.o bin/CMakeFiles/lib_darktable.dir/lua/types.c.o bin/CMakeFiles/lib_darktable.dir/lua/view.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/box.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/button.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/check_button.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/combobox.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/container.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/entry.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/file_chooser.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/label.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/section_label.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/separator.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/slider.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/stack.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/text_view.c.o bin/CMakeFiles/lib_darktable.dir/lua/widget/widget.c.o  bin/external/LuaAutoC/liblautoc.a  bin/external/libwhereami.a  -lpthread  -lm  /data/data/com.termux/files/usr/lib/libglib-2.0.so  -lgtk-3  -lgdk-3  -lz  -lpangocairo-1.0  -lpango-1.0  -lharfbuzz  -latk-1.0  -lcairo-gobject  -lcairo  -lgdk_pixbuf-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  /data/data/com.termux/files/usr/lib/libxml2.so  /data/data/com.termux/files/usr/lib/libOpenEXR-3_2.so  /data/data/com.termux/files/usr/lib/libjxl.so  /data/data/com.termux/files/usr/lib/libjxl_threads.so  /data/data/com.termux/files/usr/lib/libwebp.so  /data/data/com.termux/files/usr/lib/libwebpmux.so  /data/data/com.termux/files/usr/lib/libheif.so.1.17.6  /data/data/com.termux/files/usr/lib/liblensfun.so  /data/data/com.termux/files/usr/lib/libsqlite3.so  /data/data/com.termux/files/usr/lib/libgio-2.0.so  /data/data/com.termux/files/usr/lib/libglib-2.0.so  /data/data/com.termux/files/usr/lib/libgthread-2.0.so  /data/data/com.termux/files/usr/lib/libgmodule-2.0.so  /data/data/com.termux/files/usr/lib/libpangocairo-1.0.so  /data/data/com.termux/files/usr/lib/librsvg-2.so  /data/data/com.termux/files/usr/lib/libcurl.so  /data/data/com.termux/files/usr/lib/libpng.so  /data/data/com.termux/files/usr/lib/libz.so  /data/data/com.termux/files/usr/lib/libjpeg.so  /data/data/com.termux/files/usr/lib/libtiff.so  /data/data/com.termux/files/usr/lib/liblcms2.so  /data/data/com.termux/files/usr/lib/libjson-glib-1.0.so  /data/data/com.termux/files/usr/lib/libexiv2.so  /data/data/com.termux/files/usr/lib/libopenjp2.so  /data/data/com.termux/files/usr/lib/libGraphicsMagick.so  /data/data/com.termux/files/usr/lib/libicui18n.so  /data/data/com.termux/files/usr/lib/libicudata.so  /data/data/com.termux/files/usr/lib/libicuuc.so  -L/data/data/com.termux/files/usr/lib  -llua5.4  -lm  /data/data/com.termux/files/usr/lib/libpugixml.so  bin/liblib_darktable_imageio_rawspeed.a  bin/external/LibRaw-cmake/libraw.a  /data/data/com.termux/files/usr/lib/libglib-2.0.so  -lgtk-3  -lgdk-3  -lz  -lpangocairo-1.0  -lpango-1.0  -lharfbuzz  -latk-1.0  -lcairo-gobject  -lcairo  -lgdk_pixbuf-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  /data/data/com.termux/files/usr/lib/libxml2.so  /data/data/com.termux/files/usr/lib/libjxl.so  /data/data/com.termux/files/usr/lib/libjxl_threads.so  /data/data/com.termux/files/usr/lib/libwebp.so  /data/data/com.termux/files/usr/lib/libwebpmux.so  /data/data/com.termux/files/usr/lib/liblensfun.so  /data/data/com.termux/files/usr/lib/libsqlite3.so  /data/data/com.termux/files/usr/lib/libgio-2.0.so  /data/data/com.termux/files/usr/lib/libgthread-2.0.so  /data/data/com.termux/files/usr/lib/libgmodule-2.0.so  /data/data/com.termux/files/usr/lib/libpangocairo-1.0.so  /data/data/com.termux/files/usr/lib/librsvg-2.so  /data/data/com.termux/files/usr/lib/libcurl.so  /data/data/com.termux/files/usr/lib/libpng.so  /data/data/com.termux/files/usr/lib/libz.so  /data/data/com.termux/files/usr/lib/libjpeg.so  /data/data/com.termux/files/usr/lib/libtiff.so  /data/data/com.termux/files/usr/lib/liblcms2.so  /data/data/com.termux/files/usr/lib/libjson-glib-1.0.so  /data/data/com.termux/files/usr/lib/libexiv2.so  /data/data/com.termux/files/usr/lib/libopenjp2.so  /data/data/com.termux/files/usr/lib/libGraphicsMagick.so  -llua5.4  /data/data/com.termux/files/usr/lib/libIlmThread-3_2.so  /data/data/com.termux/files/usr/lib/libIex-3_2.so  -lpthread  /data/data/com.termux/files/usr/lib/libOpenEXRCore-3_2.so  /data/data/com.termux/files/usr/lib/libImath-3_1.so  -ldl  lib/darktable/rawspeed/librawspeed.a  /data/data/com.termux/files/usr/lib/libpugixml.so  /data/data/com.termux/files/usr/lib/libjpeg.so  -lm  /data/data/com.termux/files/usr/lib/libz.so  /data/data/com.termux/files/usr/lib/libjpeg.so  -lc++  -lm && :
ld.lld: error: relocation refers to a symbol in a discarded section: fast_surface_blur.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: fast_surface_blur.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by focus_peaking.h:111 (/home/builder/.termux-build/darktable/src/src/common/focus_peaking.h:111)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(dt_focuspeaking)
>>> referenced by focus_peaking.h:183 (/home/builder/.termux-build/darktable/src/src/common/focus_peaking.h:183)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(dt_focuspeaking)

ld.lld: error: relocation refers to a symbol in a discarded section: interpolate_bilinear.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: interpolate_bilinear.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:321 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:321)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:344 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:344)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:321 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:321)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse2.0)
>>> referenced 17 more times

ld.lld: error: relocation refers to a symbol in a discarded section: quantize.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: quantize.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:327 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:327)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:327 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:327)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse2.0)
>>> referenced by fast_guided_filter.h:327 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:327)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse3.1)
>>> referenced 7 more times

ld.lld: error: relocation refers to a symbol in a discarded section: variance_analyse.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: variance_analyse.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:331 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:331)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:331 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:331)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse2.0)
>>> referenced by fast_guided_filter.h:331 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:331)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse3.1)
>>> referenced 7 more times

ld.lld: error: relocation refers to a symbol in a discarded section: apply_linear_blending.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: apply_linear_blending.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:339 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:339)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:348 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:348)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:339 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:339)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse2.0)
>>> referenced 17 more times

ld.lld: error: relocation refers to a symbol in a discarded section: apply_linear_blending_w_geomean.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: apply_linear_blending_w_geomean.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:350 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:350)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.default.9)
>>> referenced by fast_guided_filter.h:350 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:350)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse2.0)
>>> referenced by fast_guided_filter.h:350 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:350)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(fast_surface_blur.sse3.1)
>>> referenced 7 more times

ld.lld: error: relocation refers to a symbol in a discarded section: fast_clamp.ifunc
>>> defined in bin/CMakeFiles/lib_darktable.dir/views/view.c.o
>>> section group signature: fast_clamp.resolver
>>> prevailing definition is in bin/CMakeFiles/lib_darktable.dir/dtgtk/thumbnail.c.o
>>> referenced by fast_guided_filter.h:272 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:272)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(.omp_outlined..132)
>>> referenced by fast_guided_filter.h:284 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:284)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(.omp_outlined..134)
>>> referenced by fast_guided_filter.h:272 (/home/builder/.termux-build/darktable/src/src/common/fast_guided_filter.h:272)
>>>               bin/CMakeFiles/lib_darktable.dir/views/view.c.o:(.omp_outlined..136)
>>> referenced 17 more times
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
licy183 commented 8 months ago

It seems that target_clones attribute doesn't make clang LTO happy. You can disable it by patching src/common/darktable.h.

--- a/src/common/darktable.h
+++ b/src/common/darktable.h
@@ -140,7 +140,7 @@
 /* Create cloned functions for various CPU SSE generations */
 /* See for instructions https://hannes.hauswedell.net/post/2017/12/09/fmv/ */
 /* TL;DR : use only on SIMD functions containing low-level paralellized/vectorized loops */
-#if __has_attribute(target_clones) && !defined(_WIN32) && !defined(NATIVE_ARCH)
+#if __has_attribute(target_clones) && !defined(_WIN32) && !defined(NATIVE_ARCH) && !defined(__ANDROID__)
 # if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
 #define __DT_CLONE_TARGETS__ __attribute__((target_clones("default", "sse2", "sse3", "sse4.1", "sse4.2", "popcnt", "avx", "avx2", "avx512f", "fma4")))
 # elif defined(__PPC64__)
knyipab commented 8 months ago

Thanks a lot! Let me pose a pull request later.