How to make sure GCC links only with old runtime that is supplied with the system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,
I am kind of new to cross-compiling (if we can call my task like this), so
maybe my question is kind of stupid.

I need to build my project for old runtimes (libstdc++, libgcc_s, etc) that
came with GCC 6, but I can build my sourcecode only with newest C++
features, so I chose GCC 12 for this.
Of course my API is old enough to support GCC 6. And of course I am aware
of potential risks (like some implementations that can be missing in the
old runtime).

Currently I am doing this in a very hacky way, and build my project in a
container that looks like this:
https://gist.github.com/olologin/b4ba2db91fc5c526d625715b39ac4579
As you can see, starting from line 73 it gets hacky because I could not
find a better way to make sure GCC 12 links my code with GCC 6 runtime
instead of GCC 12.
So I decided that I should just get rid of all *.so, *.a and *.o files in
GCC12 install directory, and later when I build my project I point GCC12 on
GCC6 runtime with -Wl,-L.

Is there a better way to do this? Maybe I am missing something.
Thanks in advance.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux