[Bug build/23681] New: Program environment variables (AR, LD, AS, ...) are ignored
John.Ericson at Obsidian dot Systems
sourceware-bugzilla@sourceware.org
Tue Sep 18 21:51:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=23681
Bug ID: 23681
Summary: Program environment variables (AR, LD, AS, ...) are
ignored
Product: glibc
Version: 2.27
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: John.Ericson at Obsidian dot Systems
CC: carlos at redhat dot com
Target Milestone: ---
In [aclocal.m4], we have the following:
AS=`$CC -print-prog-name=as`
LD=`$CC -print-prog-name=ld`
AR=`$CC -print-prog-name=ar`
...
This is not idiomatic autoconf usage and causes user-specifications of those
environment variables to be ignored. There is a `--with-binutils` which at
least adds some `-B` flags to $CC so that more directories are searched, but
that doesn't work well in all use-cases. (The programs can be scattered around
various directories, as they are on my distro NixOS.) Why not use the standard
autoconf macros? Or at least take the path of the variables' old value if they
is defined and non-empty?
I did some digging in the history to try to answer those questions, and did not
come up with good answers.
1. In [ff3d7ed36ae26261cc1c76e5f03ee053d65f9229] in 1995, using the idiomatic
AC_CHECK_TOOL.
2. In [650425ceb40e840b2123b6c8cc65389589f41218] in 1997 The first instance
of this was added for AS and LD.
3. In [650425ceb40e840b2123b6c8cc65389589f41218] in 1998 some of the
AC_CHECK_TOOL usages were changed to match the second *without explanation*.
4. ...more programs added matching the status quo, probably just Cargo cults.
Without any explanation it's hard to tell what's going on, but I can't see
there being a problem with things like:
AC_CHECK_TOOL(AR, ar, `$CC -print-prog-name=as`)
That would restore the idiom while preserving behavior when nothing is
specified.
[aclocal.m4]:
https://sourceware.org/git/?p=glibc.git;a=blob;f=aclocal.m4;hb=HEAD#l116
[ff3d7ed36ae26261cc1c76e5f03ee053d65f9229]:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=ff3d7ed36ae26261cc1c76e5f03ee053d65f9229
[650425ceb40e840b2123b6c8cc65389589f41218]:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=650425ceb40e840b2123b6c8cc65389589f41218
[650425ceb40e840b2123b6c8cc65389589f41218]:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6[50425ceb40e840b2123b6c8cc65389589f41218
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list