aarch64平台交叉编译strace工具

aarch64平台交叉编译strace工具aarch64平台交叉编译strace工具

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

/*********************************************************************
* Author          :     lile
* Modified        :     2019年12月28日星期六  10:16:13
* Email           :     roger0212@163.com
* HomePage        :     lile777.blog.csdn.net
* CopyRight       :     该文章版权由lile所有。
*                       保留原文出处链接和本声明的前提下,可在非商业目的下任意传播和复制。
*                       对于商业目的下对本文的任何行为需经作者同意。
*********************************************************************/

1,主机环境

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
root@ubuntu:~# cat /proc/version
Linux version 4.4.0-31-generic (buildd@lgw01-43) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016
root@ubuntu:~# file /bin/busybox 
/bin/busybox: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=ae3cf83d83d4ed554fa7ba6d5f2b17c92c362710, stripped
root@ubuntu:~# 
root@ubuntu:~# aarch64-himix100-linux-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-himix100-linux-gcc
COLLECT_LTO_WRAPPER=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/host_bin/../libexec/gcc/aarch64-linux-gnu/6.3.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/src/gcc-6.3.0/configure --build=i386-redhat-linux --host=i386-redhat-linux --target=aarch64-linux-gnu --with-arch=armv8-a --prefix=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install --with-specs='%{!ftree-coalesce-vars:-fno-tree-coalesce-vars}' --disable-libmudflap --disable-libssp --enable-gold=yes --disable-libstdcxx-pch --disable-multilib --enable-multiarch --with-gnu-as --with-gnu-ld --enable-libgomp --enable-gnu-indirect-function --enable-checking=yes --enable-lto --enable-c99 --enable-long-long --disable-nls --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --enable-shared --with-pkgversion='HC&C V100R002C00B027_20181107' --enable-languages=c,c++ --with-headers=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target/usr/include --with-sysroot=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target --with-build-sysroot=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target --with-gmp=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-mpfr=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-mpc=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-cloog=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-build-time-tools=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/aarch64-linux-gnu/bin --libdir=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/lib
Thread model: posix
gcc version 6.3.0 (HC&C V100R002C00B027_20181107) 

2,文件下载

https://src.fedoraproject.org/repo/pkgs/strace/?C=M;O=D
https://strace.io

3,环境依赖与准备

3.1 安装autoreconf工具

apt-get install autoconf automake libtool	

3.2 生成编译引导文件

./bootstrap

4,x86编译测试

# 配置
time ./configure  --prefix=/opt/files/release/strace/x86_64  --enable-mpers=no 


# 编译
time make LDFLAGS+='-static -pthread'

# 安装
time make install

root@ubuntu:/opt/files/strace-5.4# tree /opt/files/release/strace/x86_64/
/opt/files/release/strace/x86_64/
├── bin
│   ├── strace
│   ├── strace-graph
│   └── strace-log-merge
└── share
    └── man
        └── man1
            ├── strace.1
            └── strace-log-merge.1

4 directories, 5 files

root@ubuntu:/opt/files/strace-5.4# file /opt/files/release/strace/x86_64/bin/strace*
/opt/files/release/strace/x86_64/bin/strace:           ELF 64-bit LSB  executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=2c8e6ab98c0963ae70eb9b7889beb0dae4d03939, not stripped
/opt/files/release/strace/x86_64/bin/strace-graph:     Perl script, ASCII text executable
/opt/files/release/strace/x86_64/bin/strace-log-merge: POSIX shell script, ASCII text executable


# 卸载清理
make uninstall && make distclean

5,aarch64平台交叉编译

# 配置
time CC=aarch64-himix100-linux-gcc LD=aarch64-himix100-linux-ld RANLIB=aarch64-himix100-linux-ranlib ./configure --host=aarch64-linux  --prefix=/opt/files/release/strace/aarch64/ --enable-mpers=no 

# 编译
time make LDFLAGS+='-static -pthread'

# 安装
time make install

root@ubuntu:/opt/files/strace-5.4# tree /opt/files/release/strace/aarch64/
/opt/files/release/strace/aarch64/
├── bin
│   ├── strace
│   ├── strace-graph
│   └── strace-log-merge
└── share
    └── man
        └── man1
            ├── strace.1
            └── strace-log-merge.1

4 directories, 5 files
root@ubuntu:/opt/files/strace-5.4# file /opt/files/release/strace/aarch64/bin/*
/opt/files/release/strace/aarch64/bin/strace:           ELF 64-bit LSB  executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, not stripped
/opt/files/release/strace/aarch64/bin/strace-graph:     Perl script, ASCII text executable
/opt/files/release/strace/aarch64/bin/strace-log-merge: POSIX shell script, ASCII text executable
root@ubuntu:/opt/files/strace-5.4# 


# 卸载清理
make uninstall && make distclean

6,Q&A

(1), ./bootstrap: line 40: autoreconf: command not found

apt-get install autoconf automake libtool	

(2),configure: error: Cannot enable m32 personality support

	Re: 4.21 build failure // https://sourceforge.net/p/strace/mailman/strace-devel/
	From: Eugene Syromiatnikov <esyr@re...> - 2018-02-19 19:13:31
	 On Thu, Feb 15, 2018 at 12:39:15AM +0100, Andreas Schwab wrote:
	> 4.21 fails to build for aarch64:
	> 
	> checking gnu/stubs-32.h usability... no
	> checking gnu/stubs-32.h presence... no
	> checking for gnu/stubs-32.h... no
	> configure: Created empty gnu/stubs-32.h
	> checking for m32 personality compile support... no
	> checking whether to enable m32 personality support... no
	> configure: error: Cannot enable m32 personality support

	As noted in NEWS, strace now enforces mpers support by default (in order
	to make aware of the possibilty of incorrect non-native personality
	decoding early); looks like your compiler doesn't support producing
	binaries for the compat personality.  You can either try to use another
	compiler or provide --disable-mpers to the configure script.

	As GCC for AArch64 doesn't support generating ARM EABI binaries at all,
	this issue will probably be somehow tackled in the future. 

7,参考

https://sourceforge.net/p/strace/mailman/strace-devel/
configure: error: Cannot enable m32 personality support

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/181254.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 人力资源管理中的大数据应用之道[通俗易懂]

    人力资源管理中的大数据应用之道[通俗易懂]本文来自网易云社区。随着时代的发展,计算机技术已经成为了人们生活以及日常办公必不可少的重要手段,尤其是近两年来,大数据以及云计算已经成为了企业管理的重要手段,不仅帮助企业提升业务管理,同样对于企业的人力资源管理同样起着重要的作用。从当前时代发展的角度来看,利用大数据进行人力资源分析,能够更好的帮助人力资源部门进行人员的招聘、人才的测评以及对人才进行合理的培训、管理、薪酬的配比以及员工的职业生涯…

  • Spring的两种动态代理Jdk与Cglib

    Spring的两种动态代理Jdk与CglibSpring的两种动态代理Jdk与Cglib

  • nginx默认安装80端口修改[通俗易懂]

    nginx默认安装80端口修改[通俗易懂]nginx默认安装80端口修改nginx默认安装80端口修改nginx默认安装80端口修改nginx安装启动发现80默认端口冲突,一般是和tomcat服务冲突了。所以在这里我们直接取修改nginx的默认端口。通过whereisnginx我们知道了nginx的配置文件目录在配置文件目录下的sites-available目录中我们找到了default文件,进行修改,修改前先备份。vi进去后将80端口修改成8888端口号修改后重启nginx,启动后没有报错。改对应映射nginx.co

  • fastRcNN算法路面病害检测_R语言经典算法

    fastRcNN算法路面病害检测_R语言经典算法  FastR-CNN算法是作者RossGirshick继R-CNN后的又一力作。R-CNN虽然取得了不错的成绩,但是其缺点也很明显。FastR-CNN同样使用VGG-16网络结构,与R-CNN相比训练时间快9倍,测试时间快213倍,准确率从62%提升至66%(再Pascalvoc数据集上)。FastR-CNN主要是解决R-CNN存在的问题:测试训练速度慢,主要是提取候选区域的特征慢:R-CNN首先从测试图中提取2000个候选区域,然后将这2000个候选区域分别输入到预训练好的CNN中提取特征

  • 针不戳,数据库性能优化八大方案。[通俗易懂]

    针不戳,数据库性能优化八大方案。[通俗易懂]毫不夸张的说咱们后端工程师,无论在哪家公司,呆在哪个团队,做哪个系统,遇到的第一个让人头疼的问题绝对是数据库性能问题。如果我们有一套成熟的方法论,能让大家快速、准确的去选择出合适的优化方案,我相信能够快速准备解决咱么日常遇到的80%甚至90%的性能问题。从解决问题的角度出发,我们得先了解到问题的原因;其次我们得有一套思考、判断问题的流程方式,让我们合理的站在哪个层面选择方案;数据库的优化方案核心本质有三种减少数据量、用空间换性能、选择合适的存储系统。这也对应了开篇讲解的慢的三个原因https。…

  • h5页面 请在微信客户端打开链接_使用Fiddler抓包解决“请在微信客户端打开链接”的问题…

    h5页面 请在微信客户端打开链接_使用Fiddler抓包解决“请在微信客户端打开链接”的问题…如何看一个微信小项目的H5源代码,我想大家通用的方式就是在微信里面打开H5,然后点击右上角的复制链接,然后把链接放到PC端浏览器里面查看源代码,但是有很多做了微信授权的H5会提示,如下图做过微信授权开发的朋友都知道,遇到这个页面就算再怎么复制链接都不行了,以前还能在PC端的微信里面直接点链接可以查看代码,貌似现在也被微信封了,但是别人好的代码我们是需要学习交流的,怎么办呢?在网上查了一些资料,发现…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号