Alexander.Elgert | 22 May 2012 15:18
Favicon

LDFLAGS -ld -lc not detected automatically on Solaris x86

Hello,

I compiled curl on a bunch of systems, maybe you find it useful to hear about the different options I had to set.
Please pay (only) attention to the -lc and -ldl switches.
On a solaris x86 box, the switches -lc and -ldl are needed, but not detected automatically by the configure script.
(It would be nice to have this auto-detect feature in the future).

I could not compile the version 7.25.0 on an ANCIENT AIX 4.3 machine, but the 7.24.0 did it without any problems.
I configured curl on the AIX with the following parameters:

curl-7.25.0/config.log:uname -m = 004640DA4C00
curl-7.25.0/config.log:uname -r = 3
curl-7.25.0/config.log:uname -s = AIX
curl-7.25.0/config.log:uname -v = 4
curl-7.25.0/config.log:CONFIGURE_OPTIONS='" '\''--prefix=/siux_share/ae/cc/laboru2/curl'\'' '\''--with-ssl=/siux_share/ae/cc/laboru2/curl'\''"'

if gcc -DHAVE_CONFIG_H  -I../include/curl -I../include -I../include -I../lib -I../src -I../lib
-I../src  -I/compile/curl/include -I/compile/curl/include/openssl  -g0 -O2 -Wno-system-headers 
-MT tool_operate.o -MD -MP -MF ".deps/tool_operate.Tpo" -c -o tool_operate.o tool_operate.c; \
        then mv -f ".deps/tool_operate.Tpo" ".deps/tool_operate.Po"; else rm -f ".deps/tool_operate.Tpo";
exit 1; fi
In file included from /usr/include/netinet/tcp.h:69,
                 from tool_operate.c:45:
/usr/include/netinet/ip.h:115: error: parse error before "ip_xhl"
/usr/include/netinet/ip.h:121: error: parse error before '}' token
/usr/include/netinet/ip.h:128: error: parse error before '}' token
/usr/include/netinet/ip.h:131: error: field `ip_ff' has incomplete type
/usr/include/netinet/ip.h:144: error: field `ip_src' has incomplete type
/usr/include/netinet/ip.h:144: error: field `ip_dst' has incomplete type
/usr/include/netinet/ip.h:267: error: parse error before "ipt_xcode"
(Continue reading)

Daniel Stenberg | 23 May 2012 08:58
Picon
Favicon
Gravatar

Re: LDFLAGS -ld -lc not detected automatically on Solaris x86

On Tue, 22 May 2012, Alexander.Elgert <at> t-systems.com wrote:

Thanks for your help!

> On a solaris x86 box, the switches -lc and -ldl are needed, but not detected 
> automatically by the configure script. (It would be nice to have this 
> auto-detect feature in the future).

Can you help us and clarify for which functions you need -lc and -ldl 
respectively?

> In file included from /usr/include/netinet/tcp.h:69,
>                 from tool_operate.c:45:
> /usr/include/netinet/ip.h:115: error: parse error before "ip_xhl"

Hm. curl includes netinet/tcp.h using the proper checks (from 
src/tool_operate.c), but for some reason this isn't fine in that system. Can 
you spot which other header file(s) it insists on having included before?

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Alexander.Elgert | 23 May 2012 15:37
Favicon

AW: LDFLAGS -ld -lc not detected automatically on Solaris x86

Hello,

please consult the typescripts in the attachment.

There was a warning in the configure:
=================
checking if libraries can be versioned... no
 configure: WARNING: ***
*** You need an ld version supporting the --version-script option.
====================

It seems to be the linking step against the libssl.a and libcrypto.a, which is missing the switches -lc and -ldl.

===

Please tell me, in more detail, what to do in the case for the parse error.
It is a really weird union with some ifdefs ...

/usr/include/netinet/ip.h is attached

Greetings,
Alexander Elgert

--
Deutsche Telekom AG
Seamless ICT Security Infrastructure & Management
im Auftrag T-Systems International GmbH
Dipl. Inf Alexander Elgert
Langwadener Strasse 17
64625 Bensheim
(Continue reading)

Daniel Stenberg | 24 May 2012 08:45
Picon
Favicon
Gravatar

Re: AW: LDFLAGS -ld -lc not detected automatically on Solaris x86

On Wed, 23 May 2012, Alexander.Elgert <at> t-systems.com wrote:

> There was a warning in the configure:
> =================
> checking if libraries can be versioned... no
> configure: WARNING: ***
> *** You need an ld version supporting the --version-script option.

That's fixed in git already.

> It seems to be the linking step against the libssl.a and libcrypto.a, which 
> is missing the switches -lc and -ldl.

Ah, you're using static OpenSSL libs! When using static libs, you're kind of 
on your own...

We could possibly add more logic to make it more likely to work, but it really 
isn't very easy when it comes to linking with static libraries. If anyone have 
specific suggestions, then I will listen to them!

> Please tell me, in more detail, what to do in the case for the parse error. 
> It is a really weird union with some ifdefs ...
>
> /usr/include/netinet/ip.h is attached

I was hoping _you_ would tell us what to do as I don't have that problem and I 
don't have any such system to check this out myself...

--

-- 

(Continue reading)

Petr Pisar | 24 May 2012 08:57
Picon

Re: AW: LDFLAGS -ld -lc not detected automatically on Solaris x86

On Thu, May 24, 2012 at 08:45:15AM +0200, Daniel Stenberg wrote:
> On Wed, 23 May 2012, Alexander.Elgert <at> t-systems.com wrote:
> 
> >It seems to be the linking step against the libssl.a and
> >libcrypto.a, which is missing the switches -lc and -ldl.
> 
> Ah, you're using static OpenSSL libs! When using static libs, you're
> kind of on your own...
> 
> We could possibly add more logic to make it more likely to work, but
> it really isn't very easy when it comes to linking with static
> libraries. If anyone have specific suggestions, then I will listen
> to them!
> 
Use the hated `pkg-config --static openssl'.

-- Petr
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg | 24 May 2012 09:19
Picon
Favicon
Gravatar

Re: AW: LDFLAGS -ld -lc not detected automatically on Solaris x86

On Thu, 24 May 2012, Petr Pisar wrote:

>> We could possibly add more logic to make it more likely to work, but it 
>> really isn't very easy when it comes to linking with static libraries. If 
>> anyone have specific suggestions, then I will listen to them!
>>
> Use the hated `pkg-config --static openssl'.

Perhaps yes, but that's only a little piece of the answer. When and how would 
it be used? Preferably this would be answered as a patch...

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html


Gmane