Commit Graph

183 Commits

Author SHA1 Message Date
Ileana Dumitrescu
4ba29e983c
libtool: Add option to reorder the shared library cache
Add option to reorder the shared library cache in OpenBSD so that user
preferred directories for shared libraries can be used when linking
before directories previously listed in the shared library cache.

This allows for users in OpenBSD to easily switch between versions of
libraries with the same name during testing.

* NEWS: Update for new (OpenBSD) option.
* build-aux/ltmain.in: Add option --reorder-cache=DIRS.
* doc/libtool.texi: Update documentation for new option.
* test/bug_71489.at: Alter test for OpenBSD to utilize new option.
2024-11-20 17:36:21 +02:00
Ileana Dumitrescu
1bda2465d7
libtool: Fix local testing of shared libraries on OpenBSD
On OpenBSD 7.5, the shared library cache is updated with finish_cmds,
which causes the test for 'Use local version' to fail. Simply, installed
versions of shared libraries take precedence over those locally built.

To ensure local versions of shared libraries can be tested properly and
more easily, additional options have been added to libtool to skip
executing finish_cmds, like 'ldconfig -m $libdir' in OpenBSD.

* build-aux/ltmain.in: Add libtool option, '--no-finish.
* doc/libtool.texi: Document new option in libtool.
* NEWS: Update.
2024-11-20 17:03:12 +02:00
Martin Storsjö
eed74d650a
libtool: Prefer response files over linker scripts for mingw tools
The GCC/binutils tools support response files just fine, while
lld (impersonating GNU ld) only supports response files, not
linker scripts. Using a linker script as input just to pass a
list of files is overkill for cases when a response file is enough.

* build-aux/ltmain.in: Move creation of ld script.
* m4/libtool.m4: Add new variable tag for file_list_spec.
* NEWS: Update.
2024-11-20 16:42:15 +02:00
Richard Purdie
65026af3bc
ltmain.in: Handle trailing slashes on install commands
A command like:

libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la
'/image/usr/lib/gnome-keyring/standalone/'

where the path ends with a trailing slash currently fails. This occurs in
software like gnome-keyring or pulseaudio and is because the comparision
code doesn't see the paths as equal. Strip both paths to ensure this works
reliably.

* build-aux/ltmain.in: Strip trailing slashes on install commands.
* NEWS: Update.
2024-11-20 16:41:17 +02:00
Alastair McKinstry
43c5983836
ltmain.in: Add error message for unknown version type 2024-10-22 20:02:17 +03:00
Alastair McKinstry
4e6ccefb94
libtool: Change how version is derived
Avoid duplication of '(GNU @PACKAGE@) @VERSION@' in multiple
places by using '$scriptversion'.

* libtoolize.in, build-aux/ltmain.in: Change version from
  '(GNU @PACKAGE@) @VERSION@' to '$scriptversion'.
2024-10-22 20:02:17 +03:00
Ileana Dumitrescu
3226abb870
Update documentation and version output
* libtoolize.in: Overwrite function in bootstrap for printing version
  information for libtoolize.
* build-aux/ltmain.in: Overwrite function in bootstrap for printing
  version information for libtool.
* doc/libtool.texi: Fix typo and correct references for tests/demo
  subdirectory to the tests/demo.at Autotest file.
* gl/top/README-release.diff: Add documentation for maintainers so
  the CVS repository is properly updated following a stable release.
2024-10-22 20:00:47 +03:00
Sergey Poznyakoff
b6c8850a43
Don't omit directories from the constructed rpath.
This fixes bug introduced by 0e1b333324.

* build-aux/ltmain.in: Don't omit paths that are not under $progdir
from the compiled_rpath.  Append them to the end of it.
* NEWS: Update for bug fix.
2024-10-22 20:00:02 +03:00
Ileana Dumitrescu
182c7b3e25
Add 'aarch64' support to the file magic test
The file magic test fails to determine the file type of libraries when
cross-compiling with an aarch64 compiler without additional strings to
search for in an objdump.

