Ubuntu 12.04 安装设置gcc4.4
来源:互联网 发布:java程序设计教程赵辉 编辑:程序博客网 时间:2024/06/16 12:26
在Ubuntu 12.04中的默认的GCC版本是4.6。但是这个版本在编译android 4.0源码的时候会出差,下面是安装和设置GCC4.4的方法。
下文来自网络:http://mjanja.co.ke/2012/04/ubuntu-gcc-4-4-considered-harmful/
I’ve been having some problems with Ubuntu 11.10′s default GCC (4.6.2) for some time now. First, I was having problems with self-kang CyanogenMod 9 builds on my Samsung Tab 7 Plus (specifically, adb
wouldn’t work). Second, I couldn’t boot Linux kernel 3.3 on my Sandy Bridge Core i7-2600 build server.
I didn’t know the problems were because of GCC until recently, but now that I’ve switched back to 4.4 both of those problems have gone away; I can only assume that something in Ubuntu’s GCC fork is broken. The solution: set GCC 4.4 as the default compiler.
It’s pretty easy to do this in Debian-based distros using the alternatives
system.
Install GCC 4.4
First, install GCC 4.4 (and friends):
apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib
Set 4.4 to be the default
Then set 4.4 to be higher priority than 4.6:
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50
Verify that it has worked:
gcc -vUsing built-in specs.Target: x86_64-linux-gnuConfigured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.6-11ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnuThread model: posixgcc version 4.4.6 (Ubuntu/Linaro 4.4.6-11ubuntu2)
Done!
- Ubuntu 12.04 安装设置gcc4.4
- Ubuntu 12.04 安装设置gcc4.4
- Ubuntu 12.04 安装设置gcc4.4
- Ubuntu 12.04 & 13.04 安装 GCC4.8.1
- Ubuntu 12.04 & 13.04 安装 GCC4.8.1
- UBUNTU 12.04下编译安装 GCC4.1.2
- Ubuntu 安装GCC4.8
- .ubuntu 10.04 安装 gcc4.6.1
- Ubuntu 13.04 安装 GCC4.8.1
- [转]Ubuntu 12.04 & 13.04 安装 GCC4.8.1
- centos安装编译设置gcc4.8.1
- centos6.4安装gcc4.8.2
- Ubuntu 12.04下编译安装 GCC4.1.2 matlab 低版本gcc
- Ubuntu 12.04版本下安装交叉编译器arm-linux-gcc4.3.2
- Ubuntu环境下如何安装指定版本的Gcc,比如Gcc4.4
- Ubuntu 12.04 GCC4.7启用C++11
- Ubuntu 12.04 升级gcc到gcc4.8
- gcc4.1以及g++4.1的降级安装(ubuntu)
- index < m_IntCount错误
- Fragment详解之二——基本使用方法
- AJAX工作原理及其优缺点
- 动态生成随机验证码
- DM8127如何利用EDMA搬移数据
- Ubuntu 12.04 安装设置gcc4.4
- Android 程序框架设计
- HDU 1004 Let the Balloon Rise
- 由一个成员函数来启动一个线程
- 学习运维的日子
- Fragment详解之三——管理Fragment(1)
- 我最想知道这些东西对我有什么用?
- C++ RTMP直播流播放器
- angularJS最近总结一些零碎的知识点