这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@finagolfin
Copy link
Member

Check if it builds, as I just corrected the patches locally.

@robertkirkman
Copy link
Member

robertkirkman commented Sep 18, 2025

error: use of undeclared identifier 'TC'

sorry if you already are working on it and know what to do, but in case you need help, when I look at the code related to this error, I could suggest changing the block

if (TC.getTriple().isAndroid()) {
      CmdArgs.push_back("-l:libandroid-complex-math.a");
}

into

if (getTriple().isAndroid()) {
      CmdArgs.push_back("-l:libandroid-complex-math.a");
}

because getTriple() is called without an explicit object everywhere else inside of the source file ToolChain.cpp where this is moved to, because in C++ object oriented programming, the original TC variable referred to an object of class ToolChain, but now that this block is inside a C++ Method which is part of the class ToolChain, the use of the method getTriple() will automatically run in the context of the current ToolChain object, no matter which object it is.

sorry if I overexplained this too much, maybe it is not a difficult problem for you to solve on your own.

@finagolfin
Copy link
Member Author

Fixed the issue and updated: thanks for looking into it, but I had simply moved that patch so it stayed in the method it was in, without checking if it still needed that qualifier.

@finagolfin
Copy link
Member Author

Alright, libllvm builds fine across all arches: download the CI-generated zip file, test it out and let us know if you see any problems. Flang has some build failure and if you look at the patch changes I had to make, it uses a new flang runtime directory that may require further changes to be built and installed. @licy183 or @robertkirkman, let me know if either of you want to handle that, as I am unfamiliar with flang, can just disable that update otherwise.

I am going to refresh the files installed next and update the llvm-config shell script, after which libllvm will be ready to go in. @truboxl, do you want to start trying these packages with rust? That package usually requires a rebuild for a new LLVM.

@robertkirkman
Copy link
Member

I will try to fix flang soon unless licy183 already has an immediate solution, and I will also test my mesa PR with this (since mesa is another package that requires recompiling when libllvm is bumped)

@robertkirkman
Copy link
Member

robertkirkman commented Sep 20, 2025

I can confirm that the change licy183 made is sufficient to build flang, but unfortunately, to recompile mesa with LLVM 21 will require bumping the package spirv-llvm-translator,

and at the moment, there is a severe error in spirv-llvm-translator version 21.1.0 which seems to me like it might be reproducible on more than one operating system. Bisection:

The only distro currently listed by Repology as having started the update to LLVM 21 is Alpine Linux Edge,

https://repology.org/project/llvm/versions

and sure enough, when I took a look into Alpine Linux's WIP CI workflows, the only other place on the internet where the error error: use of undeclared identifier 'OpConditionalExtensionINTEL' can be found is revealed - Alpine Linux is technically currently affected by the same error in spirv-llvm-translator 21.1.0 that Termux is.

https://gitlab.alpinelinux.org/alpine/aports/-/jobs/2006152/raw

image

https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/89408/diffs?commit_id=f04b090f836783dd975221e5fd35786da49dfee0

We could try to help Alpine Linux create a workaround for this error that is acceptable for both of our projects,

or we could also potentially try my first idea for what the simplest workaround would be, which is to try reverting the problematic PR in spirv-llvm-translator in a patch, since the feature it implements appears to be related to Intel hardware, and the vast majority of Termux users do not have Intel hardware, so they would be very unlikely to need the feature associated with the problematic PR (at least that is what I would guess)

@robertkirkman
Copy link
Member

I've found a workaround that seems correct - the required changes are not yet present in any stable release of spirv-headers, so to proceed without waiting, one way that works for me is to cherry-pick this PR and apply it to the spirv-headers package version 1.4.321.0, revision-bump that package, and then bump spirv-llvm-translator, and then recompile mesa.

Everything seems to work fine for me locally after doing that, so I can add my local changes into the PR for bumping mesa after this PR has been merged.

@truboxl
Copy link
Contributor

truboxl commented Sep 20, 2025