* build-aux/ltmain.in: Append 'pe-aarch64' to file_magic in the
lt_cv_deplibs_check_method.
* m4/libtool.m4: Append 'pe-aarch64' to file format check.
2024-09-18 17:15:27 +03:00
Ileana Dumitrescu
ec703fac9e
libtool: FSF office address replaced by URL
* AUTHORS, HACKING, Makefile.am, bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/no-bogus-m4-defines, cfg.mk, configure.ac, libltdl/configure.ac,
libltdl/libltdl/lt__alloc.h, libltdl/libltdl/lt__argz_.h,
libltdl/libltdl/lt__dirent.h, libltdl/libltdl/lt__glibc.h,
libltdl/libltdl/lt__private.h, libltdl/libltdl/lt__strl.h,
libltdl/libltdl/lt_dlloader.h, libltdl/libltdl/lt_error.h,
libltdl/libltdl/lt_system.h, libltdl/libltdl/slist.h,
libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c, libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c, libltdl/lt__alloc.c, libltdl/lt__argz.c,
libltdl/lt__dirent.c, libltdl/lt__strl.c, libltdl/lt_dlloader.c,
libltdl/lt_error.c, libltdl/ltdl.c, libltdl/ltdl.h, libltdl/ltdl.mk,
libltdl/slist.c, tests/am-subdir.at, tests/archive-in-archive.at,
tests/bindir.at, tests/bug_62343.at, tests/cdemo.at, tests/cmdline_wrap.at,
tests/configure-funcs.at, tests/configure-iface.at, tests/convenience.at,
tests/ctor.at, tests/cwrapper.at, tests/darwin.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at, tests/deplibs-ident.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/dlloader-api.at,
tests/dumpbin-symbols.at, tests/duplicate_conv.at, tests/duplicate_deps.at,
tests/duplicate_members.at, tests/early-libtool.at, tests/exceptions.at,
tests/execute-mode.at, tests/exeext.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fail.at, tests/fcdemo.at,
tests/flags.at, tests/help.at, tests/indirect_deps.at, tests/infer-tag.at,
tests/inherited_flags.at, tests/install.at, tests/lalib-syntax.at,
tests/libtool.at, tests/libtoolize.at, tests/link-order.at,
tests/link-order2.at, tests/loadlibrary.at, tests/localization.at,
tests/lt_dladvise.at, tests/lt_dlexit.at, tests/lt_dlopen.at,
tests/lt_dlopen_a.at, tests/lt_dlopenext.at, tests/ltdl-api.at,
tests/ltdl-libdir.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/no-executables.at, tests/nocase.at, tests/nonrecursive.at,
tests/old-m4-iface.at, tests/pic_flag.at, tests/recursive.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/shlibpath.at, tests/slist.at, tests/standalone.at, tests/static.at,
tests/stresstest.at, tests/subproject.at, tests/sysroot.at, tests/tagdemo.at,
tests/template.at, tests/testsuite.at, tests/versioning.at,
tests/with-pic.at: Replace FSF address in each file's license block with
a URL that points to licenses online hosted by GNU.
2024-09-13 20:19:33 +03:00
Sergey Poznyakoff
0e1b333324
ltmain: Use shared objects built in source tree
It has been discovered that under certain conditions libtool creates
wrappers that prefer installed versions of the shared objects over
those built in the source tree. As a result, any tests run in the
source tree produce unreliable results.

* build-aux/ltmain.in: Alter to use shared objects in source tree
  instead of installed.
* Makefile.am: Added in tests/bug_71489.at.
* tests/bug_71489.at: Contains test case for bug 71489.
2024-08-27 18:17:45 +03:00
Ileana Dumitrescu
3b78504a0c
ltmain: Error message improvement
* build-aux/ltmain.in: Append argument to error message to make it
  easier to understand, and edit message of each instance where
  run-paths are not absolute to better reflect the issue occurring
  to the user.
2024-07-19 19:31:12 +03:00
Julien ÉLIE
7f86baed1a
ltmain.in: Fix --preserve-dup-deps stripping duplicates
Building INN with libtool otherwise failed with unresolved circular
dependencies, even with the use of --preserve-dup-deps.
2024-07-19 19:25:52 +03:00
Ileana Dumitrescu
98e83597c0
ltmain: Fix testsuite errors for windows
Numerous test failures on windows/cygwin/mingw result with:
	did not find the 'nothing' variable

