At least with gcc, specifying -g3 in CFLAGS ends up with macros
expanded including LT_OBJDIR macro. This fooled the testsuite.
* tests/demo.at (Demo hardcode): Filter out the expanded LT_OBJDIR
macro.
Starting with gcc-4.8, there's a -fuse-ld flag that can be used to
select between bfd & gold. Make sure we pass it through to the
linking stage.
* build-aux/ltmain.in (func_mode_link): Pass -fuse-ld=* flags
through.
Copyright-paperwork-exempt: Yes
References:
http://savannah.gnu.org/patch/?8675
Message-Id: <20150523-002056.sv85487.59958@savannah.gnu.org>
* m4/libtool.m4 (_LT_CMD_STRIPLIB): Remove the redundant tests for
empty $old_striplib and $striplib. Move the test for empty $STRIP
variable up. Allow elftoolchain strip (with the same arguments we
used to have with GNU strip) on FreeBSD.
Same fix as applied to libtool in commit 408cfb9c5f
to delay use of automake/autoconf to when the --help option is
actually specified.
* libtoolize.in (func_help): Override func_help() from
gl/build-aux/options-parser to only run automake --version and
autoconf --version when libtool --help is executed on the command
line.
Copyright-paperwork-exempt: Yes
Fixes bug#20196. Reported by Peter Johansson and KO Myung-Hun
* build-aux/edit-readme-alpha: Invert the order of checks
and exit sooner if the file was already edited. Also fix the
typo 's/sed -n/sed/' (to print the rest of the file).
* Makefile.am ($(readme)): Double-quote the `cmd` to let test -n
work correctly.
* NEWS: Remove the leading white-spaces before Copyright line
because it breaks the perl regexp in sc_immutable_NEWS rule.
* cfg.mk (old_NEWS_hash): Adjust to correct previous hash as the
old NEWS entries were not actually touched.
Rico pointed out that the testsuite failed on his system (dash
represented /bin/sh). Turns out that 'shift' in dash exits shell
with exit status 2 when there are no items in the array.
The other issue was that 'test-option-parser.sh' did not
re-executed the test in proper shell, but in /bin/sh.
* gl/tests/test-option-parser-helper (test_parse_eat_test): Don't
shift for empty $@.
* gl/tests/test-option-parser.sh: Use $__GL_ALL_SHELLS_SHELL as
shell which runs the helper.
References:
https://lists.gnu.org/archive/html/libtool/2014-04/msg00026.html
* build-aux/ltmain.in (func_mode_link): Pass -fsanitize=* to the
linker to allow trivial use of the clang address sanitizer.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Copyright-paperwork-exempt: Yes
TLS symbols in AIX display a new, different symbol type in nm output.
Libtool explicitly creates a list of exported symbols for AIX shared
libraries using nm and does not recognize the new TLS symbols, so
those symbols are not exported in AIX shared libraries.
This is a regression for TLS support on AIX where TLS symbols or GCC
"emultls" symbols were listed as global data and exported.
This patch updates libtool.m4 export_symbols_cmds for AIX in two
locations so that global symbols labeled with "L" for TLS are included
in the export list.
* m4/libtool.m4 (export_symbols_cmds) [AIX]: Add global TLS "L" symbols.
Message-Id: <CAGWvnym+hhoQJfkr=cncPZMnnMQ=RVUH2Bpw6+tP2hgEmESAsA@mail.gmail.com>
* gl/build-aux/options-parser (func_parse_options): Put the info
message 'enabling shell trace mode' on stderr.
* gl/modules/options-parser-tests: New test module.
* gl/tests/test-option-parser.sh: New test-case.
* gl/tests/test-option-parser-helper: New test-case helper.
* bootstrap: Sync with option-parser.
Testsuite detected that printf built-in in Bash up to 4.2 was not
able to properly escape tilde.
* gl/build-aux/funclib.sh (func_quote_for_eval): If printf
supports -v option, test also whether we properly escape tilde.
With Bash <= 4.2, call func_quote_portable with ~* strings.
* bootstrap: Sync with funclib.sh.
Multi-line single-quoted shell arguments defined within makefile
rules end up having the trailing backslash. This caused problem
in some sc_* rules as GNU sed does not interpret trailing
backslash the same way as SHELL (== appending next line).
Switching to double quotes means that SHELL will remove the
trailing backslash for subsequent sed call. This silences a lot
of GNU sed warnings seen before like:
sed: -e expression #1, char 96: unterminated address regex
* cfg.mk (sc_libtool_m4_cc_basename): Use $(SED) instead of sed,
use double quotes for sed's multi-line argument.
(sc_prohibit_set_dummy_without_shift): Likewise.
(sc_prohibit_test_const_follows_var): Likewise.
* gl/modules/funclib.sh-tests: New test module.
* gl/modules/all-shells-tests: New test (helper) module.
* gl/tests/test-funclib-quote.sh: New test case.
* gl/tests/test-all-shells.sh: New gl test helper.
* cfg.mk (sc_useless_braces_in_variable_derefs): Whitelist
new test-funclib-quote.sh as the pattern is used there
intentionally.
(sc_space_tab): Likewise.
(sc_useless_braces_in_variable_derefs): Remove /cvsu pattern as
the file is not used with git.
(sc_prohibit_command_in_subst): New checker.
* Makefile.am (SUBDIRS): Add gnulib-tests.
(EXTRA_DIST): Distribute also update-copyright script. This does
not happen automatically because we manually remove ./lib
directory created by gnulib-tool. Not having the file distributed
causes 'make check' failure, however.
(dotversion): Fix to point to $(top_srcdir).
* bootstrap.conf (gnulib_tool_options): Add gnulib-tool args
needed to successfully install gnulib's tests.
* configure.ac (CONFIG_STATUS_DEPENDENCIES): Look for .version in
$(top_srcdir).
* gnulib: Sync with upstream.
* build-aux/.gitignore: Ignore ar-lib coming from automake.
From now we have two basic functions to perform string quoting for
shell evaluation -- 'func_quote_arg' to quote one argument and
'func_quote' which takes list of arguments to be quoted.
New function name-scheme should be more descriptive (previously we
called func_quote_for_eval with one argument and also multiple
arguments, while we had confusing
$func_quote_for_eval_unquoted_result which is redundant for
multiple-arguments call).
New abstraction allowed us (in an easy way) to implement
bash-specific optimization for quoting (using
'printf -v VARNAME %q "$value"', suggested by Eric Blake), this
construct may be used on those places where we don't care much
about the result aesthetics (its thus not useful for '*.la'
generation or for error printing).
* gl/build-aux/funclib.sh (func_append_quoted): Use
func_quote_arg internally (kept in 'pretty' mode for now).
(func_quote): Made to be "main" high-level quoting method taking
list of arguments to be quoted into single command. It replaces
func_quote_for_{expand,eval}.
(func_quote_portable): Implements quoting in shell, falling back
to portable sed call (rare cases).
(func_quotefast_eval): New internal function using fast
bash-specific construct, falling back to func_quote_portable for
non-Bash scripts.
(func_quote_arg): New function to quote one argument.
(func_quote_for_eval): Removed. All callers changed to call
func_quote.
(func_quote_for_expand): Likewise.
* bootstrap: Sync with funclib.sh and options-parser.
Its not necessary to (re)func_quote_for_eval in each function in
the hook hierarchy. Usually it is enough if the leaf function
does func_quote_for_eval and its caller just re-uses the
<CALLEE>_return variable.
This is follow up for the previous commit.
* gl/build-aux/options-parser (func_run_hooks): Propagate
$EXIT_SUCCESS return code down to caller if *any* hook succeeded.
Never re-quote the result -- either the arguments are left
untouched, or the options have already been properly quoted by
succeeding hooks.
(func_parse_options): Quote '$@' and return $EXIT_SUCCESS only if
we changed something.
(func_validate_options): Likewise.
(func_options_prep): Likewise.
(func_options_finish): New hook-caller for 'func_options' hooks.
(func_options): Propagate return value down to top-level caller,
but pay attention we have always set $func_options_result.
* build-aux/ltmain.in (libtool_options_prep): Quote '$@' and
return $EXIT_SUCCESS only if we changed something.
(libtool_parse_options): Likewise.
* bootstrap: Sync gl/build-aux/with option-parser.
With gnulib commit f8fe25fab60e3, AM_PROG_AR is called
automatically from GL_EARLY macro, which brings its definition
into aclocal.m4. Sufficiently new enough AM_PROG_AR uses guarding
AC_BEFORE([AM_PROG_AR], [LT_INIT]) call.
Existence of 'LT_INIT' string inside aclocal.m4 however broke
bootstrap's self-defensive libtool_check_for_bogus_macros
function.
* build-aux/no-bogus-m4-defines: New aux helper using m4 for
aclocal.m4 pre-processing. As this is only bootstrap/dist time
assertion, we don't have to be too much careful (and the AC_BEFORE
pushdef is OK for now).
* boostrap.conf (libtool_check_for_bogus_macros): Use
no-bogus-m4-defines helper to detect bogus macros.
* Makefile.am: Likewise.
* gnulib: Sync with upstream.
* build-aux/git-log-fix: Fix typo.
* gl/build-aux/extract-trace: Fix the script timestamp.
* bootstrap: Sync with extract-trace.
* cfg.mk (sc_prohibit_test_dollar): White-list the
'test ${VAR+y}' construct because that is autoconf-suggested
portable way to check for unset variable.
In some GNU/Linux distributions people started to compile 'ar'
binary with --enable-deterministic-archives (binutils project).
That, however, in combination with our previous long time working
default AR_FLAGS=cru causes warnings on such installations:
ar: `u' modifier ignored since `D' is the default (see `U')
The 'u' option (at least with GNU binutils) did small optimization
during repeated builds because it instructed 'ar' to not
open/close unchanged *.o files and to rather read their contents
from old archive file. However, its removal should not cause a
big performance hit for usual workflows.
Distributions started using --enable-deterministic-archives
knowing that it would disable the 'u', just to rather have a bit
more deterministic builds.
Also, to justify this change a bit more, keeping 'u' in ARFLAGS
could only result in many per-project changes to override
Libtool's ARFLAGS default, just to silent such warnings.
Fixes bug#19967. Reported by Eric Blake.
* m4/libtool.m4 (_LT_PROG_AR): Default AR_FLAGS to 'cr'.
(_LT_REQUIRED_DARWIN_CHECKS): Use $AR_FLAGS instead 'cru' string.
* doc/libtool.texi: Do 's/ar cru/ar cr/' in whole documentation.
* NEWS: Document.
Libtool has used $AR_FLAGS since 2000-05-29 commit
8300de4c54, Automake ARFLAGS since 2003-04-06 commit
a71b3490639831ca. Even though ARFLAGS is younger, it sounds like
better name according GNU Coding Standards.
Related to bug#20082.
* m4/libtool.m4 (_LT_PROG_AR): Copy ARFLAGS value into AR_FLAGS
variable if AR_FLAGS is not set. Add new _LT_DECL'ed variable
'lt_ar_flags' to keep the configure-time value of AR_FLAGS. The
new 'lt_ar_flags' is to be used as the default value for AR_FLAGS
at libtool-runtime.
* NEWS: Document.
Blacklisting of duplicated ChangeLog entries is now much easier
with new gitlog-to-changelog's option --ignore-matching -- so
patching the script is not necessary.
* Makefile.am ($(changelog)): Start ignoring entries having the
'Omit-from-ChangeLog.' "topic" line. Use TZ=UTC to generate the
same ChangeLog regardless of the actual time-zone.
* build-aux/git-log-fix: Put the "blacklist" mark at the beginning
of each commit as that is requirement for --ignore-matching.
* gl/build-aux/gitlog-to-changelog.diff: Removed.
* gnulib: Sync with upstream.
Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
Some projects use this construct in configure.ac:
m4_define([version], m4_include([version]))
pkg_version=version
When the m4_include builtin is undefined (as was done in
libtoolize and extract-trace scripts), the call to this 'version'
macro enters an infinite recursion (until ENOMEM). So rather
re-define all potentially dangerous macros by empty strings,
suggested by Eric Blake.
While we are on it, merge the macro-"blacklist" with similar list
implemented in gettext, except for 'm4_esyscmd'. It's kept
defined because we already trace AC_INIT macro for package
version, while it is often specified by
m4_esyscmd(git-version-gen). Similarly to m4_include, m4_esyscmd
might be opt-in-blacklisted in future.
References:
http://lists.gnu.org/archive/html/libtool/2015-09/msg00000.htmlhttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764580
* gl/build-aux/extract-trace (_G_mini): Redefine trace-breaking
macros to empty strings rather than undefining those. Use 'dnl'
for comments.
* bootstrap: Likewise, sync with extract-trace.
* NEWS: Document.
* NO-THANKS: Mention Hiroyuki Sato.
Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
Target 'bootstrap-deps' sometimes rebuilt $(bootstrap_files)
a bit earlier than the cleanup target 'bootstrap-deps-prep' was
invoked. As a result, some of $(bootstrap_files) were missing.
* Makefile.am (bootstrap-deps): Rebuild $(bootstrap_files) after
bootstrap-deps-prep dependency.
References:
https://bugzilla.redhat.com/show_bug.cgi?id=985592
* build-aux/ltmain.in (func_mode_link): Pass -specs=*
to the linker, Fedora uses this option for hardening.
Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
Regression from 2.4.2 was causing noticable slow-down in builds
that call libtool many times.
* build-aux/ltmain.in (func_help): Override func_help() from
gl/build-aux/options-parser to only run automake --version and
autoconf --version when libtool --help is executed on the command
line.
* NO-THANKS: Add Robert Yang.
Reported by Robert Yang
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Libtool generator code needs to remember the configure time
LT_SYS_LIBRARY_PATH content to allow config.status properly
instantiate default LT_SYS_LIBRARY_PATH libtool run-time value;
Thats because config.status has no idea what the contents of
config.site file is (by default).
* m4/libtool.m4 (_LT_CONFIG): Use the _LT_DECLared
$configure_time_lt_sys_library_path variable as the default for
LT_SYS_DLSEARCH_PATH at run-time.
(_LT_SYS_DYNAMIC_LINKER): Don't change ac_cv_* variable if it is
not necessary. New $configure_time_lt_sys_library_path variable.
* NEWS: Update.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_LIBTOOL_TAG_VARS): Encase the
configure/libtool shared function into parseable borders; for
testing purposes.
(func_munge_path_list): Typo s/$/@S|@/.
* tests/configure-funcs.at: New testcase.
* Makefile.am (TESTSUITE_AT): Mention new testcase.
* NEWS: Update.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* tests/testsuite.at (LT_AT_ACLOCAL): Inject a 1 second sleep
after aclocal to ensure subsequently generated autotools files
will be newer.
* NEWS: Update.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Fixes regression caused by commit 99a808be.
Makefile.in has aclocal.m4 as prerequisite, so Makefile.in
should be installed later to avoid unnecessary rebuild by
(versioned) aclocal.
* Makefile.am (pkgltdl_files): Move the Makefile.in file down in
the list after aclocal.m4.
* tests/libtoolize.at: Adjust to match reordered output.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_PREPARE_CC_BASENAME): Factor cc_basename
calculation into a shell function...
(_LT_CONFIG_SAVE_COMMAND): ...and expand it into generated
libtool script.
(_LT_CC_BASENAME): Adjust accordingly.
(_LT_FUNC_SUNCC_CSTD_ABI): Remove from here...
* build-aux/ltmain.in (func_suncc_cstd_abi): ...and reimplement
here.
* m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Remove postdeps
augmentation from here...
* build-aux/ltmain.in (func_mode_link): ...and reimplement here
just before postdeps are added.
* NEWS: Update.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_FUNC_SUNCC_CSTD_ABI): New function factored out
of repeated code. Take note of other known -Cstd incompatible
compiler flags.
(_LT_SYS_HIDDEN_LIBDEPS): Use it to determine whether -Cstd -Crun
can be safely added to postdeps with Sun Pro CXX.
* NEWS: Update.
* NO-THANKS: Add Marc Glisse.
Reported by Marc Glisse
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_CONFIG_SAVE_COMMANDS): Copy configure-time
LT_SYS_LIBRARY_PATH settings as default, but allow run-time
override.
(_LT_SYS_DYNAMIC_LINKER): Save the unmunged
sys_lib_dlsearch_path_spec value, and use it for _LT_DECL,
but then munge it with LT_SYS_LIBRARY_PATH for use in ltdl.m4
macros, such as LT_SYS_DLSEARCH_PATH.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Revert 8728e07 and 440fee6.
Some GNU/Linux distributions install libraries into /lib64 (or
/usr/lib64) on 64-bit machines, while /lib (/usr/lib
respectively) stays for multilib variant. Other distributions
keep /usr/lib for 64-bit variant and reserve other directory for
multilib. Detection of what approach a given system uses is
difficult, however, especially because Glibc's ldconfig does not
report the full and correct list of search paths. Allow the user
to adjust Libtools heuristically determined search paths with
the new LT_SYS_LIBRARY_PATH environment variable at both
compile-time, when libtool is called, and at configure time.
* m4/libtool.m4 (_LT_PREPARE_MUNGE_PATH_LIST): Define a new
function to munge a libtool path list according to a user
supplied colon-delimited path.
(_LT_SYS_DYNAMIC_LINKER): Require _LT_PREPARE_MUNGE_PATH_LIST.
Mark LT_SYS_LIBRARY_PATH as precious to autoconf (to survive
automatic "autoreconf").
Call the new func_munge_path_list function on
sys_lib_dlsearch_path_spec - this propagates results to
generated libtool script.
(_LT_CONFIG): Expand _LT_PREPARE_MUNGE_PATH_LIST into generated
libtool script.
* build-aux/ltmain.in (func_mode_link): Call it to adjust
sys_lib_dlsearch_path according to LT_SYS_LIBRARY_PATH.
* doc/libtool.texi: Document new LT_SYS_LIBRARY_PATH.
* doc/notes.texi: Likewise.
* NEWS: Update.
References: http://thread.gmane.org/gmane.comp.gnu.libtool.general/8339/focus=8345
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/m4.m4 (AC_PROG_GNU_M4): Reverse some test arguments for
sc_prohibit_test_const_follows_var.
Remove some spurious braces for
sc_useless_braces_in_variable_drefs.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* gl/build-aux/extract-trace (func_find_tool): Quote a bare
variable expansion in a test argument.
* bootstrap: Regenerate.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>