Ubuntu14.04 交叉编译Qt-creator
2017-10-31 10:53
399 查看
1. 下载Qt-creator 的源码:
链接:http://download.qt.io/official_releases/qtcreator/2. 进入源码目录编译:
$ qmake qtcreator.pro $ make ....... ../3rdparty/botan/botan.cpp:46220:21: fatal error: cpuid.h: No such file or directory compilation terminated. make[3]: *** [.obj/debug-shared/botan.o] Error 1
这个错误貌似每个qt-creator 版本编译都会有, 你需要给该源码打一个patch。
Patch 的内容如下:
diff --git a/src/libs/3rdparty/botan/botan.cpp b/src/libs/3rdparty/botan/botan.cpp index 917c385..4364a2e 100644 --- a/src/libs/3rdparty/botan/botan.cpp +++ b/src/libs/3rdparty/botan/botan.cpp @@ -1101,6 +1101,8 @@ class Montgomery_Exponentiator : public Modular_Exponentiator #if (BOTAN_MP_WORD_BITS != 32) #error The mp_x86_32 module requires that BOTAN_MP_WORD_BITS == 32 +#elif !defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) +typedef Botan::u64bit dword; #endif #ifdef Q_OS_UNIX @@ -1118,6 +1120,7 @@ extern "C" { */ inline word word_madd2(word a, word b, word* c) { +#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) asm( ASM("mull %[b]") ASM("addl %[c],%[a]") @@ -1127,6 +1130,11 @@ inline word word_madd2(word a, word b, word* c) : "0"(a), "1"(b), [c]"g"(*c) : "cc"); return a; +#else + dword z = (dword)a * b + *c; + *c = (word)(z >> BOTAN_MP_WORD_BITS); + return (word)z; +#endif } /* @@ -1134,6 +1142,7 @@ inline word word_madd2(word a, word b, word* c) */ inline word word_madd3(word a, word b, word c, word* d) { +#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) asm( ASM("mull %[b]") @@ -1147,6 +1156,11 @@ inline word word_madd3(word a, word b, word c, word* d) : "0"(a), "1"(b), [c]"g"(c), [d]"g"(*d) : "cc"); return a; +#else + dword z = (dword)a * b + c + *d; + *d = (word)(z >> BOTAN_MP_WORD_BITS); + return (word)z; +#endif } } @@ -2315,7 +2329,7 @@ namespace Botan { extern "C" { -#ifdef Q_OS_UNIX +#if defined(Q_OS_UNIX) && defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) /* * Helper Macros for x86 Assembly */ diff --git a/src/libs/3rdparty/botan/botan.h b/src/libs/3rdparty/botan/botan.h index 6a9cbe0..8afec9e 100644 --- a/src/libs/3rdparty/botan/botan.h +++ b/src/libs/3rdparty/botan/botan.h @@ -81,7 +81,9 @@ #endif #define BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN +#if !defined(__arm__) #define BOTAN_TARGET_CPU_IS_X86_FAMILY +#endif #define BOTAN_TARGET_UNALIGNED_MEMORY_ACCESS_OK 1 #if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN) || \
将该Patch 内容copy 到你的本地文件, 例如我们的文件为qt-issue.patch。
3. 打patch 后重新编译, 顺利通过编译!
相关文章推荐
- 在Ubuntu14.04中安装海思平台上交叉编译的qt4.8.7
- Ubuntu 14.04 LTS + Qt 4.7.3 交叉编译
- ubuntu14.04交叉编译qt4.8.6
- Android系统编译环境搭建—Ubuntu14.04安装&root登录&Chromium root启动&安装配置交叉编译环境
- 搭建虚拟机下ubuntu的qt-arm交叉编译工具
- Ubuntu 14.04 LTS +OPENCV+QT Creator 含泪搭建平台
- ubuntu14.04下安装qt4.8.6 +qt creator
- ubuntu下qt编译显示Cannot connect creator comm socket /tmp/qt_temp.xxx/stub-socket的解决办法
- Ubuntu14.04 安装交叉编译工具链 为所有用户增加路径的配置
- ubuntu下交叉编译QT程序完整流程
- 图解如何将Ubuntu上的Qt程序交叉编译出可在ARM平台运行的程序(五部曲)
- Ubuntu14.04交叉编译BusyBox
- ubuntu14.04交叉编译vlc2.1.5源码,编译出在win32下运行的程序
- 虚拟机中在Ubuntu14.04下搭建QT交叉编译环境--2014/8/14
- 关于ubuntu下qt编译显示Cannot connect creator comm socket /tmp/qt_temp.xxx/stub-socket的解决办法
- ubuntu qt 4.6.3 交叉编译环境搭建
- Ubuntu 14.04 64位 嵌入式交叉编译环境arm-linux-gcc搭建 一次成功
- Ubuntu 14.04 LTS + Qt 5.2.1 源码编译搭建环境
- Ubuntu,TQ2440,arm-linux,Qt交叉编译环境配置
- Qt5.7.1 树莓派3B+ 2016-09-23-raspbian-jessie.img 交叉编译 ubuntu16.04