测试环境: VM 虚拟机 Ubuntu 64 (有个 kali 1.0.9 )
打开新的终端都用 root 权限来执行命令: sudo -i
我的目录路径位: /home/seeu/
一 . 安装编译 osmocomBB 所需的软件包:
aptitude install libtool shtool autoconf git-core pkg-config make gcc
apt-get install build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev
二 .OsmocomBB 交叉编译环境 (下载环境包 解压 把 gnuarm-xxx 目录下的文件搬到 gnuarm ):
wget http://gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
tar xf bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
mv gnuarm-* ~/gnuarm
echo "export PATH=\$PATH:/home/seeu/gunarm/bin">/seeu/.bashrc
source/home/seeu/.bashrc
三 . 下载 gnu-arm-build.2.sh 加权限 在添加三个文件夹 并且在 src 目录下下载三个文件:
wget -c http://bb.osmocom.org/trac/raw-attachment/wiki/GnuArmToolchain/gnu-arm-build.2.sh
chmod +x gnu-arm-build.2.sh
mkdir build install src
cd/home/seeu/src/
wget http://www.gnuarm.com/bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
cd ..
./gnu-arm-build.2.sh
四 . 编译 libosmocore , OsmocomBB :
cd/home/seeu/
git clone git://git.osmocom.org/libosmocore.git
cd libosmocore/
autoreconf -i
./configure
make
make install
cd ..
.ldconfig
git clone git://git.osmocom.org/osmocom-bb.git
cd/home/seeu/osmocom-bb
git checkout --track origin/luca/gsmmap
cd src
git pull --rebase
make
如果没有错误的话,那么恭喜你,环境设置已完成。
常见错误请看下面:
1.
![Osmocom-BB项目(含大部分错误解决方法)]()
/root/osmocom-bb/src/target/firmware/include/asm/swab.h: Assembler messages: /root/osmocom-bb/src/target/firmware/include/asm/swab.h:32: Error: no such instruction: `eor %edx,%ecx,%ecx,ror’ make[4]: *** [gsmtap_util.lo] 错误 1 make[4]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target/src’ make[3]: *** [all] 错误 2 make[3]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target/src’ make[2]: *** [all-recursive] 错误 1 make[2]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target’ make[1]: *** [all] 错误 2 make[1]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target’ make: *** [shared/libosmocore/build-target/src/.libs/libosmocore.a] 错误 2 或者
![Osmocom-BB项目(含大部分错误解决方法)]()
configure: error: C compiler cannot create executables See `config.log’ for more details make: *** [shared/libosmocore/build-target/Makefile] 错误 77 这两个错误都是 OsmocomBB 交叉编译环境出现问题,因为网上很多文章说一半不说一半导致 没安装好标题二里面的环境包又或者你的环境包下载错了 解决: 安装 32 位架构 wget http://gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2 tar xf bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2 mv gnuarm-* ~/gnuarm 64 位架构 wget http://www.gnuarm.com/bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2 tar xf bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2 mv gnuarm-* ~/gnuarm 2.
![Osmocom-BB项目(含大部分错误解决方法)]()
make[1]: *** [board/compal_e88/hello_world.compalram.elf] 错

/root/osmocom-bb/src/target/firmware/include/asm/swab.h: Assembler messages: /root/osmocom-bb/src/target/firmware/include/asm/swab.h:32: Error: no such instruction: `eor %edx,%ecx,%ecx,ror’ make[4]: *** [gsmtap_util.lo] 错误 1 make[4]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target/src’ make[3]: *** [all] 错误 2 make[3]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target/src’ make[2]: *** [all-recursive] 错误 1 make[2]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target’ make[1]: *** [all] 错误 2 make[1]: Leaving directory `/root/osmocom-bb/src/shared/libosmocore/build-target’ make: *** [shared/libosmocore/build-target/src/.libs/libosmocore.a] 错误 2 或者

configure: error: C compiler cannot create executables See `config.log’ for more details make: *** [shared/libosmocore/build-target/Makefile] 错误 77 这两个错误都是 OsmocomBB 交叉编译环境出现问题,因为网上很多文章说一半不说一半导致 没安装好标题二里面的环境包又或者你的环境包下载错了 解决: 安装 32 位架构 wget http://gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2 tar xf bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2 mv gnuarm-* ~/gnuarm 64 位架构 wget http://www.gnuarm.com/bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2 tar xf bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2 mv gnuarm-* ~/gnuarm 2.

make[1]: *** [board/compal_e88/hello_world.compalram.elf] 错