Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3135 closed bug (invalid)

gcc's link path does not contain the directory with the system libraries

Reported by: bhaible Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/pre-alpha1
Keywords: Cc: andreas.faerber@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When system functions are made available as include files, they should also be made available as libraries. In other words, if a user does not need to add particular -I options on the gcc command line in order to get a header file, he also should not have to add a particular -L option in order to get access to the directory where the library is defined. And vice versa.

<netdb.h> is in the default -I include path, but libnet.so is not in the default -L library path.

I really don't want to add absolute directory names like /boot/beos/system/lib to gnulib's autoconf macros. The alternative is to document that configure should always be invoked with option LDFLAGS="-L/boot/beos/system/lib", but this is lame as well.

I'm not sure whether it's gcc or ld which should be changed.

Attachments (1)

haiku-linkpath-bug.png (11.6 KB ) - added by bhaible 11 years ago.
screenshot of failed gcc commands

Download all attachments as: .zip

Change History (6)

by bhaible, 11 years ago

Attachment: haiku-linkpath-bug.png added

screenshot of failed gcc commands

comment:1 by andreasf, 11 years ago

Cc: andreas.faerber@… added

You shouldn't use libnet.so on Haiku in the first place. :) Or do you face the same issue for libnetwork.so?

comment:2 by bhaible, 11 years ago

do you face the same issue for libnetwork.so?

Indeed, linking with -lnetwork works fine. But I thought Haiku intented to be backwards compatible with BeOS? On BeOS, there is no libnetwork.so, only libnet.so.

comment:3 by andreasf, 11 years ago

Backwards compatible at runtime, not necessarily at compile time.

comment:4 by mmlr, 11 years ago

Resolution: invalid
Status: newclosed

Source compatibility is only kept where it makes sense. The problem with the networking libraries is that there are R5 (-lnet) and BONE versions and in BONE, the networking functions were additionally spread across different libraries (-lbind and -lsocket) which was always a bit inconvenient. Therefore Haiku has libnetwork that combines all of them (-lnet, -lbind and -lsocket). You will find that all of them are just symlinks to libnetwork under Haiku. The compatible functions are then chosen based on the originally linked to library.

comment:5 by bhaible, 11 years ago

Thanks for explaining. I'm changing gnulib to try -lnetwork before -lnet.

Note: See TracTickets for help on using tickets.