Install the 64-bit version of glib2 on a 32-bit system for cross-compiling

I am trying to cross-compile a 64-bit executable on a 32-bit ubuntu system. This works until a connection is made where it fails due to the lack of 64-bit glib2 (libglib-2.0.a).

If I did this on a 64-bit system, I would use getlibs to install 32-bit glib2 in / usr / lib 32. However, on a 32-bit machine, getlibs does not seem to work the other way around: install 64-bit glib2 in / usr / lib 64.

My quesiton: how do I manually do what getlibs should do, i.e. install 64-bit glib2 in / usr / lib64?

+3
source share
1 answer

There are several ways around this. The easiest way is to download the toolchain that comes with the target libraries you need. Given that this is not likely to happen, here is one way to solve this problem.

I assume that you are using gcc as your cross-compiler.

  • Copy all the libraries you need from the target system to a folder.
  • In the Makefile (or command line), install CFLAGS (and CXXFLAGS, if C ++), on the following:

    -L / path / to / target / libs -Wl, -rpath-link / same / path / as / first

Note that -Wl and -rpath-link do not have space between them, it should be this way.

-L . -Wl, -rpath-link . , , , nagainst.

0

Source: https://habr.com/ru/post/1739063/


All Articles