I can confirm the current rust package can be rebuild to work with LLVM 21 without extra patches.

@finagolfin
Copy link
Member Author

@licy183, can you try out the flang package you just built and let us know if it is working well?

@licy183
Copy link
Member

licy183 commented Sep 21, 2025

No. It doesn't work properly because flang-rt is missing. I'll have a look later.

@robertkirkman
Copy link
Member

robertkirkman commented Sep 22, 2025

I started also trying to help to fix flang and unfortunately, it might be very difficult and take a very long time, but I will try to help.

I tried this so far:

@@ -78,6 +76,21 @@ termux_step_post_configure() {
 }
 
 termux_step_post_make_install() {
+	termux_setup_flang
+	# attempt to build libflang_rt.runtime.a
+	mkdir -p "$TERMUX_PKG_BUILDDIR/flang-rt"
+	cmake -S "$TERMUX_PKG_SRCDIR/runtimes" \
+		-B "$TERMUX_PKG_BUILDDIR/flang-rt" \
+		-GNinja \
+		-DLLVM_DIR=$TERMUX_PREFIX/lib/cmake/llvm \
+		-DCLANG_DIR=$TERMUX_PREFIX/lib/cmake/clang \
+		-DDLLVM_BINARY_DIR="$(dirname $(dirname $(command -v "$FC")))" \
+		-DCMAKE_Fortran_COMPILER="$(command -v "$FC")" \
+		-DCMAKE_Fortran_COMPILER_WORKS=yes \
+		-DLLVM_ENABLE_RUNTIMES=flang-rt
+	
+	cmake --build "$TERMUX_PKG_BUILDDIR/flang-rt" --parallel $TERMUX_PKG_MAKE_PROCESSES
+
 	# Copy module source files
 	mkdir -p $TERMUX_PREFIX/opt/flang/{include,module}
 	cp -f $TERMUX_PKG_SRCDIR/flang/module/* $TERMUX_PREFIX/opt/flang/module/

and unfortunately, this happens for me currently:

[58/121] Building Fortran object flang-rt/lib/runtime/CMakeFiles/f...er/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90.o
FAILED: flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90.o flang-rt/lib/runtime/iso_fortran_env_impl.mod 
/home/builder/.termux-build/_cache/android-r28c-api-24-v1-flang-v0/bin/aarch64-linux-android-flang-new -I/home/builder/.termux-build/flang/src/flang/module -I/home/builder/.termux-build/flang/src/flang-rt/include -I/home/builder/.termux-build/flang/src/flang-rt/../flang/include -I/home/builder/.termux-build/flang/build/flang-rt/flang-rt -module-dirflang-rt/lib/runtime -fno-lto -U_GLIBCXX_ASSERTIONS -U_LIBCPP_ENABLE_ASSERTIONS -ffixed-line-length-72 -c flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90-pp.f90 -o flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90.o
error: Semantic errors in flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90-pp.f90
/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90:48:53: error: No explicit type declared for 'selected_unsigned_kind'
        integer, parameter, public :: selectedUInt8 = selected_unsigned_ki&
                                                      ^
/home/builder/.termux-build/flang/src/flang/module/iso_fortran_env_impl.f90:66:42: error: No explicit type declared for 'uint'
       &2, -1, selectedUInt8 >= 0), digits(uint(0,kind=safeUInt8)) == 8), &
                                           ^^^^
ninja: build stopped: subcommand failed.

I think that a large part of the problem (at least with my attempt) may be that an aarch64-linux-android-flang-new of version 21 may be required, and aarch64-linux-android-flang-new of version 19 may unfortunately be insufficient to compile the newly-invented libflang_rt.runtime.so and/or libflang_rt.runtime.a, which do not seem to have existed prior to LLVM 21.

tacokoneko@CORSAIR ~/code/termux/termux-packages-icewm $ scripts/run-docker.sh 
Running container 'icewm-termux-package-builder' from image 'ghcr.io/termux/package-builder'...
builder@2b24ac818d44:~/termux-packages$ /home/builder/.termux-build/_cache/android-r28c-api-24-v1-flang-v0/bin/aarch64-linux-android-flang-new --version
Android (dev, -pgo, -bolt, -lto, -mlgo, based on r530567e) flang-new version 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4812a18fb657c2779f5296a4ab2694d2)
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /home/builder/.termux-build/_cache/android-r28c-api-24-v1-flang-v0/bin
builder@2b24ac818d44:~/termux-packages$ 

I have been trying to follow the directions given by this documentation, which has a worrying passage

https://github.com/llvm/llvm-project/blob/main/flang-rt/README.md

CMAKE_Fortran_COMPILER must be flang built from the same Git commit as Flang-RT to ensure they are using the same ABI. The C and C++ compiler can be any compiler supporting the same ABI.

That is what makes me think that maybe it will be necessary to somehow implement a termux_setup_flang_21 which can provide an aarch64-linux-android-flang-new for Ubuntu GNU/Linux to compile Fortran targeting Android which reports version 21 instead of version 19, and I am worried that may be very difficult to create. However it might be possible and I will try.

As a status update, I have now managed to successfully use the flang from this PR on-device by using it to perform a successful on-device build (non-cross-compilation) of a working and usable bionic-libc libflang_rt.runtime.a, manually directing flang to link to that libflang_rt.runtime.a, then compiling and running Fortran hello world successfully using the flang version 21.

This is not a complete solution yet because it is an on-device build and not a cross-compilation, but I hope that showing this can possibly help slightly with the eventual development of a successful cross-compilation of the same thing.

successful on-device build and use of a `libflang_rt.runtime.a` with `flang` version 21
# install all the current artifacts which are downloadable from this PR
apt reinstall ./libllvm_21.1.1_aarch64.deb \
    ./flang_21.1.1_aarch64.deb \
    ./clang_21.1.1_aarch64.deb \
    ./libcompiler-rt_21.1.1_aarch64.deb \
    ./llvm-tools_21.1.1_aarch64.deb \
    ./mlir_21.1.1_aarch64.deb \
    ./llvm_21.1.1_aarch64.deb 
# get llvm source code at the correct version
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.1/llvm-project-21.1.1.src.tar.xz
tar xf llvm-project-21.1.1.src.tar.xz
cd llvm-project-21.1.1.src/
git init && git add . && git commit -m "tmp"
# apply the regular needed Flang-for-Android patches copied from the termux package
git apply -v << 'EOF'
diff --git a/flang-rt/lib/quadmath/complex-math.h b/flang-rt/lib/quadmath/complex-math.h
index b76bf0373..ff1125869 100644
--- a/flang-rt/lib/quadmath/complex-math.h
+++ b/flang-rt/lib/quadmath/complex-math.h
@@ -34,6 +34,23 @@
 #elif HAS_LDBL128
 /* Use 'long double' versions of libm functions. */
 #include <complex.h>
+#if defined(__ANDROID__) && __ANDROID_API__ < 26
+long double complex cacosl (long double complex);
+long double complex cacoshl(long double complex);
+long double complex casinl (long double complex);
+long double complex casinhl(long double complex);
+long double complex catanl (long double complex);
+long double complex catanhl(long double complex);
+long double complex ccosl  (long double complex);
+long double complex ccoshl (long double complex);
+long double complex cexpl  (long double complex);
+long double complex clogl  (long double complex);
+long double complex cpowl  (long double complex, long double complex);
+long double complex csinl  (long double complex);
+long double complex csinhl (long double complex);
+long double complex ctanl  (long double complex);
+long double complex ctanhl (long double complex);
+#endif
 
 #define CAbs(x) cabsl(x)
 #define CAcos(x) cacosl(x)
diff --git a/flang-rt/lib/runtime/complex-reduction.c b/flang-rt/lib/runtime/complex-reduction.c
index 967f26c05..99a685bc4 100644
--- a/flang-rt/lib/runtime/complex-reduction.c
+++ b/flang-rt/lib/runtime/complex-reduction.c
@@ -9,6 +9,18 @@
 #include "complex-reduction.h"
 #include <float.h>
 
+#ifdef __ANDROID__
+#ifdef CMPLXF
+#undef CMPLXF
+#endif // CMPLXF
+#ifdef CMPLX
+#undef CMPLX
+#endif // CMPLX
+#ifdef CMPLXL
+#undef CMPLXL
+#endif // CMPLXL
+#endif // __ANDROID__
+
 struct CppComplexFloat {
   float r, i;
 };
diff --git a/flang-rt/lib/runtime/time-intrinsic.cpp b/flang-rt/lib/runtime/time-intrinsic.cpp
index 8988817a4..1d5ab0bf4 100644
--- a/flang-rt/lib/runtime/time-intrinsic.cpp
+++ b/flang-rt/lib/runtime/time-intrinsic.cpp
@@ -187,7 +187,7 @@ count_t ConvertTimeSpecToCount(int kind, const struct timespec &tspec) {
   return ConvertSecondsNanosecondsToCount(kind, sec, nsec);
 }
 
-#ifndef _AIX
+#if !defined(_AIX) && !(defined(__ANDROID__) && __ANDROID__ < 29)
 // More accurate version with nanosecond accuracy
 template <typename Unused = void>
 count_t GetSystemClockCount(int kind, fallback_implementation) {
EOF
mkdir build-flang-rt
cd build-flang-rt/
cmake ../runtimes -GNinja \
    -DLLVM_DIR=$PREFIX/lib/cmake/llvm \
    -DLLVM_BINARY_DIR=$PREFIX/bin \
    -DCMAKE_Fortran_COMPILER=$(command -v flang) \
    -DCMAKE_Fortran_COMPILER_WORKS=yes \
    -DLLVM_ENABLE_RUNTIMES=flang-rt
cmake --build . --parallel $(nproc)
# the default folder which is expected to contain libflang_rt.runtime.a by the current flang artifact; maybe it should be changed
mkdir -p $PREFIX/lib/clang/21/lib/aarch64-unknown-linux-android24/
cp flang-rt/lib/libflang_rt.runtime.a $PREFIX/lib/clang/21/lib/aarch64-unknown-linux-android24/
cat > hello.f90 << 'EOF'
program hello
  ! This is a comment line; it is ignored by the compiler
  print *, 'Hello, World!'
end program hello
EOF
flang test.f90 -o hello -static-libflangrt
./hello

@robertkirkman
Copy link
Member

I can see that at the same time as I posted that and successfully tested my on-device build of libflang_rt.runtime.a, licy183 was already creating/created the ${TERMUX_HOST_PLATFORM}-flang-new version 21 for cross-compiling that I was talking about, very good job!

@finagolfin finagolfin force-pushed the llvm-21 branch 2 times, most recently from e2d4d4e to 7100bfe Compare September 26, 2025 11:55
@finagolfin finagolfin changed the title bump(libllvm/flang): 20.1.8 to 21.1.1 bump(libllvm/flang): 20.1.8 to 21.1.2 Sep 26, 2025
Copy link
Member

@robertkirkman robertkirkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned, for a brief period after this is merged mesa will stop working (people who have mesa installed and use pkg upgrade will be unable to get the upgrade and see "packages have been held back: libllvm" which is fine), but I have been testing mesa built locally with this LLVM 21 and there aren't any problems with it that I can find that aren't already also present in mesa built with LLVM 20, so I will upload and merge it shortly after this is merged.

@finagolfin
Copy link
Member Author

Bumped this to the latest patch release, test it out and let us know if you see any problems, including with flang.

@robertkirkman
Copy link
Member

robertkirkman commented Sep 27, 2025

These packages are working for me in actual testing after recompiling using LLVM 21.1.2:

  • clang
  • flang
  • rust
  • crystal
  • mesa

This package compiled for me without modifications and without errors, but unfortunately I don't yet know how exactly to use it:

  • wasi-libc

This package fails to compile for me with LLVM 21, but I'm not very familiar with Mingw, so maybe someone else should try to bump and fix it for LLVM 21. If nobody else is available to do so, I could try to bump and fix it myself:

  • llvm-mingw-w64-libcompiler-rt
my log of testing clang, flang, rust, crystal and mesa
~/code $ clang --version
clang version 21.1.2
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
~/code $ flang --version
flang version 21.1.2
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
~/code $ crystal --version
Crystal 1.17.1 [19be240] (2025-09-27)

LLVM: 21.1.2
Default target: aarch64-unknown-linux-android
~/code $ rustc --version --verbose
rustc 1.89.0 (29483883e 2025-08-04) (built from a source tarball)
binary: rustc
commit-hash: 29483883eed69d5fb4db01964cdf2af4d86e9cb2
commit-date: 2025-08-04
host: aarch64-linux-android
release: 1.89.0
LLVM version: 21.1.2
~/code $ cat > hello.c << 'EOF'
> #include <stdio.h>
> int main(void) {
>     printf("hello world\n");
> }
> EOF
~/code $ clang hello.c -ohello -fsanitize=address
~/code $ ./hello
hello world
~/code $ ldd ./hello
	libm.so => /system/lib64/libm.so
	libdl.so => /system/lib64/libdl.so
	libc.so => /system/lib64/libc.so
	ld-android.so => /system/lib64/ld-android.so
~/code $ cat > hello.cpp << 'EOF'
> #include <iostream>
> int main(void) {
>     std::cout << "hello world" << std::endl;
> }
> EOF
~/code $ clang++ hello.cpp -ohello -fsanitize=address
~/code $ ./hello
hello world
~/code $ cat > hello.f90 << 'EOF'
program hello
  print *, 'Hello, World!'                               
end program hello
EOF              
~/code $ flang hello.f90 -o hello
~/code $ ./hello
 Hello, World!
~/code $ cargo new test2
    Creating binary (application) `test2` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
~/code $ cd test2
~/code/test2 $ cargo run
   Compiling test2 v0.1.0 (/data/data/com.termux/files/home/code/test2)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.52s
     Running `target/debug/test2`
Hello, world!
~/code/test2 $ cd -
/data/data/com.termux/files/home/code
~/code $ echo 'puts "Hello World!"' > hello.cr
~/code $ crystal build hello.cr
~/code $ ./hello 
Hello World!
~/code $ LIBGL_ALWAYS_SOFTWARE=1 termux-x11 -xstartup xfce4-session &
[1] 6170
~/code $ 
(xfce4-session:6192): libxfce4util-WARNING **: 16:59:43.245: Failed to get a ConsoleKit proxy: Could not connect: No such file or directory
** Message: 16:59:43.294: Failed to fetch _NET_NUMBER_OF_DESKTOPS; assuming 1
** Message: 16:59:43.297: Failed to get _NET_WORKAREA; using full screen dimensions
** Message: 16:59:43.297: Failed to fetch _NET_CURRENT_DESKTOP; assuming 0
** Message: 16:59:43.298: Failed to fetch _NET_CURRENT_DESKTOP; assuming 0
** Message: 16:59:44.073: Failed to fetch _NET_CURRENT_DESKTOP; assuming 0

(xfwm4:6217): xfwm4-WARNING **: 16:59:44.249: Unsupported GL renderer (llvmpipe (LLVM 21.1.2, 128 bits)).
Baloo File Indexing has been disabled
I2025-09-27 21:59:45.429969 instance.cpp:1400] Override Enabled Addons: {}
I2025-09-27 21:59:45.430293 instance.cpp:1401] Override Disabled Addons: {}
I2025-09-27 21:59:45.450357 xcbconnection.cpp:199] Connecting to X11 display, display name::0.0.
I2025-09-27 21:59:45.451006 addonmanager.cpp:204] Loaded addon xcb
I2025-09-27 21:59:45.454043 addonmanager.cpp:204] Loaded addon quickphrase
I2025-09-27 21:59:45.455045 keyboard.cpp:226] Attempting to load keyboard from: ["/data/data/com.termux/files/usr/share/xkeyboard-config-2"] Rule: evdev

