This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How can I install gcc in different partition?
- From: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>, ssmtpmailtesting ssmtpmailtesting <ssmtpmailtesting at gmail dot com>
- Cc: ryxi at stu dot xidian dot edu dot cn, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 23 Jan 2017 16:55:48 +0800
- Subject: Re: How can I install gcc in different partition?
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdTytktNE2Y0eL4PRJOfqJzx=EXBAJVosLJrRyBnwa7-9A@mail.gmail.com>
On 10 January 2017 at 09:00, Jonathan Wakely wrote:
> On 10 January 2017 at 02:39, ssmtpmailtesting ssmtpmailtesting wrote:
> > The current linux os I'm using is in /dev/sda7, mounted as /(root).
> > I've mounted /dev/sda2 in /media/sda2. Now trying to install gcc in
> > /media/sda2/usr/bin.
>
> Then build GCC with --prefix=/media/sda2/usr
I don't think that's enough. This would generate GCC executables
polluted
by things in current system. For example,
/media/sda2/usr/libexec/gcc/{version}/cc1
may link to
(in sda7) /usr/lib/libgmp.so
But actually there may be no /media/sda2/usr/lib/libgmp.so. So when you
try to invoke GCC in /dev/sda2, you'll receive
error while loading shared libraries: libgmp.so: cannot open shared
object file: No such file or directory
That's bad. I suggest to chroot into /media/sda2.
--
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University