Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Linker issues with Android NDK 27 #904

Open
mikalueh opened this issue Oct 8, 2024 · 0 comments
Open

[Bug] Linker issues with Android NDK 27 #904

mikalueh opened this issue Oct 8, 2024 · 0 comments

Comments

@mikalueh
Copy link

mikalueh commented Oct 8, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant