top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Install gcc from host to image file

0 votes
271 views

I have created one hard disk image file ,which has installed linux kernel on it , and its filesystem also works fine . Now I want to install gcc on it by host's gcc from source .

At earlier time ,I consider to set configure option --prefix to image mounted location on host , like this: --prefix=/mnt/image , but this is found not work at later,due to gcc depend on several files on host .

So I want to get some suggestions from here.

posted Aug 9, 2013 by Amit Parthsarthi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

--prefix should reflect the path of the final install location, /usr for system compilers. To place the final installation, you can use DESTDIR.

answer Aug 9, 2013 by Seema Siddique
Similar Questions
+1 vote

I'm on /dev/sda7. I want to install gcc with C++ support in /dev/sda2.

  1. Is it possible to install gcc in /dev/sda2?
  2. What are the dependencies to install gcc? Or which packages should I install there in /dev/sda2 before installing gcc?
  3. What is cross compiler? How can I install gcc as cross compiler? When do we need to install gcc as cross compiler?
  4. Can someone explain the method of installing cross compiled gcc?
0 votes

I was working in an Embedded processor with GCC-4.6.4 version. I need to add load/store reverse instructions to the MD file. My instructions will look as below:

 LWX Rd,Ra,Rb
 operation: Addr := Ra + Rb
 Rd := *Addr (loading data with the opposite endianness)
 SWX Rd,Ra,Rb
 operation: Addr := Ra + Rb
 *Addr := Rd (storing data with the opposite endianness)

To add the above instructions in to md file I tried below pattern in md file

 (define_insn "movsi_rev"
 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,m")
 (bswap: SI (match_operand:SI 1 "move_src_operand" "m,d")))]
 ""
 "@
 lwxt%0,%1,%0
 swxt%0,%1,%0"
 [(set_attr "type" "load,store")
 (set_attr "mode" "SI")
 (set_attr "length" "4,4")])

I wrote a small testcase which is generating swx instruction but the operands are more due to which it is failing in assembler phase

 ex: instead of swx r0,r2,r0 it is generating swx r0,r2,0,r0

can anyone please help me in removing the extra operand in the above instruction.

+1 vote

I don't really understand this option. I enabled it but it warns for essentially all of my classes which have any virtual methods. For
example if I have Foo.h:

 class Foo {
 virtual bool bar();
 ...
 };

then Foo.cpp which implements Foo. And then in another header somewhere else I inherit from Foo and implement bar() differently (as a virtual function). However when GCC compiles Foo.cpp it can't see the other header, so I guess it assumes no one inherits from Foo and suggests it should be marked final:

Declaring type 'class Foo' final would enable devirtualization of N calls

I mean sure, it would, but that would defeat the entire point (as I understand it).

I don't really understand how/where this option is meant to be used.
Ditto for -Wsuggest-final-methods.

0 votes

I'm studying about C compiler for increasing software quality. So I want to get all of compile error message list of gcc about C language. I was trying to find it. But I can't find it anywhere. How can I find it?

Please help?

...