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

Bug#1034453: gcc-snaphot: Bad practice for LD_LIBRARY_PATH (and PATH)



Package: gcc-snapshot

Hi!

Installing the `gcc-snapshot` binary package, there's README.Debian
(in the source package, this is README.snapshot), which (in two
places) shows how to assign LD_LIBRARY_PATH (and PATH) extended values
to allow to use the snapshot compiler.

  These two assignments are unintendedly wrong. While this usually
isn't a problem for PATH (as it is almost always set beforehand), is
actually is an issue for LD_LIBRARY_PATH:

	LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH

With this assignment, the outcome will usually be

	LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:

which has an empty path component at the end. While, in earlier days,
I believed that this would be ignored, it actually expands to the
current(!) directory. (With LD_LIBRARY_PATH exported, I had quite a
fun time tracking down a build problem when cross-building NetBSD
configured for amd64 from a Debian amd64 system. ld.so ended up using
freshly built target components from NetBSD to fulfill host tool's
library dependencies, but that target lib was then missing NetBSD's
libc.) I suggest to change it to:

	LD_LIBRARY_PATH="/usr/lib/gcc-snapshot/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

The same principle applies to PATH, but as previous PATH is typically
non-empty, this won't probably break in obscure ways.

Thanks,
  Jan-Benedict

-- 

Attachment: signature.asc
Description: PGP signature


Reply to: