Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Host libraries - status
@ 2010-06-24  2:21 Mitch Davis
  2010-06-24  7:38 ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Mitch Davis @ 2010-06-24  2:21 UTC (permalink / raw)
  To: buildroot

Hello,

Yesterday I got bitten by the "mkfontscale" shared library problem
which was discussed in this thread:

  http://lists.busybox.net/pipermail/buildroot/2010-June/035581.html

I also don't think futzing with the rpath is the right solution.  (The
Debian people discuss it here):

  http://wiki.debian.org/RpathIssue

One idea is to have a make var that says how to set the environment
when calling host binaries that we've compiled, something along the
lines of $(HOST_MAKE_ENV).  For each package which calls a host exe
we've compiled, we can overload the calling of that executable with
that var, which would set LD_LIBRARY_PATH just for running that exe.

Here's another idea: We already set PATH to pick up our compiled host
binaries.  And if those binaries expect shared libs in a certain
place, then shouldn't we also set LD_LIBRARY_PATH at the same time as
PATH?  And if not, why not?  Otherwise how are those exes ever
supposed to run?

This would solve the mkfontscale problem, and I don't think this
approach would stop fakeroot from working.  Not sure about the icu
stuff.

Anyway, there may be poor people out there who, like me, are trying to
get 2010.05 working.  I've attached a patch, that while it's not
ideal, it at least Works For Me[tm], and so it may be useful for
others.  One problem with this solution is that people who need more
fonts than me would need to alter more .mk files, whereas setting
LD_LIBRARY_PATH at the same time as PATH wouldn't require this.

Mitch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-mkfontscale-so-locn.diff
Type: application/octet-stream
Size: 3201 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20100624/c473bc2e/attachment-0001.obj>

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [Buildroot] Host libraries - status
@ 2010-06-22 22:45 Yann E. MORIN
  2010-06-23  7:00 ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2010-06-22 22:45 UTC (permalink / raw)
  To: buildroot

Thomas, All,

To sum up our discussion on IRC yesterday.

- we are building libraries to run on the host (the machine we build on)

- those libraries get installed in a non-standard place, so the dynaminc
  linker (ld.so) can not find them

- we do not want our executables to runtime-link with standard libraries
  when we have our own versions

The issue is not at link-time, but at runtime.

Some plans were devised to overcome this issue:

- use LD_LIBRARY_PATH to point the linker to the proper place where to find
  our own libraries. Using LD_LIBRARY_PATH has the advantage that the libs
  are searched for in there before the linker attempts the standard places.
  But LD_LIBRARY_PATH breaks mkfontscale (used to build fonts for X)

- use the linker arg -rpath. rpath adds the search dir directly into the
  executable in an attribute of the .dynamic section. Passing -rpath in
  the CFLAGS breaks binutils. Passing it in the LDFLAGS breaks fakeroot.

We still have some options:

- statically build all host libraries. That would surely fix this issue,
  but could be considered ugly, as *all* dependable libraries would have
  to be specified in the LDFLAGS (Thomas on IRC). Plus the fact that we
  should take care to avoid linking with shared versions of those libs
  if they are present in the standard places (the linker prefers .so
  to .a libs).

- fix fakeroot, so it works with rpath. Might require a huge amount of
  work.

- a third solution would be to craft a simple wrapper for all host
  executables we install. That wrapper would be responsible for exporting
  LD_LIBRARY_PATH. That way, LD_LIBRARY_PATH is set only when running
  those executables, for those executables (and their children), and
  whatever calls them does not have to care about it, nor be mislead.
  For the records, I'va had to do that in crosstool-NG, and it has
  worked pretty nicely. I have a shell script version [1] and also a
  C program [2] that implement such a wrapper.

- anything else I missed ?

Regards,
Yann E. MORIN.

[1] http://ymorin.is-a-geek.org/hg/crosstool-ng/file/eebcaff6626f/scripts/wrapper.in
[2] http://ymorin.is-a-geek.org/hg/crosstool-ng/file/eebcaff6626f/scripts/wrapper.c

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-24 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-24  2:21 [Buildroot] Host libraries - status Mitch Davis
2010-06-24  7:38 ` Thomas Petazzoni
2010-06-24 12:37   ` Mitch Davis
  -- strict thread matches above, loose matches on Subject: below --
2010-06-22 22:45 Yann E. MORIN
2010-06-23  7:00 ` Thomas Petazzoni
2010-06-23  9:20   ` Thomas Petazzoni
2010-06-23 11:18     ` Thomas Petazzoni
2010-06-23 12:48       ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox