Commit Graph

4315 Commits

Author SHA1 Message Date
Ileana Dumitrescu
7f254d9682
libtool: Documentation refers to demo directory that no longer exists
The libtool documentation included mention of an old test framework.
The documentation has been reworked to indicate the current test
framework used by libtool, where the tests/*demo directories have been
replaced with tests/*demo.at Autotest files.

* doc/libtool.texi: Clarifies where the example files originate.
* TODO: Remove TODO item related to tests/*demo directories.
2024-03-06 22:03:17 +02:00
Ozkan Sezer
3afd415a90
ltmain.in: correct windows compiler preprocessor checks
Commit f54924fa5d seems to have been
wrongly applied.
2024-03-01 19:51:32 +02:00
Ileana Dumitrescu
f54924fa5d
ltmain.in: Expand process.h inclusion on Windows
Multiple compilers on Windows besides the proprietary MSVC compiler
require process.h, and not unistd.h. The inclusion check is expanded
to include these alternative compilers which also require process.h.

* ltmain.in: Replace _MSV_VER with WIN32 and !__GNU_C check
2024-02-29 16:25:35 +02:00
Ileana Dumitrescu
fb617e2ba0
libtool.m4: Check for space after -l flag
The -R and -L flags are currently checked if they have a space behind
them. -l should be added to the list of cases checked.

* m4/libtool.m4: Check for a space after the -l flag.
2024-02-17 18:40:46 +02:00
Mike Frysinger
57dae03b04 m4: update serial numbers in modified files
These should have been included in the commits that updated these
files, but too late now to rewrite git history.

* m4/libtool.m4: Update serial number.
* m4/ltdl.m4, m4/ltoptions.m4: Likewise.
2024-02-01 00:02:23 -05:00
Tijl Coosemans
e11fcf3b38 tests: Also check amd64 where we test for x86_64
It is used on FreeBSD.

* tests/demo.at: Also test for amd64 where we test for x86_64.
2024-01-22 20:09:04 -05:00
Mike Frysinger
8d188608ca libtoolize: always copy config-h.in like aclocal.m4
When running `libtoolize --ltdl`, a symlink to the source config-h.in
is used rather than a copy of the file.  This causes the build system
to look at its old timestamp relative to the other generated files
that are copied in, and then try to regenerate things, and update the
config-h.in timestamp by touching the symlink (which will dereference
things).  This breaks `make distcheck` because when a few tests run
that invoke `libtoolize --ltdl --install` w/out --copy, and then try
to build the project, automake's rules trigger autoheader regen, and
then update the timestamp, which updates the underlying file, and then
causes libtool's own files to get out of sync.  So the next time make
is run in the tree, it tries to regenerate the source files, and fails
as the source tree is read-only.

Change libtoolize to always copying the header over during install.
It's not clear to me whether this is 100% the right answer, but it
shouldn't make things worse beyond missing a case to use a symlink.
We probably can't avoid this as long as aclocal.m4 itself is copied
in instead of symlinked.  This changed between v2.4.2 and v2.4.3 in
commit 4e671d6ba6 ("libtoolize:
simplify file-copying and -linking call-graph.").

Example failure log:

$ make distcheck
...
make[3]: Entering directory '.../libtool-2.4.7.62-3e11/_build/sub'
  GEN      ../../libltdl/Makefile.in
  GEN      ../../libltdl/configure
autom4te-2.72: error: cannot create autom4te.cache in .../libtool-2.4.7.62-3e11/libltdl: Permission denied
make[3]: *** [Makefile:2411: ../../libltdl/configure] Error 1
make[3]: *** Waiting for unfinished jobs....
autom4te-2.72: error: cannot create autom4te.cache in .../libtool-2.4.7.62-3e11/libltdl: Permission denied
automake-1.16: error: autoconf failed with exit status: 1
make[3]: *** [Makefile:2387: ../../libltdl/Makefile.in] Error 1

We can see this in old-m4-iface.at:AC_WITH_LTDL which doesn't use
--copy with libtoolize:

$ stat libltdl/config-h.in | grep Modify
Modify: 2024-01-18 01:18:52.998059970 -0500
$ make check-local TESTSUITEFLAGS=100
...
100: AC_WITH_LTDL                                    ok
...
$ stat libltdl/config-h.in | grep Modify
Modify: 2024-01-18 01:19:19.254727020 -0500

And in the test log we can see:

100. old-m4-iface.at:113: testing AC_WITH_LTDL ...
...
libtoolize: linking file 'libltdl/config-h.in'
...
./old-m4-iface.at:161: : ${CONFIG_SHELL=/bin/sh}; export CONFIG_SHELL;    $CONFIG_SHELL ./configure $configure_options           --prefix="$prefix" --exec-prefix="$prefix" --bindir="$prefix/bin" --libdir="$prefix/lib" --with-included-ltdl
...
./old-m4-iface.at:161: $as_unset LIBTOOL; $as_unset LIBTOOLIZE; $MAKE $target
stderr:
stdout:
cd libltdl && make
make[1]: Entering directory '/usr/local/src/gnu/libtool/tests/testsuite.dir/100/libltdl'
CDPATH="${ZSH_VERSION+.}:" && cd . && aclocal -I m4
 cd . && automake --foreign
CDPATH="${ZSH_VERSION+.}:" && cd . && autoconf
/bin/sh ./config.status --recheck
...
(CDPATH="${ZSH_VERSION+.}:" && cd . && autoheader)
rm -f stamp-h1
touch config-h.in
...

* libtoolize.in: Copy config-h.in.
* tests/libtoolize.at: Change "linking" to "copying".
2024-01-22 08:09:47 -05:00
Mike Frysinger
10a04bafef
Fix some style & minor grammar.
* doc/libtool.texi: Fix some style & minor grammar.
2024-01-21 17:38:13 +02:00
Ileana Dumitrescu
7e4b026690
* doc/libtool.texi: Minor grammatical fixes. 2024-01-21 17:25:54 +02:00
Mike Frysinger
e602d877f6 bootstrap: don't reset config-h.in timestamp newer than configure
Various autotools rules will compare the timestamps of config-h.in
and configure, and if config-h.in is newer than configure, attempt
to regenerate it.  This breaks `make distcheck` which we need to
produce new releases.  So update config-h.in timestamp, but only
up to the configure file.

The breakage is caught because distcheck makes source dirs read-only
before running.

$ make distcheck
...
make[3]: Entering directory '.../libtool-2.4.7.62-7132f/_build/sub'
  GEN      ../../libltdl/configure
autom4te-2.72: error: cannot create autom4te.cache in .../libtool-2.4.7.62-7132f/libltdl: Permission denied
make[3]: *** [Makefile:2411: ../../libltdl/configure] Error 1

* bootstrap.conf (libtool_fudge_timestamps): Set config-h.in timestamp
to configure.
2024-01-18 01:38:08 -05:00
Mike Frysinger
23eacf882e HACKING: add more test related tips
* HACKING: Document syntax-check & distcheck & parallel testing.
2024-01-18 01:38:08 -05:00
Richard Purdie
725646bf09 ltmain.in: Parse additional clang options
clang uses -rtlib and -unwindlib to select proper compiler runtime in
some cases.  Therefore pass these options to linker when found in
ldflags.

* build-aux/ltmain.in: Handle clang linker options.
2024-01-17 17:05:12 -05:00
Richard Purdie
365805327c libtool.m4: Cleanup sysroot trailing "/"
If $CC has --sysroot=/, it is a valid configuration however libtool will
then set lt_sysroot to "/".

This means references like $lt_sysroot$libdir become //usr/lib instead
of the more normally expected /usr/lib. This may or may not break something
but certainly is confusing to the user and gives confusing output. Making
"/" simply unset lt_sysroot is much cleaner.

Whilst here, trim any trailing '/' from sysroot paths to drop the duplication
and result in cleaner/consistent output.

* m4/libtool.m4: Cleanup sysroot trailing '/' handling.
2024-01-17 17:01:45 -05:00
Richard Purdie
cdf4bf702f ltmain.in: Handle prefix-map compiler options correctly
If lto is enabled, we need the prefix-map variables to be passed to the
linker to correctly link the objects using correctly mapped paths.

Add these to the list of options libtool passes through.

* build-aux/ltmain.in: Handle prefix-map compiler options.
2024-01-17 14:49:08 -05:00
Tim Rice
31d9133b4c ltmain: correct fallout from freebsd-elf changes
Here is a small patch to correct builds on svr5.
When the freebsd-elf target was changed, this got missed.

Symptoms were, building newer lib ended up with libfoo.nn a lower number
than the previous version.  And building libpng-1.6.29 produced:
libtool:   error: CURRENT '' must be a nonnegative integer
libtool:   error: '16:29:0' is not valid version information

* build-aux/ltmain.in (func_mode_link): Add sco.
2024-01-17 14:45:30 -05:00
Ozkan Sezer
97859bda6a
libtool: add mingw to systems not requiring libm
mingw uses msvcrt as it's standard library and does not use libm.
So in LT_LIB_M it can be added to the list of systems which do not
require libm.

* libtool.m4: Add mingw to the list of systems not requiring libm
2024-01-17 20:34:58 +02:00
Paul Green
e60044908e libtool.m4: fix old_archive_from_new_cmds variable name typo
The "From" should be "from" in the variable name.

Fixes libtool bug https://bugs.gnu.org/38305

* m4/libtool.m4: Change F to f in old_archive_from_new_cmds.
2024-01-17 02:45:49 -05:00
Mike Frysinger
9665e2f25e libtool.m4: drop AC_PROG_SED fallback
We require autoconf 2.62 which includes this macro so we don't need
this fallback logic anymore.

* m4/libtool.m4 (AC_PROG_SED): Delete.
2024-01-17 02:31:22 -05:00
Albert Chu
bfcbcc2dce libtool.m4: fix "manifest" typos
* m4/libtool.m4: Rename lt_cv_path_mainfest_tool to lt_cv_path_manifest_tool.

Signed-off-by: Albert Chu <chu11@llnl.gov>
2024-01-17 01:52:43 -05:00
Oliver Kiddle
b67d1a2db8 libtool: fix Solaris 11 builds
Trying to build clamav on Solaris 11.3 with the Oracle C compiler,
I got the following error:

libtool: error: not configured to extract global symbols from dlpreopened files

I would have expected a build to use dlopen rather than the preopen
fallback so looked for related configure tests that were perhaps
returning the wrong answer.

The global_symbol_pipe being empty seemed a likely culprit.
the last three lines of nm -p on the conftest.o in this test are:

0000000032 T main
0000000016 T nm_test_func
0000000001 C nm_test_var

On Solaris 10, I'd get a D instead of a C. Adding C to the list of
characters in the symcode variable and building again resulted in a
successful build. I've attached a patch to add this C.

Url: https://savannah.gnu.org/patch/?9086

* m4/libtool.m4 (symcode): Add C for solaris.
2024-01-17 01:32:06 -05:00
Mike Frysinger
3ebfdce755 HACKING: minor formatting tweaks
* HACKING: Tweak style.
2024-01-16 23:42:04 -05:00
Brad Smith
1ae386ba78 libtool: remove OpenBSD specific performance hack for ranlib
The -t flag was used as a performance hack for ranlib. The flag was
supported by the GNU toolchain, but is a no-op with the LLVM toolchain.

* m4/libtool.m4: Remove use of -t flag with ranlib.
2024-01-16 20:52:26 -05:00
Richard Purdie
49e6cb0d4d libtool: Fix support for NIOS2 processor
When building for a nios2 system, the $host tuple starts with "nios2-"
which is caught by the some of the greedy checks for OS/2 in libtool.
In particular, the *os2* branches of switch statements that only want
to match the OS setting end up matching all nios2 targets, which
results in incorrect behavior.

Switch to use $host_os instead of $host and tweak the patterns to
match to avoid this problem for nios2.

* build-aux/ltmain.in: Switch some $host checks to $host_os.
2024-01-16 20:48:27 -05:00
Mike Frysinger
51ac68a24e bootstrap: sync to latest version
* gl-mod/bootstrap: Update.
* bootstrap: Likewise.
2024-01-16 20:01:41 -05:00
Mike Frysinger
306c759bed bootstrap: revert typo fixes
This is maintained elsewhere, so we don't want to fork it locally.

* bootstrap: Restore upstream typos.
2024-01-16 20:01:00 -05:00
Antonin Décimo
fd8ab0cbd3 Fix various typos
* NEWS: Fix various typos.
* NO-THANKS, README.md, TODO, bootstrap, bootstrap.conf,
build-aux/edit-readme-alpha, build-aux/git-log-fix, build-aux/ltmain.in,
doc/libtool.texi, libltdl/libltdl/lt_error.h, libltdl/lt__argz.c,
libltdl/ltdl.c, libtoolize.in, tests/depdemo.at, tests/link-order.at: Likewise.
* cfg.mk (old_NEWS_hash): Update.

Copyright-paperwork-exempt: Yes
2024-01-16 17:54:26 -05:00
Mike Frysinger
8c3678bb28 cfg.mk: update old NEWS hash
The recent change to change http:// to https:// updated old NEWS
entries.  This isn't exactly against the spirit of the "don't
change old NEWS", so update the hash to match.

* cfg.mk (old_NEWS_hash): Update.
2024-01-16 17:50:44 -05:00
Antonin Décimo
8fa76f168e ChangeLog.old: Convert ISO-8859-1 to UTF-8
This file is mostly UTF-8 already, but some old entries were using
ISO-8859-1.  Change them to UTF-8 entirely.

* ChangeLog.old: Change ISO-8859-1 to UTF-8.

Copyright-paperwork-exempt: Yes
2024-01-16 17:46:15 -05:00
Mike Frysinger
003520d346 use https:// with more gnu.org sites
* NEWS: Change http:// to https:// for some URIs.
* bootstrap.conf, build-aux/ltmain.in, configure.ac, libtoolize.in: Likewise.
2024-01-16 15:46:12 -05:00
Raul E Rangel
f81f36e4e9 libtool: Use $LD when checking for --whole-archive
Using `$CC -print-prog-name=ld` will always use the `ld` linker. We
should instead be using the $LD variable so that we use the proper
linker.

There is already another part of the code that does this same check,
so I just copy/pasted the if line.

* m4/libtool.m4: Change `$CC -print-prog-name=ld` to $LD.

Url: https://savannah.gnu.org/support/?110978
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
2024-01-16 15:28:57 -05:00
Brad Smith
5a7193dbfb libtool: remove bitrig support.
Bitrig has been defunct for 7 years.

* build-aux/ltmain.in (func_mode_link): Remove bitrig support.
* m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE, LT_CMD_MAX_LEN)
(_LT_SYS_DYNAMIC_LINKER, _LT_CHECK_MAGIC_METHOD)
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Ditto.
* m4/ltdl.m4 (LT_SYS_DLOPEN_DEPLIBS): Ditto.
* NEWS: Updated.
2024-01-16 15:11:38 -05:00
Olly Betts
81e8abf3dd
libtool: use -Fe with MSVC to specify filename
This avoids a deprecation warning with current versions of MSVC, by
replacing the -o flag with -Fe. -Fe is documented as supported at
least as far back as Visual C 6.0 which was released in 1998.

* m4/libtool.m4: Use -Fe instead of -o to specify DLL output filename
for MSVC.

Signed-off-by: Olly Betts <olly@survex.com>
2024-01-16 20:43:00 +02:00
Xiang.Lin
4da5b57531
libtool: fix empty "-L" in compiler_lib_search_path
If the compiler places a space between "-L" and the path, the path will
be skipped and only an empty "-L" will appear in the final
compiler_lib_search_path. This will cause the first library in postdeps
following compiler_lib_search_path to be accidentally skipped.

* libtool.m4: Fixed string comparison by adding missing 'x's.
2024-01-16 19:47:20 +02:00
Bruno Haible
47c71f61df
Fix shared library support on Android.
This patch fixes two problems:
1) A libtool library created with the -release option and no -version-info
   option was, when built with --enable-shared, installed without the
   symlink libNAME.so -> libNAME-RELEASE.so. This led to subsequent failures
   during "make install" of shared libraries that depend on it.
2) Executables were created without a RUNPATH property. These executables
   then did not find their shared libraries when run.

* m4/libtool.m4: On Android, fix library_names_spec and
hardcode_libdir_flag_spec.
2024-01-15 22:58:56 +02:00
Mike Frysinger
544675d6b5 gnulib: update submodule to current versions
* gl/build-aux/do-release-commit-and-tag.diff: Rebase.
* gnulib: Update submodule.
2024-01-14 23:10:53 -05:00
Mike Frysinger
55e703a96b maint: disable syntax checks on local gnulib patches
The syntax checks might trip over problems in the gnulib code itself
when scanning the local patches.  Since it's unlikely these checks
will find anything useful, just disable them for the gl/ patches.

* cfg.mk (VC_LIST_ALWAYS_EXCLUDE_REGEX): Ignore ^gl/.
2024-01-14 23:09:49 -05:00
Mike Frysinger
3c19bfd4fb maint: tweak update-release-year for syntax checks
`make syntax-check` complains about redundant variable braces.

* cfg.mk (update-release-year): Delete $${year} braces.
2024-01-14 23:09:49 -05:00
Mike Frysinger
f03b64dc62 maint: disable GNU indent checks for now
GNU indent will reformat a bunch of files in a way that's broken or
incorrect, so disable the check until we can find a way to workaround
this.  Unfortunately, the indent check is enforced at `make distcheck`
time if GNU indent is installed, so it can't simply be ignored.

* cfg.mk (local-checks-to-skip): Add sc_indent.
2024-01-14 22:36:07 -05:00
Mike Frysinger
1879a0e6db libltdl: delete use of ^L
GNU indent does not process this well, and nothing else in the tree
uses this convention, so drop it.

(GNU indent is enforced by gnulib when running `make distcheck`.)

* libltdl/ltdl.c: Delete ^L.
* libltdl/ltdl.h: Likewise.
2024-01-14 21:48:38 -05:00
Mike Frysinger
a38b178625 generalize genders
* HACKING: Change "his" to "their".
* tests/old-m4-iface.at: Change "she" to "they".
2024-01-14 21:35:02 -05:00
Sam James
b80646b7b8 .gitmodules: use HTTPS for cloning gnulib
* .gitmodules: Use https://.
2024-01-14 17:42:55 -05:00
Richard Purdie
bd826173c4 libtool.m4: For reproducibility stop encoding hostname in libtool script
For reproducibility, stop encoding the hostname into the libtool script,
this isn't really adding much to debugging and most distros are carrying
such a patch now as reproducibility is important.

* m4/libtool.m4: Delete call to hostname & uname.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-14 02:11:35 -05:00
Gilles Gouaillardet
33d4b69fcc libtool: Add support for flang (Fortran LLVM-based) compilers
This patch adds support for flang compilers.  Some specific flags
are needed so these compilers must be handled in a specific way.
By default, the compiler is called 'flang', but ARM releases their
own flang-based compiler called 'armflang'.

Because of the current lack of flang support in libtool, the
generated 'libtool' must be manually modified after 'configure' is
invoked.  Such a process is for example described on ARM web site
(it involves the Open MPI library).

Url: https://savannah.gnu.org/patch/?9442

* m4/libtool.m4: Handle *flang.
2024-01-14 02:07:38 -05:00
Sam James
533d816dea ltmain.in: Pass through -fdiagnostics-color, -frecord-gcc-switches
* -fdiagnostics-color: who doesn't like color? No reason to strip it. This
  makes the link phase stick out like a sore thumb if there's warnings emitted.

* -frecord-gcc-switches: we use it in Gentoo to check if a package respects
  *FLAGS. Note that we do not need to include -grecord-gcc-switches explicitly
  here as -g* is already whitelisted.

* build-aux/ltmain.in: Handle -fdiagnostics-color* & -frecord-gcc-switches.
2024-01-14 01:51:06 -05:00
Mingli Yu
e01c0bfe5e build: make sure autoheader run before automake
When use automake to generate Makefile.in from Makefile.am, there
comes below race:
 | configure.ac:45: error: required file 'config-h.in' not found

It is because the file config-h.in in updating process by autoheader,
so make automake run after autoheader to avoid the above race.

* Makefile.am: Have $(lt_Makefile_in) depend on $(lt_config_h_in).

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
2024-01-14 01:24:15 -05:00
Mingli Yu
e7dc729dd2 build: make sure autoheader run before autoconf
autoheader will update ../libtool-2.4.6/libltdl/config-h.in which
autoconf needs, so there comes a race sometimes as below:
 | configure.ac:45: error: required file 'config-h.in' not found
 | touch '../libtool-2.4.6/libltdl/config-h.in'

So make sure autoheader run before autoconf to avoid this race.

* Makefile.am: Have $(lt_configure) depend on $(lt_config_h_in).

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
2024-01-14 01:23:38 -05:00
Jonathan Wakely
efbb2e77df docs: Use @file for .libs directory
* doc/libtool.texi: Use @file format for directory name.
2024-01-14 01:21:12 -05:00
Jonathan Wakely
26bbdd6fbe docs: Fix typo in 'Linking Libraries' section
* doc/libtool.texi: Fix typo.
2024-01-14 01:20:44 -05:00
Manoj Gupta
8878355f1d libtool: Support "-fno-sanitize*" options.
"-fno-sanitize*" options e.g. -fno-sanitize=alignment
or -fno-sanitize-recover=all are used to tune the behvior of
sanitizers in GCC/clang. Let libtool pass these options
to compiler similar to fsanitize=*.

* build-aux/ltmain.in: Handle -fno-sanitize*.

Signed-off-by: Manoj Gupta <manojgupta@google.com>
2024-01-14 01:14:29 -05:00
Mike Frysinger
22406ebb83 maint: extend release version hook to cover config.lt
* cfg.mk: Extend rule to cover config.lt.
* m4/libtool.m4: Update copyright year.
2024-01-14 01:10:32 -05:00