** (process:6263): WARNING **: 16:59:45.464: XDG_CURRENT_DESKTOP not set, unable to check against enabled desktop list. Starting anyway...
I2025-09-27 21:59:45.465303 addonmanager.cpp:204] Loaded addon keyboard
I2025-09-27 21:59:45.489357 addonmanager.cpp:204] Loaded addon imselector
I2025-09-27 21:59:45.502537 addonmanager.cpp:204] Loaded addon clipboard
I2025-09-27 21:59:45.514161 addonmanager.cpp:204] Loaded addon dbus
I2025-09-27 21:59:45.516554 addonmanager.cpp:204] Loaded addon unicode
I2025-09-27 21:59:45.537387 addonmanager.cpp:204] Loaded addon ibusfrontend
I2025-09-27 21:59:45.543649 addonmanager.cpp:204] Loaded addon dbusfrontend
I2025-09-27 21:59:45.570435 addonmanager.cpp:204] Loaded addon fcitx4frontend
I2025-09-27 21:59:45.581263 addonmanager.cpp:204] Loaded addon xim
qt.core.qobject.connect: QObject::connect(QNetworkInformation, LanLinkProvider): invalid nullptr parameter
qt.core.qobject.connect: QObject::connect(QNetworkInformation, LanLinkProvider): invalid nullptr parameter
qt.bluetooth: Dummy backend running. Qt Bluetooth module is non-functional.
kdeconnect.core: No local bluetooth adapter found
I2025-09-27 21:59:45.728826 inputmethodmanager.cpp:210] Found 742 input method(s) in addon keyboard
W2025-09-27 21:59:45.730527 xcbkeyboard.cpp:402] Could not load XKB rules
Error sending UDP packet: QAbstractSocket::NetworkError
I2025-09-27 21:59:45.741185 addonmanager.cpp:204] Loaded addon kimpanel
I2025-09-27 21:59:45.742885 addonmanager.cpp:204] Loaded addon virtualkeyboard
I2025-09-27 21:59:45.789659 classicui.cpp:90] Created classicui for x11 display::0.0
I2025-09-27 21:59:45.789746 addonmanager.cpp:204] Loaded addon classicui
I2025-09-27 21:59:45.794224 addonmanager.cpp:204] Loaded addon notifications
I2025-09-27 21:59:45.794443 dbusmodule.cpp:816] Service name change: org.fcitx.Fcitx5  :1.13
I2025-09-27 21:59:45.794634 kimpanel.cpp:116] Kimpanel new owner: 
I2025-09-27 21:59:45.794664 virtualkeyboard.cpp:218] VirtualKeyboard new owner: 

