|
From: $<ri...@nt...> - 2022-06-23 10:04:51
|
Hello Valgrind Users,
I am trying to cross compile the valgrind for Android using NDK. But I am
seeing the compilation error. Has anyone faced a similar issue?
../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
-o memcheck-arm64-linux -m64 -O2 -g -Wall -Wmissing-prototypes
-Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
-Wcast-align -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 -O2 -static -nodefaultlibs
-nostartfiles -u _start -m64 memcheck_arm64_linux-mc_leakcheck.o
memcheck_arm64_linux-mc_malloc_wrappers.o memcheck_arm64_linux-mc_main.o
memcheck_arm64_linux-mc_main_asm.o memcheck_arm64_linux-mc_translate.o
memcheck_arm64_linux-mc_machine.o memcheck_arm64_linux-mc_errors.o
../coregrind/libcoregrind-arm64-linux.a ../VEX/libvex-arm64-linux.a -lgcc
../coregrind/libgcc-sup-arm64-linux.a
ld: error: unable to find library -lgcc
clang-12: error: linker command failed with exit code 1 (use -v to see
invocation)
Makefile:1111: recipe for target 'memcheck-arm64-linux' failed
make[3]: *** [memcheck-arm64-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
--
Thanks & Regards,
M.Srikanth Kumar.
|
|
From: Floyd, P. <pj...@wa...> - 2022-06-23 15:25:10
|
On 2022-06-23 12:04, $rik@nth wrote: > Hello Valgrind Users, > > I am trying to cross compile the valgrind for Android using NDK. But I > am seeing the compilation error. Has anyone faced a similar issue? Hi I did touch this recently (on FreeBSD which uses clang as system compiler). I did try removing this dependency, but it caused some failures due to the use of intrinsics in libgcc. So I kept it - libgcc is available on stock FreeBSD. It's quite easy to fix. Edit Makefile.tool.am in the root Valgrind source directory and just remove -lgcc from TOOL_LDADD_COMMON Rerun autogen.sh and configure. A+ Paul |
|
From: Dallman, J. <joh...@si...> - 2022-06-23 15:51:09
|
NDK23c does not provide any libgcc libraries. This is reasonable, since it also does not provide a gcc: it uses clang instead. I’ve never tried to build Valgrind for Android, but hopefully someone else can tell you how to do it with a modern NDK. -- John Dallman From: $rik@nth <sri...@gm...> Sent: 23 June 2022 11:05 To: val...@li... Subject: [Valgrind-users] Cross compilation issue for Android Hello Valgrind Users, I am trying to cross compile the valgrind for Android using NDK. But I am seeing the compilation error. Has anyone faced a similar issue? ../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 -o memcheck-arm64-linux -m64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -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 -O2 -static -nodefaultlibs -nostartfiles -u _start -m64 memcheck_arm64_linux-mc_leakcheck.o memcheck_arm64_linux-mc_malloc_wrappers.o memcheck_arm64_linux-mc_main.o memcheck_arm64_linux-mc_main_asm.o memcheck_arm64_linux-mc_translate.o memcheck_arm64_linux-mc_machine.o memcheck_arm64_linux-mc_errors.o ../coregrind/libcoregrind-arm64-linux.a ../VEX/libvex-arm64-linux.a -lgcc ../coregrind/libgcc-sup-arm64-linux.a ld: error: unable to find library -lgcc clang-12: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:1111: recipe for target 'memcheck-arm64-linux' failed make[3]: *** [memcheck-arm64-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 -- Thanks & Regards, M.Srikanth Kumar. ----------------- Siemens Industry Software Limited is a limited company registered in England and Wales. Registered number: 3476850. Registered office: Pinehurst 2, Pinehurst Road, Farnborough, Hampshire, GU14 7BF. |
|
From: $<ri...@nt...> - 2022-06-23 15:14:43
|
Ok, thanks for the reply. Anyone else in the group have ever tried cross compiling and get success with this? On Thu, Jun 23, 2022, 8:40 PM Dallman, John <joh...@si...> wrote: > NDK23c does not provide any libgcc libraries. This is reasonable, since it > also does not provide a gcc: it uses clang instead. I’ve never tried to > build Valgrind for Android, but hopefully someone else can tell you how to > do it with a modern NDK. > > > > -- > > John Dallman > > > > *From:* $rik@nth <sri...@gm...> > *Sent:* 23 June 2022 11:05 > *To:* val...@li... > *Subject:* [Valgrind-users] Cross compilation issue for Android > > > > Hello Valgrind Users, > > > > I am trying to cross compile the valgrind for Android using NDK. But I am > seeing the compilation error. Has anyone faced a similar issue? > > > > ../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 > -o memcheck-arm64-linux -m64 -O2 -g -Wall -Wmissing-prototypes > -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations > -Wcast-align -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 -O2 -static -nodefaultlibs > -nostartfiles -u _start -m64 memcheck_arm64_linux-mc_leakcheck.o > memcheck_arm64_linux-mc_malloc_wrappers.o memcheck_arm64_linux-mc_main.o > memcheck_arm64_linux-mc_main_asm.o memcheck_arm64_linux-mc_translate.o > memcheck_arm64_linux-mc_machine.o memcheck_arm64_linux-mc_errors.o > ../coregrind/libcoregrind-arm64-linux.a ../VEX/libvex-arm64-linux.a -lgcc > ../coregrind/libgcc-sup-arm64-linux.a > ld: error: unable to find library -lgcc > clang-12: error: linker command failed with exit code 1 (use -v to see > invocation) > Makefile:1111: recipe for target 'memcheck-arm64-linux' failed > make[3]: *** [memcheck-arm64-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 > > > > > > -- > > Thanks & Regards, > M.Srikanth Kumar. > > ----------------- > Siemens Industry Software Limited is a limited company registered in > England and Wales. > Registered number: 3476850. > Registered office: Pinehurst 2, Pinehurst Road, Farnborough, Hampshire, > GU14 7BF. > |
|
From: $<ri...@nt...> - 2022-06-24 05:28:43
|
Hello Paul,
Seems even after removing -lgcc from Makefile.tool.am compilation is still
failing because of other dependencies on libgcc.
==================================================================================
TOOL_LDADD_COMMON = \
$(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
if VGCONF_HAVE_PLATFORM_SEC
TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
endif
==================================================================================
../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-align
-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 ../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
>>>
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:1099: 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:1401: 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 Thu, Jun 23, 2022 at 8:56 PM Floyd, Paul <pj...@wa...> wrote:
>
>
> On 2022-06-23 12:04, $rik@nth wrote:
> > Hello Valgrind Users,
> >
> > I am trying to cross compile the valgrind for Android using NDK. But I
> > am seeing the compilation error. Has anyone faced a similar issue?
>
> Hi
>
> I did touch this recently (on FreeBSD which uses clang as system
> compiler). I did try removing this dependency, but it caused some
> failures due to the use of intrinsics in libgcc. So I kept it - libgcc
> is available on stock FreeBSD.
>
> It's quite easy to fix.
>
> Edit Makefile.tool.am in the root Valgrind source directory and just
> remove -lgcc from TOOL_LDADD_COMMON
>
> Rerun autogen.sh and configure.
>
>
> A+
> Paul
>
>
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
--
Thanks & Regards,
M.Srikanth Kumar.
|
|
From: Floyd, P. <pj...@wa...> - 2022-06-24 12:53:09
|
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 |
|
From: $<ri...@nt...> - 2022-06-25 06:37:33
|
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 <pj...@wa...> 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 > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > -- Thanks & Regards, M.Srikanth Kumar. |
|
From: John R. <jr...@bi...> - 2022-06-26 22:32:23
|
> 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 <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 > > [[snip]] You should contact whoever supports aarch64-linux-android31-clang and complaln that their linker step for static linking forgets to reference a static library that contains __aeabi_uidivmod, __aeabi_d2ulz, __aeabi_ul2d, __aeabi_uldivmod, __aeabi_uidiv, __aeabi_idiv, __aeabi_idivmod, and __aeabi_ldivmod . I found them in: ----- $ nm -gop --defined-only $(find . -name '*.a' 2>/dev/null) | grep __aeabi_uidivmod ./Android/Sdk/build-tools/32.0.0/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 T __aeabi_uidivmod ./Android/Sdk/build-tools/32.1.0-rc1/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 T __aeabi_uidivmod ./Android/Sdk/build-tools/30.0.3/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 T __aeabi_uidivmod $ ----- and similarly for the other undefined symbols. Therefore a workaround is to append explicit names for the files that contain those runtime symbols that you desire. The hint on how to investigate this problem is in valgrind/coregrind/link_tool_exe_linux which is a well-documented perl script that contains ----- # So: what we actually do: # # pass the specified command to the linker as-is, except, ... my $cmd = join(" ", @ARGV, "-static -Wl,-Ttext-segment=$ala"); #print "link_tool_exe_linux: $cmd\n"; # Execute the command: my $r = system($cmd); ----- which shows that aarch64-linux-android31-clang is at fault when static linking. (Forgetting the case of static linking is a common error in cross-building systems.) |
|
From: $<ri...@nt...> - 2022-06-27 13:50:07
|
Things got resolved after moving to older ndk where it supports gcc. On Mon, Jun 27, 2022, 4:04 AM John Reiser <jr...@bi...> wrote: > > 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 < > 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 > > > [[snip]] > > You should contact whoever supports aarch64-linux-android31-clang and > complaln > that their linker step for static linking forgets to reference a static > library > that contains __aeabi_uidivmod, __aeabi_d2ulz, __aeabi_ul2d, > __aeabi_uldivmod, > __aeabi_uidiv, __aeabi_idiv, __aeabi_idivmod, and __aeabi_ldivmod . > > I found them in: > ----- > $ nm -gop --defined-only $(find . -name '*.a' 2>/dev/null) | grep > __aeabi_uidivmod > ./Android/Sdk/build-tools/32.0.0/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 > T __aeabi_uidivmod > ./Android/Sdk/build-tools/32.1.0-rc1/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 > T __aeabi_uidivmod > ./Android/Sdk/build-tools/30.0.3/renderscript/lib/intermediates/armeabi-v7a/libcompiler_rt.a:aeabi_uidivmod.o:00000000 > T __aeabi_uidivmod > $ > ----- > and similarly for the other undefined symbols. > > Therefore a workaround is to append explicit names for the files that > contain > those runtime symbols that you desire. > > The hint on how to investigate this problem is in > valgrind/coregrind/link_tool_exe_linux > which is a well-documented perl script that contains > ----- > # So: what we actually do: > # > # pass the specified command to the linker as-is, except, ... > > my $cmd = join(" ", @ARGV, "-static -Wl,-Ttext-segment=$ala"); > > #print "link_tool_exe_linux: $cmd\n"; > > > # Execute the command: > my $r = system($cmd); > ----- > which shows that aarch64-linux-android31-clang is at fault when static > linking. > (Forgetting the case of static linking is a common error in cross-building > systems.) > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: John R. <jr...@bi...> - 2022-06-27 14:00:23
|
On 6/27/22, $rik@nth wrote: > Things got resolved after moving to older ndk where it supports gcc. Please state exactly which older version worked for you. This will help other valgrind developers now, and encourage maintainers to enhance future support so that the underlying problem gets fixed. |
|
From: $<ri...@nt...> - 2022-06-27 15:39:40
|
Used https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip version where I am able to cross compile valgrind version 3.19.0 version without any problem. On Mon, Jun 27, 2022, 7:32 PM John Reiser <jr...@bi...> wrote: > On 6/27/22, $rik@nth wrote: > > Things got resolved after moving to older ndk where it supports gcc. > > Please state exactly which older version worked for you. > This will help other valgrind developers now, and encourage > maintainers to enhance future support so that the underlying > problem gets fixed. > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |