bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mingw32 and static flags (static.at tests)


From: Roumen Petrov
Subject: mingw32 and static flags (static.at tests)
Date: Sat, 13 Dec 2008 01:24:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.18) Gecko/20081114 SeaMonkey/1.1.13

Hi All,

It I understand properly the tests from static.at libtool try to link executables with three libraries specified differently:
- a1 : installed "non-libtool" library, i.e. without la-file;
- a2 : libtool project library, i.e. with la-file in srcdir;
- a3 : installed "non-libtool" library with runtime search path, i.e. without la-file plus -R option.

To link executables libtool use three flags: -static -static-libtool-libs -all-static.

I would like to know whether executables linked correctly or not.
Also please check impact of -R flag to link process.

Below is outputs from link command, as I substitute absolute paths with <SRCDIR>, <BLDDIR>, <TESTDIR> for easy reading.
The tested libtool version is origin from 2008-12-12.


## global build flags.
## pwd:<TESTDIR>/29/src
## CC=i386-mingw32msvc-gcc
## CFLAGS=-O2 -fno-strict-aliasing -Wall
## LDFLAGS=-L/opt/mingw -no-undefined
## libdir1=<TESTDIR>/29/inst1/lib
## libdir3=<TESTDIR>/29/inst3/lib


1) st=-static
The command is:
<BLDDIR>/libtool --mode=link i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -L/opt/mingw -no-undefined -static -o m-static.exe m.o -L<TESTDIR>/29/inst1/lib -la1 a2/liba2.la -L<TESTDIR>/29/inst3/lib -R<TESTDIR>/29/inst3/lib -la3

Log output:
....
<SRCDIR>/tests/static.at:271: $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o m${st}$EXEEXT m.$OBJEXT \
        -L$libdir1 -la1 a2/liba2.la -L$libdir3 -R$libdir3 -la3
Not enabling shell tracing (command contains a ${...} parameter expansion)
stderr:
stdout:
libtool: link: i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -o m-static.exe m.o -L/opt/mingw -L<TESTDIR>/29/inst1/lib <TESTDIR>/29/inst1/lib/liba1.dll.a a2/.libs/liba2.a -L<TESTDIR>/29/inst3/lib -la3 -L<TESTDIR>/29/inst1/lib -L<TESTDIR>/29/inst1/lib -L<TESTDIR>/29/inst3/lib
....

The result is executable(m-static.exe) linked with dynamic libraries "a1" and "a3".


2) st=-static-libtool-libs
The command is:
<BLDDIR>/libtool --mode=link i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -L/opt/mingw -no-undefined -static-libtool-libs -o m-static-libtool-libs.exe m.o -L<TESTDIR>/29/inst1/lib -la1 a2/liba2.la -L<TESTDIR>/29/inst3/lib -R<TESTDIR>/29/inst3/lib -la3

Log output:
....
<SRCDIR>/tests/static.at:271: $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o m${st}$EXEEXT m.$OBJEXT \
        -L$libdir1 -la1 a2/liba2.la -L$libdir3 -R$libdir3 -la3
Not enabling shell tracing (command contains a ${...} parameter expansion)
stderr:
stdout:
libtool: link: i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -o m-static-libtool-libs.exe m.o -L/opt/mingw -L<TESTDIR>/29/inst1/lib <TESTDIR>/29/inst1/lib/liba1.a a2/.libs/liba2.a -L<TESTDIR>/29/inst3/lib -la3 -L<TESTDIR>/29/inst3/lib
....

The result is executable(m-static-libtool-libs.exe) linked with dynamic library "a3".


3) st=-all-static
The command is:
<BLDDIR>/libtool --mode=link i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -L/opt/mingw -no-undefined -all-static -o m-all-static.exe m.o -L<TESTDIR>/29/inst1/lib -la1 a2/liba2.la -L<TESTDIR>/29/inst3/lib -R<TESTDIR>/29/inst3/lib -la3

Log output:
....
<SRCDIR>/tests/static.at:271: $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o m${st}$EXEEXT m.$OBJEXT \
        -L$libdir1 -la1 a2/liba2.la -L$libdir3 -R$libdir3 -la3
Not enabling shell tracing (command contains a ${...} parameter expansion)
stderr:
stdout:
libtool: link: i386-mingw32msvc-gcc -O2 -fno-strict-aliasing -Wall -static -o m-all-static.exe m.o -L/opt/mingw -L<TESTDIR>/29/inst1/lib <TESTDIR>/29/inst1/lib/liba1.a a2/.libs/liba2.a -L<TESTDIR>/29/inst3/lib -la3 -L<TESTDIR>/29/inst3/lib
....

The executable(m-all-static.exe) isn't linked with dynamic libraries.

Roumen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]