** (xfdesktop:6254): WARNING **: 16:59:46.919: Failed to get system bus: Could not connect: No such file or directory

~/code $ DISPLAY=:0 glmark2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    zink Vulkan 1.0(Turnip Adreno (TM) 612 (MESA_TURNIP))
    GL_VERSION:     4.0 (Compatibility Profile) Mesa 25.2.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 156 FrameTime: 6.447 ms
[build] use-vbo=true:
(xapp-sn-watcher:6263): GLib-GObject-CRITICAL **: 17:00:15.784: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(xapp-sn-watcher:6263): GLib-GIO-CRITICAL **: 17:00:15.784: g_dbus_interface_skeleton_flush: assertion 'G_IS_DBUS_INTERFACE_SKELETON (interface_)' failed

(xapp-sn-watcher:6263): GLib-GObject-CRITICAL **: 17:00:15.784: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(xapp-sn-watcher:6263): GLib-GIO-CRITICAL **: 17:00:15.784: g_dbus_interface_skeleton_flush: assertion 'G_IS_DBUS_INTERFACE_SKELETON (interface_)' failed

(xapp-sn-watcher:6263): GLib-GObject-CRITICAL **: 17:00:15.785: invalid (NULL) pointer instance

(xapp-sn-watcher:6263): GLib-GObject-CRITICAL **: 17:00:15.785: signal_emit_valist_unlocked: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(xfce4-session:6192): GLib-WARNING **: 17:00:15.843: ../src/glib/gmain.c:6154: waitpid(pid:6263) failed: No child processes (10). See documentation of g_child_watch_source_new() for possible causes.
 FPS: 175 FrameTime: 5.723 ms
