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: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>
- Cc: ssmtpmailtesting ssmtpmailtesting <ssmtpmailtesting at gmail dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 23 Jan 2017 10:12:05 +0000
- Subject: Re: How can I install gcc in different partition?
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdTytktNE2Y0eL4PRJOfqJzx=EXBAJVosLJrRyBnwa7-9A@mail.gmail.com> <1485161748.4163.17.camel@stu.xidian.edu.cn>
On 23 January 2017 at 08:55, Xi Ruoyao wrote:
> 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.
Or just ensure libgmp.so and libmfr.so and libmpc.so are also
installed in the new partition. Or link to them statically, which is
what happens when using the contrib/downloadd_prerequisites script.