libtool doesn't process LD_FLAGS arguments properly

2010-11-23 Thread Gavrilov, Roman
Greetings,

I'm using libtool to build xerces3 & Xquilla both use libtool to build
the library.

It seems that libtool doesn't process arguments properly especially
those that contain space in the arguments for example
-Wl,rpath-link{SPACE}PATH.

 

I'm setting environment variable LD_FLAGS to pass additional linkage
flags to the compiler.

Those flags contains  -Wl,rpath-link PATH -Wl,rpath-link PATH

 

I noticed that when libtool processes those flags it omits the PATH and
actually what is passed to compiler is:

-Wl,rpath-link -Wl,rpath-link 

 

Which eventually brakes the build and some flags don't get to compiler.

 

Please advice.

Thanks,

--

Roman

 

___
http://lists.gnu.org/mailman/listinfo/libtool


Re: libtool doesn't process LD_FLAGS arguments properly

2010-11-23 Thread Gary V. Vaughan
On 23 Nov 2010, at 18:02, Gavrilov, Roman wrote:
I’m using libtool to build xerces3 & Xquilla both use libtool to build the 
library.
> It seems that libtool doesn’t process arguments properly especially those 
> that contain space in the arguments for example –Wl,rpath-link{SPACE}PATH.

Try:

  libtool ... -Wl,-rpath-link -Wl,PATH

or:

  libtool ... -Xlinker -rpath-link -Xlinker PATH

If PATH also has spaces in it, libtool will probably get confused (shell 
scripts are extremely difficult to get right with embedded spaces).  You can 
work around that by creating a soft-link to a new path with no spaces in it, 
and then pass *that* path in to libtool.

Cheers,
-- 
Gary V. Vaughan (g...@gnu.org)

PGP.sig
Description: This is a digitally signed message part
___
http://lists.gnu.org/mailman/listinfo/libtool


RE: libtool doesn't process LD_FLAGS arguments properly

2010-11-23 Thread Gavrilov, Roman
Hi Gary,
Libtool ... -Wl,-rpath-link -Wl,PATH does work, now libtool passes it to
linker as is, but I don't think compiler would understand those
arguments as it expects the PATH to follow -Wl,-rpath-link.

--
Roman


-Original Message-
From: Gary V. Vaughan [mailto:g...@vaughan.pe] 
Sent: Tuesday, November 23, 2010 1:18 PM
To: Gavrilov, Roman
Cc: libtool@gnu.org
Subject: Re: libtool doesn't process LD_FLAGS arguments properly

On 23 Nov 2010, at 18:02, Gavrilov, Roman wrote:
I'm using libtool to build xerces3 & Xquilla both use libtool to build
the library.
> It seems that libtool doesn't process arguments properly especially
those that contain space in the arguments for example
-Wl,rpath-link{SPACE}PATH.

Try:

  libtool ... -Wl,-rpath-link -Wl,PATH

or:

  libtool ... -Xlinker -rpath-link -Xlinker PATH

If PATH also has spaces in it, libtool will probably get confused (shell
scripts are extremely difficult to get right with embedded spaces).  You
can work around that by creating a soft-link to a new path with no
spaces in it, and then pass *that* path in to libtool.

Cheers,
-- 
Gary V. Vaughan (g...@gnu.org)

___
http://lists.gnu.org/mailman/listinfo/libtool


Re: libtool doesn't process LD_FLAGS arguments properly

