Skip to content

[Bug] Linker issues with Android NDK 27 #904

@mikalueh

Description

@mikalueh

Describe the bug
make ends in

ld.lld: error: undefined symbol: txring_put
>>> referenced by sendpacket.c:328
>>>               sendpacket.o:(sendpacket) in archive ./common/libcommon.a

ld.lld: error: undefined symbol: txring_init
>>> referenced by sendpacket.c:1088
>>>               sendpacket.o:(sendpacket_open) in archive ./common/libcommon.a
clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [Makefile:721: tcpreplay] Error 1
make[3]: Leaving directory '/home/mika/tcpreplay/src'
make[2]: *** [Makefile:1229: all-recursive] Error 1
make[2]: Leaving directory '/home/mika/tcpreplay/src'
make[1]: *** [Makefile:603: all] Error 2
make[1]: Leaving directory '/home/mika/tcpreplay/src'
make: *** [Makefile:455: all-recursive] Error 1

To Reproduce
Steps to reproduce the behavior:

Run these steps on any Linux Distro (prerequisites must be installed):

git clone https://github.com/appneta/tcpreplay.git
cd tcpreplay
wget https://www.tcpdump.org/release/libpcap-1.10.5.tar.gz
tar zxvf libpcap-1.10.5.tar.gz
cd libpcap-1.10.5
export NDK=/home/mika/android-ndk-r27
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
export TARGET=aarch64-linux-android
export API=21
export SYSROOT=$TOOLCHAIN/sysroot
export CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang
export CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
./configure --host=aarch64-linux-android --with-pcap=linux
make
sudo make install
cd /home/mika/tcpreplay
export NDK=/home/mika/android-ndk-r27
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
export TARGET=aarch64-linux-android
export API=21
export SYSROOT=$TOOLCHAIN/sysroot
export CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang
export CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
./autogen.sh
./configure --host=aarch64-linux-android --build=x86_64-pc-linux-gnu --with-pcap=$SYSROOT/usr/local/lib --with-libpcap=/home/mika/tcpreplay/libpcap-1.10.5 CC=$CC CXX=$CXX
make

Expected behavior
make should build without any errors

Screenshots
none

System (please complete the following information):

  • OS: Linux Debian
  • OS version: 12
  • Tcpreplay Version: 4.5.1

Additional context
none

How can I cross compile it?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions