Article Title: Ubuntu10.04gccg ++ 4.4 downgrade 4.3 I follow the methods below but get ln: creatinghardlink 'gcc '= & gt;'/usr/bin/gcc-4.3 ': what is Invalidcross-devicelink? Downgrade gcc-4.4 to gcc-4.3-specific action: sudoapt-getinstallgcc-4.3 (installation g
Article Title: Ubuntu10.04 gcc g ++ 4.4 downgrade 4.3
I got ln: creating hard link 'gcc '=>'/usr/bin/gcc-4.3 'according to the following method: Invalid cross-device link what is going on?
Downgrade gcc-4.4 to gcc-4.3-specific action: sudo apt-get install gcc-4.3 (install gcc-4.3) sudo apt-get install g ++-4.3 (install g ++-4.3) sudo apt-get install g ++-4.3-multilib (install g ++-4.3-multilib) after installing version 4.3, run gcc -- version and you will find that the version is still 4.4, because gcc has been linked to version 4.4, you need to re-link the gcc: sudo ln-f/usr/bin/gcc-4.3 gcc sudo ln-f/usr/bin/g ++-4.3g ++ so that gcc and g ++ of version 4.3 can be used overwrite the original one, re-enter the Android source code directory and execute make to compile normally.
[Or you can install the gcc dependency package apt-get install build-essential]
Please help
Article Title: Re: Ubuntu10.04 gcc g ++ 4.4 downgrade 4.3
On my system
Ls-l/usr/bin/gcc
Lrwxrwxrwx 1 root 7 2009-11-10/usr/bin/gcc-> gcc-4.4
/Usr/bin/gcc is/usr/bin/gcc-4.4 soft link, not hard link, currently I commonly use soft link, the usage is ln-s file1 file2, then check the ls-l file2.
Your situation should be
Cd/usr/bin
Sudo ln-SFP cpp-4.3 cpp
Sudo ln-SFP gcc-4.3 gcc
Sudo ln-sf g ++-4.3g ++
Hard link is said to not support connecting files between different partitions (your/home And/in different partitions ?), Soft link support.
Your command sudo ln-f/usr/bin/gcc-4.3 gcc seems to be to make a hard link to the file gcc in the current directory.
In addition, it is recommended that you do not change the gcc version of the default system version. For example, change gcc 4.3.0 to gcc 4.3.2 or gcc 4.4.0 to gcc 4.4.4. Switching from gcc 4.4 to gcc 4.3 is risky.
There is a way to use non-system default version of gcc, that is, compile gcc and install it to the/opt/gcc directory by yourself. It does not take much time, 15 minutes is enough (Intel E2140, 1 gb ram ).
If you are familiar with gcc compilation, skip this section. Before compilation, all the gcc-4.3 packages are unmounted, and the gcc, cpp, g ++ provide soft link to the gcc-4.4 package re-installed again.
Install and compile the gcc dependency packages gmp, mpfr, cloog-ppl, mpc, and libelf. Note that all packages with devel or dev are required.
To http://gcc.cybermirror.org/releases/gcc-4.3.4/
Download source code
Gcc-core * .tar.bz2 is a c compiler.
Gcc-fortran * .tar.bz2 is a fortran compiler.
Gcc-g ++ * .tar.bz2 is a g ++ compiler.
Gcc-objc * .tar.bz2 is the objective c compiler.
Most people use c and c ++.
Mkdir ~ /Build
Download to the build directory under home
Http://gcc.cybermirror.org/releases/gcc-4.3.4/gcc-core-4.3.4.tar.bz2
Http://gcc.cybermirror.org/releases/gcc-4.3.4/gcc-g++-4.3.4.tar.bz2
Cd ~ /Build
Tar jxf gcc-core-4.3.4.tar.bz2
Tar jxf gcc-g00000000-4.3.4.tar.bz2
Cd gcc-4.3.4
Mkdir build
Then
Gcc-v 2> build-config.txt
Open build-config.txt
Start Modification
For example
Code:
Using built-in specs.
Target: i586-SUSE-linux
Configured :.. /configure -- prefix =/usr -- infodir =/usr/share/info -- mandir =/usr/share/man -- libdir =/usr/lib -- libexecdir =/usr/lib -- enable-languages ages = c, c ++, objc, fortran, obj-c ++ -- enable-checking = release -- with-gxx-include-dir =/usr/include/c ++/4.4 -- enable-ssp -- disable-libssp -- -bugurl = http://bugs.opensuse.org/-- with-pkgversion = 'suse Linux '-- disable-libgcj -- disable-libmudflap -- with-slibdir =/lib -- with-system-zlib -- enable -__ cxa_atexit -- enable-libstdcxx-allocator = new -- disable-libstdcxx-pch -- enable-version-specific-runtime-libs -- program-suffix =-4.4 -- enable-linux-futex -- -system-libunwind -- with-arch-32 = i586 -- with-tune = generic -- build = i586-suse-linux
Thread model: posix
Gcc version 4.4.4 (SUSE Linux)
Change
Code Generation:
../Configure \
-- Prefix =/opt/gcc \
-- Enable-languages ages = c, c ++ \
-- Enable-checking = release \
-- Enable-ssp \
-- Disable-libssp \
-- With-bugurl = http://bugs.opensuse.org /\
-- With-pkgversion = 'suse Linux '\
-- Disable-libgcj -- disable-libmudflap \
-- With-system-zlib \
-- Enable-_ cxa_atexit \
-- Enable-libstdcxx-allocator = new \
-- Disable-libstdcxx-pch \
-- Enable-version-specific-runtime-libs \
-- Program-suffix =-4.4 \
-- Enable-linux-futex \
-- Without-system-libunwind \
-- With-arch-32 = i586 \
-- With-tune = generic \
-- Build = i586-suse-linux \
-- Disable-bootstrap
That is to say, do not start or end with the/usr or the/lib directory, and do not use the -- program-suffix line, branch, or -- disable-bootstrap line. My section
Code:
../Configure
...
For reference only, you need to modify build-config.txt of your website.
Now in ~ /Build/gcc-4.3.4/build directory
Copy and run the modified build-config.txt content.
Code:
../Configure \
-- Prefix =/opt/gcc \
-- Enable-languages ages = c, c ++ \
-- Enable-checking = release \
-- Enable-ssp \
-- Disable-libssp \
-- With-bugurl = http://bugs.opensuse.org /\
-- With-pkgversion = 'suse Linux '\
-- Disable-libgcj -- disable-libmudflap \
-- With-system-zlib \
-- Enable-_ cxa_atexit \
-- Enable-libstdcxx-allocator = new \
-- Disable-libstdcxx-pch \
-- Enable-version-specific-runtime-libs \
-- Enable-linux-futex \
-- Without-system-libunwind \
-- With-arch-32 = i586 \
-- With-tune = generic \
-- Build = i586-suse-linux \
-- Disable-bootstrap
Then
Make-jN. Fill in the number of cpu cores N.
Last
Sudo make install
Optional steps
Cd/opt/gcc/libexec/gcc /*/*
Sudo strip-sv PC3 *
Finally write a script gcc43-env.sh ~ /Bin directory with the following content
Code:
#! /Bin/sh
Export PATH =/opt/gcc/bin: $ PATH
You only need to use gcc-4.3
Source gcc43-env.sh
That's all.