[Ilugc] static linking of libraries using libtool

  • From: anantha.narasimhan@xxxxxxxxx (anantha narasimhan)
  • Date: Mon Feb 15 12:37:28 2010

Hi,


I am trying to build an rpm for an application. This application needs to
link with libhtp library. libhtp has a few undefined symbols, for which it
depends on libz.
I wanted to link libhtp statically to the application, hence i overrode
LDFLAGS in the SPEC file to point to the location of libhtp.a.

export LDFLAGS="-L`pwd`  -lz -ldag  -O3 -mtune=generic"

However, libtool seems to insert the -lz directive in front of the -lhtp
during linking.

gcc -Wextra -Wall -fno-strict-aliasing ....  -lz -ldag -lhtp ...

Since the archive is scanned only once for loading the required symbols,
linking fails as there are unresolved symbols in libhtp.

Is there anyway to get around this  ?


-- 
keep klicking
Anantha Narasimhan

Other related posts: