Re: Cross compilation issue for Android

"$rik@nth" <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CANKSX+FXLy_7cQGZXvuwSeiL3czeM+r0ZE0LtwG29NHdBwdQjg@mail.gmail.com>
Upon moving to next. It landed into another issue. seems it is not easy to
cross compile the valgrind to Android as they mentioned
https://valgrind.org/docs/manual/dist.readme-android.html

Should i need to contact valgrind developers list to support.

../coregrind/link_tool_exe_linux 0x58000000
/local/mnt/workspace/Android_ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang
 -O3 --target=aarch64-linux-android31-clang
--gcc-toolchain=/local/mnt/workspace/Android_ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/
--sysroot=/local/mnt/workspace/Android_ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot
  -o memcheck-arm-linux  -m32 -O2 -g -Wall -Wmissing-prototypes -Wshadow
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual
-Wwrite-strings -Wempty-body -Wformat -Wformat-security
-Wignored-qualifiers -Wenum-conversion -finline-functions
-fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align
-Wno-self-assign -Wno-tautological-compare  -marm -mcpu=cortex-a8 -O2
-static -nodefaultlibs -nostartfiles -u _start   -m32 -Wl,-z,noexecstack
memcheck_arm_linux-mc_leakcheck.o memcheck_arm_linux-mc_malloc_wrappers.o
memcheck_arm_linux-mc_main.o memcheck_arm_linux-mc_main_asm.o
memcheck_arm_linux-mc_translate.o memcheck_arm_linux-mc_machine.o
memcheck_arm_linux-mc_errors.o ../coregrind/libcoregrind-arm-linux.a
../VEX/libvex-arm-linux.a
ld: error: undefined symbol: __aeabi_uidivmod
>>> referenced by mc_leakcheck.c:837
>>>               memcheck_arm_linux-mc_leakcheck.o:(heuristic_reachedness)
>>> referenced by m_execontext.c:346
>>>
libcoregrind_arm_linux_a-m_execontext.o:(record_ExeContext_wrk2) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_execontext.c:346
>>>
libcoregrind_arm_linux_a-m_execontext.o:(record_ExeContext_wrk2) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced 11 more times

ld: error: undefined symbol: __aeabi_d2ulz
>>> referenced by m_debuglog.c:1137
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_debuglog.c:1149
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_xtree.c:969
>>>
libcoregrind_arm_linux_a-m_xtree.o:(vgPlain_XT_massif_print) in archive
../coregrind/libcoregrind-arm-linux.a

ld: error: undefined symbol: __aeabi_ul2d
>>> referenced by m_debuglog.c:1138
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_debuglog.c:1149
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_debuglog.c:1150
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced 18 more times

ld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by m_debuglog.c:1155
>>>
libcoregrind_arm_linux_a-m_debuglog.o:(vgPlain_debugLog_vprintf) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_debuglog.c:877
>>>               libcoregrind_arm_linux_a-m_debuglog.o:(myvprintf_int64)
in archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_debuglog.c:877
>>>               libcoregrind_arm_linux_a-m_debuglog.o:(myvprintf_int64)
in archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced 13 more times

ld: error: undefined symbol: __aeabi_uidiv
>>> referenced by m_libcbase.c:925
>>>               libcoregrind_arm_linux_a-m_libcbase.o:(bm_qsort) in
archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_libcbase.c:929
>>>               libcoregrind_arm_linux_a-m_libcbase.o:(bm_qsort) in
archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_libcbase.c:916
>>>               libcoregrind_arm_linux_a-m_libcbase.o:(bm_qsort) in
archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced 17 more times

ld: error: undefined symbol: __aeabi_idiv
>>> referenced by m_transtab.c:1789
>>>
libcoregrind_arm_linux_a-m_transtab.o:(vgPlain_add_to_transtab) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by m_transtab.c:1795
>>>
libcoregrind_arm_linux_a-m_transtab.o:(vgPlain_add_to_transtab) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by d3basics.c:899 (m_debuginfo/d3basics.c:899)
>>>
libcoregrind_arm_linux_a-d3basics.o:(vgModuleLocal_evaluate_Dwarf3_Expr) in
archive ../coregrind/libcoregrind-arm-linux.a
>>> referenced 3 more times

ld: error: undefined symbol: __aeabi_idivmod
>>> referenced by readdwarf3.c:5529 (m_debuginfo/readdwarf3.c:5529)
>>>
libcoregrind_arm_linux_a-readdwarf3.o:(new_dwarf3_reader_wrk) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by readdwarf3.c:5532 (m_debuginfo/readdwarf3.c:5532)
>>>
libcoregrind_arm_linux_a-readdwarf3.o:(new_dwarf3_reader_wrk) in archive
../coregrind/libcoregrind-arm-linux.a
>>> referenced by ir_opt.c:3426 (priv/ir_opt.c:3426)
>>>               libvex_arm_linux_a-ir_opt.o:(getAliasingRelation_II) in
archive ../VEX/libvex-arm-linux.a
>>> referenced 1 more times

ld: error: undefined symbol: __aeabi_ldivmod
>>> referenced by host_generic_simd64.c:1627
(priv/host_generic_simd64.c:1627)
>>>
libvex_arm_linux_a-host_generic_simd64.o:(h_calc_sdiv64_w_arm_semantics) in
archive ../VEX/libvex-arm-linux.a
clang-12: error: linker command failed with exit code 1 (use -v to see
invocation)
Makefile:1111: recipe for target 'memcheck-arm-linux' failed
make[3]: *** [memcheck-arm-linux] Error 1
make[3]: Leaving directory
'/local/mnt/workspace/valgrind/valgrind-3.19.0/memcheck'
Makefile:1423: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
'/local/mnt/workspace/valgrind/valgrind-3.19.0/memcheck'
Makefile:896: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/local/mnt/workspace/valgrind/valgrind-3.19.0'
Makefile:759: recipe for target 'all' failed
make: *** [all] Error 2

On Fri, Jun 24, 2022 at 6:24 PM Floyd, Paul <[email protected]> wrote:

>
>
> On 2022-06-24 05:41, $rik@nth wrote:
> > Hello Paul,
> >
> > Seems even after removing -lgcc from Makefile.tool.am
> > <http://Makefile.tool.am> compilation is still failing because of other
> > dependencies on libgcc.
>
> > ../coregrind/libgcc-sup-arm64-linux.a
> > ld: error: undefined symbol: __aeabi_uidivmod
> >  >>> referenced by mc_leakcheck.c:837
> >  >>>
> memcheck_arm_linux-mc_leakcheck.o:(heuristic_reachedness)
> >  >>> referenced by m_execontext.c:346
> >  >>>
>
> The source line is just
>
>
>           if (nr_elts > 0 && (ch->szB - sizeof(SizeT)) % nr_elts == 0) {
>
> and I presume that is the modulus operator that is bringing in
> __aeabi_uidivmod
>
> According to https://clang.llvm.org/docs/ClangCommandLineReference.html
> there may be a clang runtime library libclang_rt.builtins.*.a
>
> If you have that could you try linking with it (instead of libgcc.a)?
>
> A+
> Paul
>
>
> _______________________________________________
> Valgrind-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>


-- 
Thanks & Regards,
M.Srikanth Kumar.

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.