2010-11-23 Thread Gary V. Vaughan
[Please don't top post on technical lists]

Hi Roman,

On 23 Nov 2010, at 19:13, Gavrilov, Roman wrote:
> -Original Message-
> From: Gary V. Vaughan [mailto:g...@vaughan.pe] 
> Sent: Tuesday, November 23, 2010 1:18 PM
> To: Gavrilov, Roman
> Cc: libtool@gnu.org
> Subject: Re: libtool doesn't process LD_FLAGS arguments properly
> 
> On 23 Nov 2010, at 18:02, Gavrilov, Roman wrote:
> I'm using libtool to build xerces3 & Xquilla both use libtool to build
> the library.
>> It seems that libtool doesn't process arguments properly especially
> those that contain space in the arguments for example
> -Wl,rpath-link{SPACE}PATH.
> 
> Try:
> 
>  libtool ... -Wl,-rpath-link -Wl,PATH
> 
> or:
> 
>  libtool ... -Xlinker -rpath-link -Xlinker PATH
> 
> If PATH also has spaces in it, libtool will probably get confused (shell
> scripts are extremely difficult to get right with embedded spaces).  You
> can work around that by creating a soft-link to a new path with no
> spaces in it, and then pass *that* path in to libtool.
> 
> Cheers,
> -- 
> Gary V. Vaughan (g...@gnu.org)
> 
> 
> Hi Gary,
> Libtool ... -Wl,-rpath-link -Wl,PATH does work, now libtool passes it to
> linker as is, but I don't think compiler would understand those
> arguments as it expects the PATH to follow -Wl,-rpath-link.

By the time the driver passes arguments to the linker, it will see, e.g.:

  /usr/bin/ld ... -rpath-link PATH

which is how this is supposed to work.

Cheers,
-- 
Gary V. Vaughan (g...@gnu.org)


PGP.sig
Description: This is a digitally signed message part
___
http://lists.gnu.org/mailman/listinfo/libtool


Problem with --as-needed flag

2010-11-23 Thread Sergio Belkin
There is a issue with --as-needed that it's ignored when using with
automake:

You can take a look the Makefile.am on:

http://pastebin.com/jn4kiqTd

noinst_PROGRAMS are linking against "all libraries mentioned on the command
line" and not only "against libraries that  satisfy  some  symbol
reference  from  regular  objects  which  is  undefined  at the point that
the library was linked" as ld manpage states.

Is there a workaround for it?

Thanks in advance


-- 
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
___
http://lists.gnu.org/mailman/listinfo/libtool


Re: Problem with --as-needed flag

2010-11-23 Thread Mike Frysinger
On Tuesday, November 23, 2010 08:04:45 Sergio Belkin wrote:
> You can take a look the Makefile.am on:
> 
> http://pastebin.com/jn4kiqTd

please do not use pastebin type sites with mailing lists.  post all your info 
into the e-mail itself.
-mike


signature.asc
Description: This is a digitally signed message part.
___
http://lists.gnu.org/mailman/listinfo/libtool


Re: Problem with --as-needed flag

2010-11-23 Thread Sergio Belkin
2010/11/23 Mike Frysinger > On Tuesday, November
23, 2010 08:04:45 Sergio Belkin wrote:
>> You can take a look the Makefile.am on:
>>
>> http://pastebin.com/jn4kiqTd
>
> please do not use pastebin type sites with mailing lists.  post all your info
> into the e-mail itself.
> -mike
>

Mike, sorry, I thought it was more polite using pastebin in order to
shorten the mail. I bet that you  know about the topic beside
netiquette, so Makefile.am below is:

ACLOCAL_AMFLAGS= -I m4 --install
lib_LTLIBRARIES = libUpTools.la
libUpTools_la_SOURCES = UpLog.cc \
UpLine.cc \
UpThread.cc \
UpThreadWorkDistributor.cc \
UpInet.cc \
UpDnsBase.cc \
UpResolver.cc \
UpResolverSimple.cc \
UpDnsQuery.cc \
UpDnsQuerySimple.cc \
UpRegex.cc \
UpConf.cc \
UpLinkable.cc \
UpOp.cc \
UpTimeVal.cc \
UpTimerManager.cc \
UpSubstitute.cc \
UpNaptrQuery.cc \
UpSql.cc \
UpSqlConnPool.cc
pkginclude_HEADERS = include/UpTools/ci_string.h \
include/UpTools/UpArch.h \
include/UpTools/UpBuf.h \
include/UpTools/UpCondition.h \
include/UpTools/UpConf.h \
include/UpTools/UpDnsBase.h \
include/UpTools/UpDnsBase.inl \
include/UpTools/UpHashMap.h \
include/UpTools/UpInet.h \
include/UpTools/UpInet.inl \
include/UpTools/UpLine.h \
include/UpTools/UpLog.h \
include/UpTools/UpLog.inl \
include/UpTools/UpNaptrQuery.h \
include/UpTools/UpOp.h \
include/UpTools/UpRegex.h \
include/UpTools/UpResolver.h \
include/UpTools/UpResolver.inl \
include/UpTools/UpResolverSimple.h \
include/UpTools/UpResolverSimple.inl \
include/UpTools/UpSelect.h \
include/UpTools/UpSmartLinkPtr.h \
include/UpTools/UpSmartLinkPtr.inl \
include/UpTools/UpSubstitute.h \
include/UpTools/UpThread.h \
include/UpTools/UpThread.inl \
include/UpTools/UpThreadSpecific.h \
include/UpTools/UpThreadSpecific.inl \
include/UpTools/UpThreadWorkDistributor.h \
include/UpTools/UpThreadWorkDistributor.inl \
include/UpTools/UpTimer.h \
include/UpTools/UpTimerManager.h \
include/UpTools/UpTimeVal.h \
include/UpTools/UpTimeVal.inl \
include/UpTools/UpSql.h \
include/UpTools/UpSql.inl \
include/UpTools/UpSqlConnPool.h \
include/UpTools/UpSqlConnPool.inl
AM_LDFLAGS = --as-needed
if experimental
AM_CXXFLAGS=-O3 -ansi -D_FORTIFY_SOURCE=0 -pedantic  -std=c++0x -DUNORDERED_MAP
else
AM_CXXFLAGS=-O3 -ansi  -Wall -Wno-deprecated  -D_FORTIFY_SOURCE=0
endif
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_DEFAULT_SOURCE_EXT = .cc
LDADD = libUpTools.la
if postgresql
libUpTools_la_SOURCES += UpSqlPgsql.cc
pkginclude_HEADERS += include/UpTools/UpSqlPgsql.h \
include/UpTools/UpSqlPgsql.inl
endif
if mysql
libUpTools_la_SOURCES += UpSqlMysql.cc
pkginclude_HEADERS += include/UpTools/UpSqlMysql.h \
include/UpTools/UpSqlMysql.inl
endif
if ssl
libUpTools_la_SOURCES += UpSsl1.cc \
UpSsl2.cc \
UpSslThreadSafe.cc
pkginclude_HEADERS += include/UpTools/UpSsl.h \
include/UpTools/UpSsl.inl
endif
CLEANFILES=testUpLog
if tests
noinst_PROGRAMS=tests/testUpThreadWorkSplittable \
  tests/testUpDnsRbl \
  tests/testUpThreadSpecificPtr \
  tests/testUpSmartLinkPtr \
  tests/testUpInet \
  tests/testUpThread \
  tests/testUpResolver \
  tests/testUpResolverSimple \
  tests/testUpLine \
  tests/testUpConf \
  tests/testUpRegex \
  tests/testUpLog \
  tests/testUpSelect \
  tests/testUpTimer \
  tests/testUpSockAddr \
  tests/testUpTimeVal \
  tests/testUpSockAddrMaps \
  tests/testUpSockAddrMaps2 \
  tests/testUpCondition \
  tests/testUpSubstitute \
  tests/testNaptrAlgorithm2 \
  tests/testNaptrAlgorithm \
  tests/testUpSubstitute \
  tests/testUpThreadWorkDistributor
if postgresql
noinst_PROGRAMS += tests/testUpPgsql
if postgresql_explicit_header
AM_CPPFLAGS += -Iinclude -I/usr/include/postgresql
endif
endif
if mysql
noinst_PROGRAMS += tests/testUpMysql
endif
if ssl
noinst_PROGRAMS += tests/testUpSslServer
endif
endif
docdir = $(datadir)/doc/${PACKAGE}
dist_doc_DATA = doc/README doc/README.FEDORA doc/README.CENTOS
doc/multithreading.intro doc/intro doc/INSTALL
nodist_testsdir = $(srcdir)/tests
installcheck-local:
@echo "We will run a manual building against installed $(PACKAGE)"
@sleep 2
g++   -o  testUpLog   $(srcdir)/tests/testUpLog.cc -lUpTools
@echo
@echo  -e "You can run more tests, issuing:\n g++ -o
binary_filename tests/source_filename -l UpTools"

EOF

-- 
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -

___
http://lists.gnu.org/mailman/

Re: Problem with --as-needed flag

2010-11-23 Thread Dan Nicholson
On Tue, Nov 23, 2010 at 4:33 PM, Sergio Belkin  wrote:
> 2010/11/23 Mike Frysinger > On Tuesday, November
> 23, 2010 08:04:45 Sergio Belkin wrote:
>>> You can take a look the Makefile.am on:
>>>
>>> http://pastebin.com/jn4kiqTd
>>
>> please do not use pastebin type sites with mailing lists.  post all your info
>> into the e-mail itself.
>> -mike
>>
>
> Mike, sorry, I thought it was more polite using pastebin in order to
> shorten the mail. I bet that you  know about the topic beside
> netiquette, so Makefile.am below is:
>
> ACLOCAL_AMFLAGS= -I m4 --install
> lib_LTLIBRARIES = libUpTools.la
> libUpTools_la_SOURCES = UpLog.cc \
>        UpLine.cc \
>        UpThread.cc \
>        UpThreadWorkDistributor.cc \
>        UpInet.cc \
>        UpDnsBase.cc \
>        UpResolver.cc \
>        UpResolverSimple.cc \
>        UpDnsQuery.cc \
>        UpDnsQuerySimple.cc \
>        UpRegex.cc \
>        UpConf.cc \
>        UpLinkable.cc \
>        UpOp.cc \
>        UpTimeVal.cc \
>        UpTimerManager.cc \
>        UpSubstitute.cc \
>        UpNaptrQuery.cc \
>        UpSql.cc \
>        UpSqlConnPool.cc
> pkginclude_HEADERS = include/UpTools/ci_string.h \
>        include/UpTools/UpArch.h \
>        include/UpTools/UpBuf.h \
>        include/UpTools/UpCondition.h \
>        include/UpTools/UpConf.h \
>        include/UpTools/UpDnsBase.h \
>        include/UpTools/UpDnsBase.inl \
>        include/UpTools/UpHashMap.h \
>        include/UpTools/UpInet.h \
>        include/UpTools/UpInet.inl \
>        include/UpTools/UpLine.h \
>        include/UpTools/UpLog.h \
>        include/UpTools/UpLog.inl \
>        include/UpTools/UpNaptrQuery.h \
>        include/UpTools/UpOp.h \
>        include/UpTools/UpRegex.h \
>        include/UpTools/UpResolver.h \
>        include/UpTools/UpResolver.inl \
>        include/UpTools/UpResolverSimple.h \
>        include/UpTools/UpResolverSimple.inl \
>        include/UpTools/UpSelect.h \
>        include/UpTools/UpSmartLinkPtr.h \
>        include/UpTools/UpSmartLinkPtr.inl \
>        include/UpTools/UpSubstitute.h \
>        include/UpTools/UpThread.h \
>        include/UpTools/UpThread.inl \
>        include/UpTools/UpThreadSpecific.h \
>        include/UpTools/UpThreadSpecific.inl \
>        include/UpTools/UpThreadWorkDistributor.h \
>        include/UpTools/UpThreadWorkDistributor.inl \
>        include/UpTools/UpTimer.h \
>        include/UpTools/UpTimerManager.h \
>        include/UpTools/UpTimeVal.h \
>        include/UpTools/UpTimeVal.inl \
>        include/UpTools/UpSql.h \
>        include/UpTools/UpSql.inl \
>        include/UpTools/UpSqlConnPool.h \
>        include/UpTools/UpSqlConnPool.inl
> AM_LDFLAGS = --as-needed

Try using -Wl,--as-needed since this is a linker flag and libtool will
probably discard it otherwise.

--
Dan

___
http://lists.gnu.org/mailman/listinfo/libtool