[texture] texture-filter=nearest: FPS: 165 FrameTime: 6.082 ms
[texture] texture-filter=linear: FPS: 162 FrameTime: 6.196 ms
[texture] texture-filter=mipmap: FPS: 161 FrameTime: 6.244 ms
[shading] shading=gouraud: FPS: 177 FrameTime: 5.672 ms
[shading] shading=blinn-phong-inf: FPS: 155 FrameTime: 6.484 ms
[shading] shading=phong: FPS: 146 FrameTime: 6.873 ms
[shading] shading=cel: FPS: 149 FrameTime: 6.753 ms
[bump] bump-render=high-poly: FPS: 128 FrameTime: 7.863 ms
[bump] bump-render=normals: FPS: 156 FrameTime: 6.425 ms
[bump] bump-render=height: FPS: 162 FrameTime: 6.190 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 161 FrameTime: 6.248 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 148 FrameTime: 6.798 ms
[pulsar] light=false:quads=5:texture=false: FPS: 151 FrameTime: 6.629 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 115 FrameTime: 8.767 ms
[desktop] effect=shadow:windows=4: FPS: 137 FrameTime: 7.344 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 118 FrameTime: 8.541 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 118 FrameTime: 8.543 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 125 FrameTime: 8.044 ms
[ideas] speed=duration: FPS: 119 FrameTime: 8.405 ms
[jellyfish] <default>: FPS: 126 FrameTime: 7.995 ms
[terrain] <default>: FPS: 29 FrameTime: 34.724 ms
[shadow] <default>: FPS: 106 FrameTime: 9.495 ms
[refract] <default>: FPS: 49 FrameTime: 20.469 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 135 FrameTime: 7.410 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 140 FrameTime: 7.178 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 138 FrameTime: 7.286 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 134 FrameTime: 7.499 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 136 FrameTime: 7.406 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 140 FrameTime: 7.168 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 132 FrameTime: 7.592 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 135 FrameTime: 7.437 ms
=======================================================
                                  glmark2 Score: 134 
=======================================================
~/code $ 

@licy183
Copy link
Member

licy183 commented Sep 28, 2025

  • llvm-mingw-w64-libcompiler-rt

I'll have a look after this PR gets merged.

@robertkirkman robertkirkman linked an issue Oct 1, 2025 that may be closed by this pull request
@finagolfin
Copy link
Member Author

If nobody has any testing complaints, I will update the llvm-config shell script we use on the CI and merge.

@finagolfin finagolfin changed the title bump(libllvm/flang): 20.1.8 to 21.1.2 bump(libllvm/flang): 20.1.8 to 21.1.3 Oct 8, 2025
@finagolfin
Copy link
Member Author

Bumped to the latest patch release, will update llvm-config script and merge soon.

@robertkirkman
Copy link
Member

robertkirkman commented Oct 9, 2025

Oh no! The aarch64 build timed out after 6 hours!

However, (sorry if you also notice this and know about it already, but I am explaining it just in case), I noticed that in this case, it happened because of an intermittent problem that occurs in the Free additional disk space CI step.

This step normally takes only 12-15 minutes, but I have noticed that for some reason, it sometimes gets stuck in a slow cycle that takes over an hour, which can use up the available time of long builds and cause them to take longer than 6 hours

image

I suspect that the root cause might have something to do with rate-limiting of Ubuntu mirrors, but unfortunately I'm not sure what a permanent fix would look like.

When this happens to me, what I've been doing is just using git commit --amend, changing nothing to generate a new commit hash with identical changes, and then force-pushing into the branch to re-run the CI and try again (i.e. doing the same thing over and over again and expecting a different result, which unfortunately in some cases, like this case, does result in a different result). After a couple of tries, I usually get the 13-minute cycle on the Free Space step for all four architectures, and the PR successfully builds in under 6 hours.

@robertkirkman
Copy link
Member

robertkirkman commented Oct 9, 2025

Unfortunately, this activity might cause artifacts to be missing after the merge to the master branch, but I'm not entirely sure if this is the kind of job restart which can cause the problem to manifest or not, I am just bringing it up just in case:

image

we can try merging it like this, but I am mentioning it just so that we know to keep an eye out for whether that issue happens or not as a result.

(But if this PR will get more force-pushes in order to add the llvm-config changes before merging, I think that would probably be sufficient to avoid the issue 26227)

@truboxl
Copy link
Contributor

truboxl commented Oct 9, 2025

You can always "Rebase and merge" for the safest option. I will take a look at the CI PR reuse issue...

finagolfin and others added 3 commits October 13, 2025 15:12
…anitizer instead of the shared library

- Makes the default behavior of on-device building with the address sanitizer match the default behavior of building with the address sanitizer on Clang for Desktop Linux distros, which is to use the static library

