Closed Bug 118984 Opened 24 years ago Closed 4 years ago

/pr/tests/ doesn't build [needs -lsocket]

Categories

(NSPR :: NSPR, defect)

x86
Neutrino
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: timeless, Unassigned)

Details

Index: Makefile.in =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/tests/Makefile.in,v retrieving revision 1.34.2.2 diff -u -u -r1.34.2.2 Makefile.in --- Makefile.in 2001/12/26 23:24:29 1.34.2.2 +++ Makefile.in 2002/01/09 16:08:50 @@ -497,6 +497,10 @@ # The following tests call BSD socket functions, so they need to link # with -lsocket on some platforms. +ifeq ($(OS_ARCH),QNX) +EXTRA_LIBS+=-lsocket +LIBPTHREAD=$(NULL) +endif ifeq ($(OS_ARCH),SunOS) ifneq ($(OS_RELEASE),4.1.3_U1) ifeq ($(USE_IPV6),1) This fixes QNX, I think that this type of fix could/should be used by Solaris to avoid the very nasty -lsocket make stuffs in the next block of the Makefile.
I'm not going to touch the existing solaris case but the qnx patch looks fine. r=cls
There is a better way to fix this: make QNX use the nasty -lsocket block, which is currently only used by Solaris. The reason for the nasty -lsocket block may not be obvious. Let me explain. We try to build NSPR shared libraries self-contained so that if an NSPR client doesn't call any BSD socket functions directly, it doesn't need to link with -lsocket. This is achieved by linking libnspr4.so with -lsocket when we build libnspr4.so. (See mozilla/nsprpub/pr/src/Makefile.in, the definitions of OS_LIBS for various platforms.) Some of the tests do call BSD sockets directly. So I am handling them as special cases and linking them with -lsocket. The proposed patch link *all* tests with -lsocket, so we won't be testing the "self-contained" property of libnspr4.so. I have to admit that the correct fix will make the -lsocket block even nastier. :-(
the block was a disaster, i had to add nearly every single file to the block. I seem to recall having the same problem when trying to build on solaris (if i did, i gave up). if what you believe is what you believe then nearly all of your files fail this self contained property. If you insist on using a special code fragment, please make it so that I can merely move the filename into a LSOCKET=list \ so that i don't have to copy the messy block for each.
When you build libnspr4.so on QNX, do you link it with -lsocket? If QNX has the 'ldd' command, can you invoke 'ldd' on libnspr4.so and post the output there?
$ ldd sh: ldd: not found $ uname QNX
QA Contact: wtchang → nspr

The bug assignee didn't login in Bugzilla in the last 7 months.
:KaiE, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: wtc → nobody
Flags: needinfo?(kaie)
Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(kaie)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.