wkz / ply

Light-weight Dynamic Tracer for Linux
https://wkz.github.io/ply
GNU General Public License v2.0
402 stars 156 forks source link

question about cross compile #25

Closed jgsun closed 4 years ago

jgsun commented 4 years ago

I try to do cross compiling for ply like below, but it seems that it doesn't take effect.

export PATH=$PATH:/home/jgsun/repo/buildroot-arm64/output/host/opt/ext-toolchain/bin export ARCH=arm64 export CROSS_COMPILE=aarch64-none-linux-gnu- make file src/ply/ply-ply.o src/ply/ply-ply.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped

jgsun commented 4 years ago

but in buildroot, the cross compiling works well:

jgsun@VirtualBox:~/repo/buildroot-arm64/output/build/ply-2.1.1$ file src/ply/ply-ply.o src/ply/ply-ply.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), not stripped

wkz commented 4 years ago

That is not how you cross compile an autotools-based package:

https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html

jgsun commented 4 years ago

@wkz but I failed with this guide:

export PATH=$PATH:/home/jgsun/repo/buildroot-arm64/output/host/bin/ autoreconf -f -i ./configure --host=aarch64-buildroot-linux-gnu --build=x86_64-pc-linux-gnu

jgsun@VirtualBox:~/ply-cross$ file src/ply/ply-ply.o src/ply/ply-ply.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped

Would you kind please help tell me the trueth? Many thanks

BR Jgsun

wkz commented 4 years ago

If you've cloned the git repo the build process should just be:

./autogen.sh
./configure --host=aarch64-your-toolchain-prefix
make

If you're building from a tarball you can skip the call to autogen.sh as configure is shipped in the archive.

Look at the output from configure to make sure that it properly locates your toolchain.