Closed SwuduSusuwu closed 1 month ago
Ran without the debug flags, but no difference to issue;
x86_64-w64-mingw32-clang++ -c ./cxx//ClassSha2.cxx
In file included from ./cxx//ClassSha2.cxx:4:
In file included from ./cxx/ClassPortableExecutable.hxx:5:
In file included from ./cxx/ClassObject.hxx:5:
In file included from /data/data/com.termux/files/usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/include/c++/v1/cassert:23:
In file included from /data/data/com.termux/files/usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/include/assert.h:17:
In file included from /data/data/com.termux/files/usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/include/c++/v1/stdlib.h:94:
In file included from /data/data/com.termux/files/usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/include/stdlib.h:656:
/data/data/com.termux/files/usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/include/malloc.h:85:10: fatal error: 'mm_malloc.h' file not found
85 | #include <mm_malloc.h>
| ^~~~~~~~~~~~~
1 error generated.
If ./build.sh
does not accept --mingw
, do git pull
; just pushed this
It is not wrong include paths (as Assistant suggests); mm_alloc.h
just doesn't exist
~/SubStack $ cd ~/
~ $ find ../ | grep mm_alloc.h
~ $ find ../ | grep alloc.h
../home/boost/libs/align/include/boost/align/aligned_alloc.hpp
../home/boost/libs/align/include/boost/align/detail/aligned_alloc.hpp
../home/boost/libs/asio/include/boost/asio/detail/handler_alloc_helpers.hpp
../home/boost/libs/beast/example/http/server/fast/fields_alloc.hpp
../home/boost/libs/compute/include/boost/compute/experimental/malloc.hpp
../home/boost/libs/container/include/boost/container/detail/alloc_helpers.hpp
../home/boost/libs/container/include/boost/container/detail/dlmalloc.hpp
../home/boost/libs/container/include/boost/container/detail/node_alloc_holder.hpp
../home/boost/libs/container/include/boost/container/detail/pool_common_alloc.hpp
../home/boost/libs/pool/doc/html/header/boost/pool/pool_alloc_hpp.html
../home/boost/libs/pool/include/boost/pool/pool_alloc.hpp
../home/boost/libs/python/include/boost/python/detail/dealloc.hpp
../home/boost/libs/thread/include/boost/thread/detail/thread_heap_alloc.hpp
../home/boost/libs/thread/include/boost/thread/pthread/thread_heap_alloc.hpp
../home/boost/libs/thread/include/boost/thread/win32/thread_heap_alloc.hpp
../home/sdk-api/sdk-api-src/content/objidl/nf-objidl-imalloc-heapminimize.md
../home/sdk-api/sdk-api-src/content/shlwapi/nf-shlwapi-shallocshared.md
../home/sdk-api/sdk-api-src/content/objidlbase/nf-objidlbase-imalloc-heapminimize.md
../usr/include/bash/include/memalloc.h
../usr/include/bash/xmalloc.h
../usr/include/nettle/realloc.h
../usr/include/proc/alloc.h
../usr/include/c++/v1/__memory/aligned_alloc.h
../usr/include/malloc.h
../usr/include/linux/falloc.h
../usr/include/clang-tidy/cppcoreguidelines/NoMallocCheck.h
../usr/include/gssapi/gssapi_alloc.h
../usr/include/absl/base/internal/low_level_alloc.h
../usr/include/xen/gntalloc.h
../usr/include/pulse/xmalloc.h
../usr/lib/clang/19/include/mm_malloc.h
../usr/lib/clang/19/include/ppc_wrappers/mm_malloc.h
../usr/share/man/man3/__realloc_hook.3.gz
../usr/share/man/man3/malloc_hook.3.gz
../usr/share/man/man3/__malloc_hook.3.gz
../usr/share/man/man2/alloc_hugepages.2.gz
../usr/share/doc/zimg/example/misc/aligned_malloc.h
../usr/opt/llvm-mingw-w64/generic-w64-mingw32/include/c++/v1/__memory/aligned_alloc.h
../usr/opt/llvm-mingw-w64/generic-w64-mingw32/include/malloc.h
mm_malloc.h
is provided by clang itself, as /data/data/com.termux/files/usr/lib/clang/19/include/mm_malloc.h
.
I can't reproduce it on my device with Termux on F-Droid.
Besides, this seems a bug of Termux App on Google Play Store, you should report it to github.com/termux-play-store/termux-packages.
CC: @fornwall as the maintainer of Termux on Google Play Store
Thanks @SwuduSusuwu for a nice bug report with steps how to reproduce the problem!
This was indeed a problem specific to the updated targetSdk
(with /proc/self/exe
being /system/bin/linker64
) of the Google Play distribution - it has now been fixed in libllvm
version 19.1.1-2
- run pkg up
to upgrade.
It is not wrong include paths (as Assistant suggests); mm_alloc.h just doesn't exist
~/SubStack $ cd ~/ ~ $ find ../ | grep mm_alloc.h
For reference, note that the file name is mm_malloc.h
(which is included in $PREFIX/lib/clang/19/include/mm_malloc.h
as pointed out above) - the problem was instead with how clang found out how it's invoked.
pkg up
success (fixes the mm_malloc.h
error).
Am now stuck on ./cxx//ClassSys.cxx:16:11: fatal error: 'shlobj_core.h' file not found
; all https://www.google.com/search?q=%22%27shlobj_core.h%27+file+not+found%22 has is https://bugzilla.mozilla.org/show_bug.cgi?id=1668721 (which suggests to use #ifdef
to disable such code paths for MinGW) plus https://forums.unrealengine.com/t/cannot-include-shlobj_core-not-package/457976 (which suggests to include ShlObj_core.h
, but this too is not found).
$ cd ../
~ $ find ../|grep ShlObject
~ $ find ../|grep shlobject
~ $ find ../|grep shl*core
../home/sdk-api/sdk-api-src/content/shcore
../home/sdk-api/sdk-api-src/content/shcore/index.md
../home/sdk-api/sdk-api-src/content/shcore/ne-shcore-bsos_options.md
../home/sdk-api/sdk-api-src/content/shcore/nf-shcore-createrandomaccessstreamonfile.md
../home/sdk-api/sdk-api-src/content/shcore/nf-shcore-createrandomaccessstreamoverstream.md
../home/sdk-api/sdk-api-src/content/shcore/nf-shcore-createstreamoverrandomaccessstream.md
../usr/opt/llvm-mingw-w64/aarch64-w64-mingw32/lib/libshcore.a
../usr/opt/llvm-mingw-w64/armv7-w64-mingw32/lib/libshcore.a
../usr/opt/llvm-mingw-w64/generic-w64-mingw32/include/shcore.h
../usr/opt/llvm-mingw-w64/i686-w64-mingw32/lib/libshcore.a
../usr/opt/llvm-mingw-w64/x86_64-w64-mingw32/lib/libshcore.a
shlobj_core.h
is a private header of Win32 SDK. mingw doesn't provide such a header. Try including shlobj.h
instead of shlobj_core.h
.
shlobj_core.h
is a private header of Win32 SDK. mingw doesn't provide such a header. Try includingshlobj.h
instead ofshlobj_core.h
.
Cool, all is success now
Problem description
Termux does not have mingw-w64 (MinGW of Gnu), just llvm-mingw-w64 (Clang's MinGW); the default causes calls to malloc to redirect to _mmalloc (which is not in the
llvm-mingw-*
packages).What steps will reproduce the bug?
What is the expected behavior?
Expect repo to have SIMD headers (such as
mm_alloc.h
), or to not default use thoseSystem information