This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Programs differing only by ".exe" suffix: subtle Libtool 1.3 +Automake 1.4 interaction bug
- To: bug-libtool@gnu.org, Automake List <automake@gnu.org>
- Subject: Programs differing only by ".exe" suffix: subtle Libtool 1.3 +Automake 1.4 interaction bug
- From: "Matthew D. Langston" <langston@SLAC.Stanford.EDU>
- Date: Sat, 22 May 1999 02:48:12 +0000
- Organization: Stanford Linear Accelerator Center
This tiny package, "lt_am_bug", demonstrates a subtle bug that was
introduced in Libtool 1.3 concerning the interaction of Libtool 1.3 with
Automake 1.4. The bug can be enabled by passing the flag "--enable-bug"
to `configure'. By default the bug is disabled.
The bug was discovered on a system with x86 Linux (Pentium III, Linux
2.0.36, glibc 2.0.7, i686-pc-linux-gnu) with Autoconf 2.13 and Automake
1.4. It appeared after upgrading from Libtool 1.2 to Libtool 1.3. The
bug is not present when using Libtool 1.2 with Automake 1.4.
In a nutshell, an Automake/Libtool package becomes "broken" when two
programs (i.e. in some Automake "_PROGRAMS" primary) differ in their
names only by the suffix ".exe". For example, the following snippet
from `Makefile.am' works as expected:
bin_PROGRAMS = main main.exx
main_exx_SOURCES = main2.c
main_exx_LDADD = libtest.la
In this case two programs will be created, `main' and `main.exx'.
Please see `Makefile.am' (a tiny file) for the full context. This
produces the following (correct) output from "make check".
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
begin "make check" output
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ make check
make check-TESTS
make[1]: Entering directory `/mnt/hdc/projects/sourceware/build/lt_am_bug'
Hello from ./main
PASS: main
Hello from lt-main.exx
Hello from the test library
PASS: main.exx
==================
All 2 tests passed
==================
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end "make check" output
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
However, making the following change to `Makefile.am' (replacing the 3
occurrences of "exx" with "exe") will demonstrate the bug:
bin_PROGRAMS = main main.exe
main_exe_SOURCES = main2.c
main_exe_LDADD = libtest.la
In this case the two programs that should be created, `main' and
`main.exe', are not created. Only the Libtool wrapper `main' is
created, which incorrectly wraps the nonexistent program
`.libs/main.exe'. Again, please see `Makefile.am' for the full context.
This produces the following (incorrect) output from "make check".
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
begin "make check" output
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ make check
/bin/sh ./libtool --mode=link gcc -g -O2 -o main.exe main2.o libtest.la
gcc -g -O2 -o .libs/main.exe main2.o .libs/libtest.so -Wl,--rpath -Wl,/usr/local/lib
creating main.exe
make check-TESTS
make[1]: Entering directory `/mnt/hdc/projects/sourceware/build/lt_am_bug'
/bin/sh ./libtool --mode=link gcc -g -O2 -o main.exe main2.o libtest.la
gcc -g -O2 -o .libs/main.exe main2.o .libs/libtest.so -Wl,--rpath -Wl,/usr/local/lib
creating main.exe
Hello from lt-main.exe
Hello from the test library
PASS: main
/bin/sh: ../../lt_am_bug-0.01/main.exe: No such file or directory
FAIL: main.exe
===================
1 of 2 tests failed
===================
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end "make check" output
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Also notice that with the buggy version enabled, the program `main.exe'
is always recompiled and relinked, i.e. the dependency in the generated
Makefile is somehow wrong as well.
I don't know if the problem lies within Libtool 1.3 or Automake 1.4, but
the bug isn't present when using Libtool 1.2 with Automake 1.4.
I recently came across this bug while "Autoconfing" a package called
ROOT (an analysis package for High Energy Physics). My "Autoconfed"
version of ROOT creates two programs named "root" and "root.exe". Since
I am packaging a 3rd party package, I have no control over the names of
these two programs. I have had to fall back to Libtool 1.2 for now.
--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU
lt_am_bug-0.01.tar.gz