Commit Graph

427 Commits

Author SHA1 Message Date
Khalid Masum
d8a934458b
libtool: add support for wasm32-emscripten
This patch adds support for emscripten compiler for shared compilation.

* build-aux/ltmain.in: clone link-mode handling for emscripten from
unixware7.
* m4/libtool.m4: translate emscripten specific flags for shared module
building.
2024-11-20 17:36:31 +02:00
Tim Schumacher
23519121db
libtool: Add support for SerenityOS
This hobbyist OS has already been added to `config.sub` (and
`config.guess` respectively) some time ago, but was still lacking
upstream support for building libraries using libtool.

Since it is a relatively up-to-date system with ports of modern
software, "adding support" mostly just means adding empty cases to avoid
falling though to the most basic behavior (that guarantees compatibility
at the expense of disabling everything that might be critical).

* m4/libtool.m4: Add support for SerenityOS.
2024-11-20 17:36:31 +02:00
streaksu
bd15931e57
libtool: add support for Ironclad 2024-11-20 17:36:31 +02:00
Adrien Destugues
4e5a12014b
Do not explicitly link dependencies on Haiku.
This is not needed, the runtime_loader can figure them out.
2024-11-20 17:36:30 +02:00
Jerome Duval
e6c7986fc8
Adjust haiku configuration 2024-11-20 17:36:30 +02:00
Ileana Dumitrescu
6bc5e177b6
libtool.m4: Fix '-Fe' usage with linking in MSVC
A space after '-Fe' treats a file name as an input file instead of
as the intended output file.

* m4/libtool.m4: Remove space after '-Fe'.
* NO-THANKS: Add Kirill Makurin for bug report 74175.
* NEWS: Update.
2024-11-20 17:36:28 +02:00
Ileana Dumitrescu
323d8a5dfd
libtool.m4: Update hardcode_shlibpath_var for OpenBSD
When generating an executable in OpenBSD, the executable fails to
generate when shlibpath_var, LD_LIBRARY_PATH, is used solely to
locate dependent libraries.

For hardcoding library paths in OpenBSD, see documentation for
hardcode_direct and hardcode_libdir_flag_spec.

* m4/libtool.m4: Update hardcode_shlibpath_var from 'no' to 'unsupported'
  by removing 'with_gnu_ld=no' for OpenBSD.
2024-11-20 16:42:38 +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
Alastair McKinstry
506283c381
libtool.m4: Support for more flang compilers 2024-10-22 20:02:18 +03:00
Alastair McKinstry
8342fed94a
libtool: Add support for netbsdelf
* m4/libtool.m4: Add support for netbsdelf*-gnu.
* m4/ltdl.m4: Append netbsdelf*-gnu to netbsd* occurrences in case
  statements.
2024-10-22 20:02:17 +03:00
Alastair McKinstry
0bad1a6edf
libtool.m4: Add spaces before -L in grep searches
Current searching for "-L" in link paths is over-greedy and
incorrectly handles paths with -L in them.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896861
2024-10-22 20:02:16 +03:00
Vincent Lefevre
5139403de6
libtool.m4: Avoid a broken AC_TRY_EVAL macro
As said in the Autoconf source, the AC_TRY_EVAL macro is dangerous and
undocumented, and should not be used.
In particular, the one related to nm yields binary data in the config.log
file with dash, where "echo \\1" (echo with the argument \1) produces the
control character ^A instead of the usual \1 with most shells (POSIX says
that the result is implementation-defined). See:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910076
This patch attempts to replace this AC_TRY_EVAL occurrence by code with
similar behavior, but using $ECHO instead of echo in order to avoid the
backslash issue.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21309
2024-10-22 20:02:16 +03:00
Vincent Lefevre
7a27cb1bcd
libtool.m4: Add run path when linking with tcc
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20622
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814091
2024-10-22 20:02:16 +03:00
Bruno Haible
f91f7bc3ab
libtool.m4: Avoid word splitting on untrusted inputs
If $multilib is set to more than one word, the following error can be
seen during configuration:

	test: too many arguments

