Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #148080

Re: Cross-compiling with shared libraries

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: Cross-compiling with shared libraries
Date 2019-11-21 07:50 +1300
Message-ID <h3lg7dF3anU1@mid.individual.net> (permalink)
References <e0382139-bef5-447c-9554-b6750f2688be@googlegroups.com> <qr338b$qe3$1@dont-email.me>

Show all headers | View raw


On 20/11/2019 23:07, David Brown wrote:
> On 20/11/2019 10:07, Frederick Gotham wrote:libraries installed on the host. Sometimes this happens without any compiler warning or error!
>>
>> So how are cross-compilers supposed to work? If they are installed properly, do you need to give them the "--sysroot" parameter?
>>
> 
> The answer here is very much "it depends".
> 
> In particular, it depends on the way the gcc was built.  It is common
> for cross-compiler builds of gcc to have their key directories
> (containing include files, libraries, linker files, etc.) configured so
> that you have a single directory tree with the toolchain binaries and
> all related build files held together.  The compiler finds the files
> using relative paths from the gcc binary, so that this directory tree
> can be moved around.  So when I run the "arm-none-eabi-gcc" compiler
> with a C file that has "#include <stdlib.h>", it finds that include file
> by looking in the path "../arm-none-eabi/include/".
> 
> This is particularly common for freestanding gcc builds - the compiler
> used for building the kernel, uboot, libraries, etc.  Freestanding
> implementations are more self-contained, and do not use dynamic
> libraries or deal with other files on the target filesystem.

It's also worth nothing that when gcc is built this way (with baked in 
sysroot), the "--sysroot"  will not work as I found to my cost a while back!

-- 
Ian.

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Cross-compiling with shared libraries Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-11-20 01:07 -0800
  Re: Cross-compiling with shared libraries David Brown <david.brown@hesbynett.no> - 2019-11-20 11:07 +0100
    Re: Cross-compiling with shared libraries Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-11-20 03:23 -0800
      Re: Cross-compiling with shared libraries David Brown <david.brown@hesbynett.no> - 2019-11-20 15:17 +0100
    Re: Cross-compiling with shared libraries Ian Collins <ian-news@hotmail.com> - 2019-11-21 07:50 +1300

csiph-web