[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libtool 2.2.2 fails to create shared object
From: |
Bruno Haible |
Subject: |
libtool 2.2.2 fails to create shared object |
Date: |
Sun, 6 Apr 2008 11:01:40 +0200 |
User-agent: |
KMail/1.5.4 |
Hi,
This is a regression: On Linux/i386, with libtool-1.5.26, I could create a
preloadable shared object file through this command.
$ /bin/sh ../libtool --mode=link gcc -I. -I../include -I.. -g -O2 -Wall \
-I/packages/gnu/include -DLIBDIR=\"/packages/gnu/lib\" -DBUILDING_LIBICONV \
-DBUILDING_DLL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY \
-DINSTALLDIR=\"/packages/gnu/lib\" -DNO_XMALLOC \
-Dset_relocation_prefix=libiconv_set_relocation_prefix \
-Drelocate=libiconv_relocate -DHAVE_CONFIG_H -fPIC -DPIC -DLIBICONV_PLUG \
./iconv.c ./../libcharset/lib/localcharset.c ./relocatable.c \
-shared -o preloadable_libiconv_linux.so
It executed this command:
gcc -I. -I../include -I.. -g -O2 -Wall -I/packages/gnu/include
-DLIBDIR=\"/packages/gnu/lib\" -DBUILDING_LIBICONV -DBUILDING_DLL
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/packages/gnu/lib\"
-DNO_XMALLOC -Dset_relocation_prefix=libiconv_set_relocation_prefix
-Drelocate=libiconv_relocate -DHAVE_CONFIG_H -fPIC -DPIC -DLIBICONV_PLUG
./iconv.c ./../libcharset/lib/localcharset.c ./relocatable.c -shared -o
preloadable_libiconv_linux.so
With libtool-2.2.2, the same libtool invocation executes this command:
libtool: link: gcc -I. -I../include -I.. -g -O2 -Wall -I/packages/gnu/include
-DLIBDIR=\"/packages/gnu/lib\" -DBUILDING_LIBICONV -DBUILDING_DLL
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/packages/gnu/lib\"
-DNO_XMALLOC -Dset_relocation_prefix=libiconv_set_relocation_prefix
-Drelocate=libiconv_relocate -DHAVE_CONFIG_H -fPIC -DPIC -DLIBICONV_PLUG
./iconv.c ./../libcharset/lib/localcharset.c ./relocatable.c -o
preloadable_libiconv_linux.so
This fails with an error
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crt1.o(.text+0x18): In function
`_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
Of course the reason is that the "-shared" switch has been omitted.
System information:
host-triplet: i686-pc-linux-gnu
shell: /bin/sh
compiler: gcc
compiler flags: -g -O2
linker: /usr/i586-suse-linux/bin/ld (gnu? yes)
libtool: (GNU libtool) 2.2.2
automake: automake (GNU automake) 1.10.1
autoconf: autoconf (GNU Autoconf) 2.61
How to reproduce:
- Take libiconv-1.12.tar.gz from ftp.gnu.org,
- Replace the libtool.m4 with
{libtool.m4,ltoptions.m4,ltsugar.m4,ltversion.m4,lt~obsolete.m4}
(twice, in m4/ and libcharset.m4/).
- Replace the ltmain.sh with the one from libtool-2.2.2 (twice also),
- Apply the patch below, to use the new macros,
- "make -f Makefile.devel"
- ./configure; make
Bruno
*** configure.ac 23 Oct 2007 23:54:41 -0000 1.19
--- configure.ac 6 Apr 2008 08:57:29 -0000
***************
*** 73,81 ****
dnl check for build configuration
! AC_DISABLE_STATIC
! AC_LIBTOOL_WIN32_DLL
! AC_PROG_LIBTOOL
gl_VISIBILITY
AM_ICONV
AM_GNU_GETTEXT([external], [need-ngettext])
--- 73,79 ----
dnl check for build configuration
! LT_INIT([disable-static win32-dll])
gl_VISIBILITY
AM_ICONV
AM_GNU_GETTEXT([external], [need-ngettext])
*** libcharset/configure.ac 5 Mar 2007 00:59:40 -0000 1.5
--- libcharset/configure.ac 6 Apr 2008 08:57:29 -0000
***************
*** 56,63 ****
dnl check for build configuration
! AC_LIBTOOL_WIN32_DLL
! AC_PROG_LIBTOOL
gl_VISIBILITY
dnl checks for header files and functions
--- 56,62 ----
dnl check for build configuration
! LT_INIT([win32-dll])
gl_VISIBILITY
dnl checks for header files and functions
- libtool 2.2.2 fails to create shared object,
Bruno Haible <=