* m4/libtool.m4: Wrap variable in quotes.
2024-10-22 20:02:15 +03:00
Ileana Dumitrescu
4e96fb2a47
libtool.m4: Increment serial and typo/spacing fix 2024-10-22 20:02:15 +03:00
Markus Mützel
68fbecc49b
libtool: Handle unset $multilib for Windows targets.
If `multilib` is unset (which it apparently is by default), the output
from running a `configure` script contains lines like the following:
```
checking dynamic linker characteristics... ../configure: line 26791: test: yes: unary operator expected
Win32 ld.exe
```

The additional output is not a fatal error. But it could be irritating.

Avoid the unexpected output from `test` by making sure `=` is used as a
binary operator.

* m4/libtool.m4: Prepend "x" on both sides of a comparison with `test`
and the operator `=`.
* NEWS: Update for bug fix.

See also: https://github.com/msys2/MINGW-packages/pull/21905
2024-10-22 20:00:47 +03:00
Ileana Dumitrescu
d405ede870
Fix errors in distclean and maintainer-clean
The variable, LT_ARGZ_H, can be empty, which causes distclean and
maintainer-clean to error as a directory is attempted to be removed
instead of a file.

When running maintainer-clean for gnulib-tests, the .version file is
missing, which is needed by config.status, so the command will error.

* configure.ac: Update CONFIG_STATUS_DEPENDENCIES to use dotversion so
  that the .version file can be generated if needed.
* libltdl/ltdl.mk: Add conditional with LTARGZH_EXISTS to append path for
  LT_ARGZ_H file to BUILT_SOURCES.
* m4/ltdl.m4: Add AM_CONDITIONAL for LTARGZH_EXISTS that is set to
  true if LT_ARGZ_H is non-empty.
* NO-THANKS: Add 'Michael Pratt' for bug#73672 contribution.
* NEWS: List additional bug fix.
2024-10-22 19:55:50 +03:00
Joshua Root
82f7f52123
libtool.m4: Update '-single_module' detection
'-single_module' detection is broken with Xcode 15, where a message to
stderr indicates the flag is deprecated, not unsupported.

* m4/libtool.m4: Check macOS versions to see if '-single_module' flag is
  unnecessary.
2024-10-22 19:45:25 +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
3e6c6284a7
libtoolize: Fix conflicting warnings about AC_PROG_RANLIB
The macro _LT_CMD_OLD_ARCHIVE inlines the definition of AC_PROG_RANLIB,
which seems to be outdated functionality. Running autoscan in a
directory with ltmain.sh produces conflicting warnings with libtoolize
about AC_PROG_RANLIB. Autoconf warns that AC_PROG_RANLIB is missing,
but libtoolize warns that it is obsolete. The outdated warning should
no longer appear after replacing AC_CHECK_TOOL(RANLIB, ranlib, :) with
AC_REQUIRE([AC_PROG_RANLIB]).

* m4/libtool.m4: Use AC_REQUIRE([AC_PROG_RANLIB]).
* Makefile.am: Added in tests/bug_42313.at.
* tests/bug_42313.at: Contains test cases for bug 42313.
2024-09-13 20:19:34 +03:00
Bruno Haible
6c8203d2ae
Rename option --with-aix-soname to --enable-aix-soname.
Reported at <https://savannah.gnu.org/support/index.php?110674>.

* doc/libtool.texi (LT_INIT): Talk about --enable-aix-soname instead of --with-aix-soname.
* m4/ltoptions.m4 (_LT_WITH_AIX_SONAME): Use AC_ARG_ENABLE instead of
AC_ARG_WITH. In the default case, use _AC_ENABLE_IF, in order to still
recognize the old option --with-aix-soname.
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Update comment.
* configure.ac: Update comment.
* NEWS: Mention the change.
2024-09-13 20:19:33 +03:00
Bruno Haible
9a8535f4e9
Rename option --with-pic to --enable-pic.
Reported at <https://savannah.gnu.org/support/index.php?110674>.

* doc/libtool.texi (LT_INIT): Talk about --enable-pic instead of
--with-pic, and about --disable-pic instead of --without-pic.
(Test descriptions): Likewise.
* m4/ltoptions.m4 (_LT_WITH_PIC): Use AC_ARG_ENABLE instead of
AC_ARG_WITH. In the default case, use _AC_ENABLE_IF, in order to still
recognize the old options --with-pic and --without-pic.
* tests/demo.at: Add a test for --enable-pic, keeping the test for
--with-pic. Test '--disable-pic' instead of '--with-pic=no'.
* tests/with-pic.at: Test --enable-pic instead of --with-pic.
* NEWS: Mention the change.
2024-09-13 20:19:33 +03:00
Bruno Haible
552d1db3fb
Fix libtool wrapper programs in 32-bit mode on FreeBSD/powerpc64.
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): On FreeBSD/powerpc64, in 32-bit mode,
set shlibpath_var to LD_32_LIBRARY_PATH instead of LD_LIBRARY_PATH.
2024-08-27 17:07:29 +03:00
Ileana Dumitrescu
42229835ff
m4: Increment serial for recent changes
* m4/libtool.m4: Incremented serial to 62.
* m4/ltdl.m4: Incremented serial to 23.
2024-07-24 17:20:54 +03:00
Ileana Dumitrescu
2a25604bcf
m4: Support additional flang-based compilers
* m4/libtool.m4: Alter regex to support 'flang-new' and 'ftn'.
* NO-THANKS: Add thanks for Anton Shterenlikht.
2024-07-19 19:32:36 +03:00
Ileana Dumitrescu
f0507df8a7
m4: Disable chained fixups for macOS
Append '-no_fixup_chains' flag to disable chained fixups since it
is not compatible with '-undefined dynamic_lookup'.

* m4/libtool.m4: AC_VAR_APPEND will handle appending the option to
  the variable, which allows the '+=' extension to be used by shells
  that provide this capability for more efficient scaling. Also, bump
  minimum required version of autoconf from 2.62 to 2.64.
* tests/no-executables.at: Set cache variable for link test.
* NO-THANKS: Add thanks for Carlo Cabrera and Dave Allured.
2024-07-19 19:26:09 +03:00
trcrsired
ab89ebbcc2
libtool: Correct DLL Installation Path for mingw
When building native GCC for the x86_64-w64-mingw32 host, the
compiler copies its library DLLs to the `bin` directory. However,
in the case of a multilib configuration, both 32-bit and 64-bit
libraries end up in the same `bin` directory, leading to conflicts
where 64-bit DLLs are overridden by their 32-bit counterparts.

This patch addresses the issue by adjusting the installation path
for the libraries. Specifically, it installs the libraries to
separate directories: `lib` for 64-bit and `lib32` for 32-bit. This
behavior aligns with how libraries are installed when creating an
x86_64-w64-mingw32 cross-compiler without copying them to the `bin`
directory if it is a multilib build.

* m4/libtool.m4: Install DLL to $(libdir), not $(libdir)/bin, if
  multilib build.
2024-07-19 19:20:46 +03:00
Peter Kokot
434a308f46
m4: Fix Wstrict-prototypes warnings
This changes the C function prototypes to use void where needed. When
building with CFLAGS=-Werror=strict-prototypes or similar, the libtool's
tests can cause false reports and errors in the log files:

    error: function declaration isn't a prototype

* m4/libtool.m4: Specify void for main function prototypes.
* m4/ltdl.m4: Specify void for main and fnord function prototypes.
2024-07-19 19:20:46 +03:00
Richard Purdie
9a4a02615c
m4/libtool.m4: Fixed AC_CHECK_PROG call
AC_CHECK_TOOL was changed to AC_CHECK_PROG however the arguments are
different and this result is a value of ":". Change this to match the
original intent.

The lack of FILECMD was causing failures for mips64 builds as -m elf was
being passed to LD which isn't supported on our targets.
2024-06-05 20:25:58 +03:00
Ileana Dumitrescu
3280f27cda
libtool.m4: Incremented serial
* m4/libtool.m4: Incremented serial for previous changes.
2024-05-11 10:29:07 +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
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
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
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
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
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
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
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
Jakub Wilk
9ced107b8c libtool.m4: fix typos
* m4/libtool.m4: Fix various typos.
2024-01-14 01:03:54 -05:00
Samuel Thibault
7464f1db29 libtool: hurd-amd64 support
This adds support for passing -m elf32_x86_64 vs -m elf_x86_64 to the
linker on hurd-amd64.

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

* m4/libtool.m4: dd x86_64-gnu* case to pass -m elf32_x86_64 vs
-m elf_x86_64 to linker.
2024-01-14 00:48:00 -05:00