0

I've done all my development work for an embedded linux device (gumstix) in a linux VM and I would like to move the code base to my host Linux computer. The cross-compiler was setup prior to me inheriting the codebase, so I'm not sure how the compiler was set up. I have some questions concerning how to set up the cross-compiler.

The compiler on the VM is a arm-linux-gnueabihf-gcc.

  1. Is the cross-compiler kernel specific? (Using linux kernel 3.17)
  2. Is the cross-compiler target device specific; i.e. do I need to use a gumstix compiler or is the arm-linux-gnueabihf-gcc satisfactory. Does this compiler need to be configured manually.
  3. Is there a way to see/import the configuration setting of the working VM compiler?
  4. Does the arm-linux-gnueabihf-gcc use the same standard library source code as the gcc compiler?
  5. I've seen varying approaches to setting up cross-compilers on web. Where can I find comprehensive information for setting up a cross-compiler (More than a how-to, but also explains why).

Thank you

1 Answers1

0

The cross compiler is not kernel specific nor target device specific. It is specific to the architecture of the SoC or processor you are targeting. So if your current compiler is arm-linux-gnueabihf-gcc it implies it can compile code for ARM32 processors which have floating point support in hardware. Depending on your host Linux system, you can install a similar compiler using the package manager or you may also download it from here.

Different people probably will recommend different approaches and also on whether a particular approach is easy or difficult. Regardless I tend to recommend building the complete target image and generating an SDK for doing development using something like Yocto/Openembedded or Buildroot.

Not sure exactly what you mean by Q4.

Sanchayan Maity
  • 637
  • 6
  • 19
  • 1
    Compiler itself is not kernel specific, but libc depends on concrete kernel version. You can use you binary for newer kernel versions, but not always for the old one. Since gcc comes always with precompiled libc, so it is kernel specific, but not so strict how kernel module. – Vladimir Pustovalov Feb 01 '19 at 07:35
  • @VladimirPustovalov ah ok, that's what it meant. Yes, that's correct. – Sanchayan Maity Feb 01 '19 at 09:39
  • Let me put it this way. When I compile code with the arm-linux-gnueabihf-gcc compiler, I cannot compile (find) the standard libraries. Does this mean I need to have an arm-linux-gnueabihf-gcc version of the standard libraries? Do I need to link against those libraries manually with my compiler? If I wanted to use a new library, would I need to download a arm-linux-gnueabihf-gcc version of that library and configure the compiler to that library? – Requires More Overlords Feb 05 '19 at 16:09