- Fixes #26485

- On devices that do not have `libclang_rt.asan-$arch-android.so` or which have a corrupted one, fixes building on-device with `-fsanitize=address`

- Samsung Galaxy S III SPH-L710 with LineageOS 14.1 Android 7.1.2 before:

```
~ $ clang test.c -fsanitize=address
~ $ ./a.out
WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001
CANNOT LINK EXECUTABLE "./a.out": library "libclang_rt.asan-arm-android.so" not found
Aborted                    ./a.out
~ $ clang test.c -fsanitize=address -Wl,-rpath=$PREFIX/lib/clang/20/lib/linux
~ $ ./a.out
WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001
~ $ termux-elf-cleaner ./a.out
termux-elf-cleaner: Replacing unsupported DF_1_* flags 134217729 with 1 in './a.out'
~ $ ./a.out
~ $ file /system/lib/libclang_rt.asan-arm-android.so
/system/lib/libclang_rt.asan-arm-android.so: cannot open `/system/lib/libclang_rt.asan-arm-android.so' (No such file or directory)
~ $
```

- After:
```
~ $ clang test.c -fsanitize=address
~ $ ./a.out
WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001
~ $ termux-elf-cleaner a.out
termux-elf-cleaner: Replacing unsupported DF_1_* flags 134217729 with 1 in 'a.out'
~ $ ./a.out
~ $
```

- Vivo iQOO Neo8 V2301A with Android 15 before:

```
thread #1, name = 'a.out', stop reason = signal SIGILL: illegal opcode
```

- After: believed to work
@finagolfin
Copy link
Member Author

This is now ready to go: building one last time then I will merge later today, after which we will need to update rust and so on.

@finagolfin finagolfin merged commit 815900b into master Oct 13, 2025
13 checks passed
truboxl pushed a commit that referenced this pull request Oct 13, 2025
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this pull request Oct 14, 2025
robertkirkman added a commit that referenced this pull request Oct 14, 2025
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this pull request Oct 14, 2025
MrAdityaAlok added a commit that referenced this pull request Oct 18, 2025
- See PR #26521

Signed-off-by: Aditya Alok <alok@termux.dev>
MrAdityaAlok added a commit that referenced this pull request Oct 18, 2025
- See PR #26521

Signed-off-by: Aditya Alok <alok@termux.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AddressSanitize crash progream

4 participants