Re: Cross compilation issue for Android

"$rik@nth" <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CANKSX+FC5tJ+kaGoGdVQUDL0Pj7Z4CK7QENFcOeu4y3nZJen9Q@mail.gmail.com>
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@-@[email protected]
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 <[email protected]> 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
> [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.