Skip to content

aarch64 - Failed to iterate the unwind table: UnknownCallFrameInstruction(DwCfa(45)) #114

Open
@krzysiek6d

Description

I'm trying to cross-compile bytehound for aarch64

git clone https://github.com/koute/bytehound.git
cd bytehound
CC='aarch64-linux-gnu-gcc' cargo build --target aarch64-unknown-linux-gnu --release -p bytehound-preload

....
		Compiling bytehound-preload v0.11.0 (/home/pawluch/temp/bytehound/preload)
	    Building [=========================> ] 88/89: bytehound-preload
	    <some warnings>
	    warning: variant `Glibc` is never constructed
	    warning: constant `STT_GNU_IFUNC` is never used
	    <and more>
	    <and finally error>
	    error: linking with `cc` failed: exit status: 1
  		|
  		= note: "cc" "-Wl,--version-script=/tmp/rustc37VL1r/list" "/tmp/rustc37VL1r/symbols.o" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/deps/bytehound.bytehound.1141c7cc-cgu.6.rcgu.o" "-Wl,--as-needed" "-L" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/deps" "-L" "/home/pawluch/temp/bytehound/target/release/deps" "-L" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/build/libmimalloc-sys-2a7d2fcd1ef6bcf9/out" "-L" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/build/nwind-45c923a06e07786b/out" "-L" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/build/tikv-jemalloc-sys-56e739c58320660d/out/build/lib" "-L" "/home/pawluch/.rustup/toolchains/nightly-2022-10-13-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustc37VL1r/liblibmimalloc_sys-c81f41ca1d102f5f.rlib" "/tmp/rustc37VL1r/libtikv_jemalloc_sys-d8283604389b0ad8.rlib" "/tmp/rustc37VL1r/libnwind-223626fcb709192a.rlib" "/home/pawluch/.rustup/toolchains/nightly-2022-10-13-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-e0edb30d3bc4ef0f.rlib" "-Wl,-Bdynamic" "-lpthread" "-lstdc++" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/pawluch/.rustup/toolchains/nightly-2022-10-13-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-o" "/home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/deps/libbytehound.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  		<lot of lines with: >
  		/usr/bin/ld: /home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/deps/bytehound.bytehound.1141c7cc-cgu.6.rcgu.o: Relocations in generic ELF (EM: 183)
  		<and finally>
  		/usr/bin/ld: /home/pawluch/temp/bytehound/target/aarch64-unknown-linux-gnu/release/deps/bytehound.bytehound.1141c7cc-cgu.6.rcgu.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status
          

		warning: `bytehound-preload` (lib) generated 16 warnings
		error: could not compile `bytehound-preload` due to previous error; 16 warnings emitted

What am I doing wrong with this cross-compilation?
I tried with sdk, where I passed also --sysroot and there is the same output

P.S.

I'm trying to recompile it since current bytehound I'm using crashes binaries for that architecture and I thought that maybe I'm using too old version which does not match some libs in the binary I'm trying to profile. It collects some data for ~5mins and then app is crashing. Profiled do not have any good backtrace ;(
image
Disabling shadow-based stack unwinding did not help. Maybe you have some idea what caused that problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions