[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] arm cross-compile/link errors: undefined reference to
From: |
Allen Hamedany |
Subject: |
[Libunwind-devel] arm cross-compile/link errors: undefined reference to AO_fetch_and_add & AO_fetch_and_add1 |
Date: |
Mon, 18 Aug 2014 18:16:37 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Hi,
Having called libunwind APIs in my code, I am trying to get a clean
cross-compile/link w/o much success.
Here's pertinent info:
HOST: runs centos6.5 on 32bit machine
TARGET: armv7l on TI AM335x (linux)
The goal is to run the arm executable on the arm TARGET machine.
However, development and debugging are done on HOST machine.
Debugging is done using cross-gdb.
TARGET:
Linux 3.2.0+ #48 armv7l GNU/Linux
HOST:
Linux 2.6.32-431.17.1.el6.i686 #1 SMP i686 i686 i386 GNU/Linux
Cross-tool-chain versions (running on HOST):
gcc/g++ version: arm-arago-linux-gnueabi-gcc/g++ v4.5.3
ld version: GNU ld (GNU Binutils) v2.20.1.20100303
Native HOST versions:
gcc (GCC)/g++: v4.5.2
ld: GNU ld v2.20.51.0.2-5.36.el6 20100205
+==========================+
libunwind1.1:
env vars:
ti=<arm-toolchain-path>/bin
CFLAGS="-std=gnu99 "
HOST=i686-pc-linux-gnu
TARGET=arm-arago-linux-gnueabi
./configure --host=$HOST --target=$TARGET CC=$ti/*gcc CFLAGS=$CFLAGS
CXX=$ti/*g++ CXXFLAGS=$CXXFLAGS
LDFLAGS="-L<unwind-inst-dir>/libunwind/libunwind-1.1/src/.l
ibs"
I made this softlink:<arm-toolchain-path>/usr/lib/libunwind-arm.so to
<libunwind-extract-area>/libunwind-1.1/src/.libs/libunwind-arm.so
When cross-linking to my app using switches:
-Xlinker -lunwind-arm
I get:
/scratch/ti/AM335x/linux-devkit/bin/../arm-arago-linux-gnueabi/usr/lib/libunwind-arm.so:
undefined reference to 'AO_fetch_and_add'
/scratch/ti/AM335x/linux-devkit/bin/../arm-arago-linux-gnueabi/usr/lib/libunwind-arm.so:
undefined reference to 'AO_fetch_and_add1'
+============================+
I tried fixing the above link w/building atomic-ops lib.
Downloaded and installed libatomic_ops-7.4.2.
The following libs are created:
libatomic_ops.a
libatomic_ops_gpl.a
I also softlinked the above atomic-ops libs as
<arm-toolchain-path>/usr/lib/libatomic_ops.a & lib_atomic_ops_gpl.a
I retried linking my app using the following switches:
-Xlinker -latomic_ops_gpl -latomic_ops -lunwind-arm
However, I still get the above "undefined reference" errors.
Any help is much appreciated.
- [Libunwind-devel] arm cross-compile/link errors: undefined reference to AO_fetch_and_add & AO_fetch_and_add1,
Allen Hamedany <=