A syntax fix resolves these test failures for 64-bit windows-
based systems.

* build-aux/ltmain.in: Alter syntax in sed command.
2024-06-18 20:37:17 +03:00
Ileana Dumitrescu
b8cad780da
ltmain.in: Additional sysroot to prepend to libdir
Addition to commit 3221f9f0fb.
2024-05-31 17:56:09 +03:00
Vincent Lefevre
40b73c116e
libtool: pass more flags to the linker
Resolves bug 17750.

* build-aux/ltmain.in (func_mode_link): In the flags to be passed
through unchanged, also pass -static-* and -fcilkplus.
2024-05-31 16:18:34 +03:00
Khem Raj
3221f9f0fb
ltmain.in: Add missing sysroot to library path
When using a sysroot we should append it to libdir, which is helpful in
cross builds as the system is staged in the sysroot. For normal builds,
i.e. when lt_sysroot is not set, it will still behave the same and add
-L/usr/lib to the relink command.

* build-aux/ltmain.in: Prepend sysroot to libdir.
2024-05-30 17:43:15 +03:00
Ileana Dumitrescu
90710b139b
libtool: Minor syntax and typo fixes
doc/notes.texi: Duplicate "to" removed.
build-aux/ltmain.in: Useless parentheses in cpp directive removed.
2024-05-11 10:52:47 +03:00
Ileana Dumitrescu
7b09183107
ltmain.in: Use func_warning for all warnings
Several warning messages have been updated to use func_warning rather
than echo. This will allow them to be disabled properly.

* build-aux/ltmain.in: Replace echo command with func_warning function.
2024-04-20 13:04:33 +03:00
Ileana Dumitrescu
297b5cf19f
libtool: Pass the "-no-canonical-prefixes" linker flag
When using the -no-canonical-prefixes flag in libtool, the flag is
removed from the linking command, causing linking to fail. This adds
the flag to the list of linker flags to be passed through to the
linker.

* build-aux/ltmain.in: Pass -no-canonical-prefixes to the linker.
* Makefile.am: Added in tests/bug_62343.at.
* tests/bug_62343.at: Contains test case for bug 62343.
2024-04-18 19:26:55 +03:00
Ileana Dumitrescu
88fc2b892c
libtool: Remove test_compile
This is cleanup for libtool. The option test_compile is not used in
libtool, and the documentation states that it would probably be dropped
in the future.

* build-aux/ltmain.in: Remove case statement for test_compile.
* doc/libtool.texi: Remove test_compile from documentation.
* m4/libtool.m4: Remove test_compile definition from macro file.
2024-04-08 22:34:19 +03:00
Sam James
888bd7ad44
Clang uses -fopenmp=* to allow choosing between libgomp and libomp.
* build-aux/ltmain.in: Pass through -fopenmp=*.
2024-03-25 20:32:30 +02:00
Stephen Webb
a956f5ce7d
ltmain.in: update QNX version_type handling
QNX handles ELF SONAME versioning just like most other targets.
2024-03-25 19:09:08 +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
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
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
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
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
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
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
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
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
Vadim Zeitlin
383a3807b7 libtool: Include _CRTIMP in _putenv() declaration in EXE wrapper sources.
Re-declaring _putenv() without _CRTIMP in strict ANSI mode when using
MinGW resulted in a warning because of a conflict with the previous
declaration that did use _CRTIMP.

Simply add _CRTIMP to our declaration to avoid it.

* build-aux/ltmain.in (func_emit_cwrapperexe_src): Add _CRTIMP to
_putenv() declaration.

Signed-off-by: Vadim Zeitlin <vz-libtool@zeitlins.org>
2024-01-14 00:58:07 -05:00
Bruno Haible
9e7b9631ec Recognize *-*-windows* config triplets
The gnuconfig project recognizes windows* as a host OS to denote native
Windows environments.  The commit message makes it sound like LLVM and
Crablang communities will use the 'windows' value, whereas GNU will
continue to use 'mingw'. But I think it's only a matter of time until
people start to pass the option --host=x86_64-pc-windows to configure
scripts. We should be prepared for that.

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

* build-aux/ltmain.in: Treat windows* as equivalent to mingw*.
* m4/libtool.m4: Likewise.
* m4/ltdl.m4: Likewise.
* m4/ltoptions.m4: Likewise.
* tests/bindir.at: Likewise.
* tests/deplibs-mingw.at: Likewise.
* tests/lt_dladvise.at: Likewise.
* tests/testsuite.at: Likewise.
2024-01-14 00:41:20 -05:00
Dmitry Antipov
429d905115 libtool: passthru '-shared-libsan' and '-static-libsan' flags
This is intented to link against shared and static sanitizer
runtimes with Clang.

* build-aux/ltmain.in: Pass '-shared-libsan' and '-static-libsan'
flags when linking.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
2024-01-13 23:49:08 -05:00
Mike Frysinger
27b101add7 maint: fix git hooks logic error
`test set = set = set` is invalid, as is `test set = = set`.
Tweak the code to what was probably intended.

* build-aux/git-hooks/commit-msg: Fix $ECHO test call.
2024-01-12 02:14:47 -05:00
Mike Frysinger
85093d697a maint: update copyrights across project 2024-01-12 01:35:32 -05:00
Sam James
1ec8fa28dc
libtool: passthru '-Werror' flags
* build-aux/ltmain.in: Pass '-Werror' flags to linker.

Copyright-paperwork-exempt: Yes
2022-12-16 13:16:43 -06:00
Alex Ameen
6132006b5f
Revert "libtool: permit compiler libs in shlibs"
This reverts commit 1d2577357e.
2022-05-16 00:07:17 -05:00
Alex Ameen
1d2577357e
libtool: permit compiler libs in shlibs 2022-05-08 21:46:30 -05:00
Alex Ameen
2dc7dad770 maint: update copyrights across project. 2022-02-08 12:11:10 -06:00
Stacey Marshall
b55b1cc841 libtool: Do not pass '-pthread' to Solaris linker.
* build-aux/ltmain.in: Do not add -pthread to inherited linker flags on
Solaris systems.

Copyright-paperwork-exempt: Yes
2022-02-05 15:36:36 -06:00
Václav Haisman
ccc878dd72 libtool: replace raw invocations of sed with $SED
* build-aux/ltmain.in: replace raw invocations of sed with $SED
* m4/libtool.m4: replace raw invocations of sed with $SED
* m4/ltargz.m4: replace raw invocations of sed with $SED
* m4/ltdl.m4: replace raw invocations of sed with $SED

Co-authored-by: Alex Ameen <alex.ameen.tx@gmail.com>
Copyright-paperwork-exempt: Yes
2021-11-29 20:37:49 -06:00
Lucas Holt
5df7dd49d5 libtool: add support for MidnightBSD
* build-aux/ltmain.in: clone link-mode handling for MidnightBSD from FreeBSD
* m4/libtool.m4: clone various TAGVARs for MidnightBSD from FreeBSD
* m4/ltdl.m4: clone dlopen handling for MidnightBSD from FreeBSD

Copyright-paperwork-exempt: Yes
2021-11-29 18:54:09 -06:00
Alex Ameen
da2e352735 libtool: replace some references to /usr/bin/file and /bin/sh
* build-aux/ltmain.sh: use '/usr/bin/env sh' in shebang
* libtoolize.in: use '/usr/bin/env sh' in shebang
* m4/libtool.m4: 'FILECMD' to replace use of '/usr/bin/file'
2021-11-20 14:37:05 -06:00
aakropotkin
1b74d78401 libtool: Add -Wa,* link-mode flag for assembler pass-thru
* build-aux/ltmain.in: add -Wa,* as link-mode flag.
Add help messages for -Wa,* and -Xassember in link mode.
Add help message for -Xcompiler in compile mode.
* doc/libtool.texi: document -Xassembler and -Wa,* for link-mode.
2021-11-18 21:24:47 -06:00
Alex Potapenko
86d71e869d libtool: Pass -Xassembler flag and arguments to compiler
* build-aux/ltmain.in: Add parsing and pass-thru for -Xassembler

Copyright-paperwork-exempt: Yes
2021-11-18 19:53:35 -06:00
aakropotkin
0c1bc69dac maint: update copyrights across project.
* AUTHORS: Correct manually modified copyright to be consistent with
other files.
2021-11-14 22:37:22 -06:00