From 8d2d883dd12e35d30dbbbf204bbab69f2c77068c Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Thu, 6 Jul 2000 21:14:15 +0000 Subject: [PATCH] Bugzilla bug #41524: fixed build problems on NetBSD-current with ELF object format. r=taya@sm.sony.co.jp. a=brendan@mozilla.org. Modified files: NetBSD.mk, _netbsd.h, prlink.c --- nsprpub/config/NetBSD.mk | 21 ++++++++++----------- nsprpub/pr/include/md/_netbsd.h | 9 +++++++++ nsprpub/pr/src/linking/prlink.c | 3 ++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/nsprpub/config/NetBSD.mk b/nsprpub/config/NetBSD.mk index 334a81eb998..0179110c74e 100644 --- a/nsprpub/config/NetBSD.mk +++ b/nsprpub/config/NetBSD.mk @@ -41,6 +41,10 @@ CC = gcc CCC = g++ RANLIB = ranlib +ifndef OBJECT_FMT +OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi) +endif + OS_REL_CFLAGS = ifeq (86,$(findstring 86,$(OS_TEST))) CPU_ARCH = x86 @@ -60,19 +64,14 @@ endif ARCH = netbsd +ifeq ($(OBJECT_FMT),ELF) +DLL_SUFFIX = so +else DLL_SUFFIX = so.1.0 +endif -DSO_CFLAGS = -fPIC -DSO_LDOPTS = -Bshareable -ifeq ($(OS_TEST),alpha) -DSO_LDOPTS = -shared -endif -ifeq ($(OS_TEST),mips) -DSO_LDOPTS = -shared -endif -ifeq ($(OS_TEST),pmax) -DSO_LDOPTS = -shared -endif +DSO_CFLAGS = -fPIC -DPIC +DSO_LDOPTS = -x -shared ifdef LIBRUNPATH DSO_LDOPTS += -R$(LIBRUNPATH) diff --git a/nsprpub/pr/include/md/_netbsd.h b/nsprpub/pr/include/md/_netbsd.h index 10d9fad0d9d..10fa75311e1 100644 --- a/nsprpub/pr/include/md/_netbsd.h +++ b/nsprpub/pr/include/md/_netbsd.h @@ -55,7 +55,11 @@ #define _PR_SI_ARCHITECTURE "arm32" #endif +#if defined(__ELF__) +#define PR_DLL_SUFFIX ".so" +#else #define PR_DLL_SUFFIX ".so.1.0" +#endif #define _PR_VMBASE 0x30000000 #define _PR_STACK_VMBASE 0x50000000 @@ -68,6 +72,8 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_NO_LARGE_FILES #define _PR_STAT_HAS_ST_ATIMESPEC +#define _PR_POLL_AVAILABLE +#define _PR_USE_POLL #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY @@ -226,7 +232,10 @@ struct _MDCPU { * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) +#if defined(_PR_POLL_AVAILABLE) +#include #define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout) +#endif #if NetBSD1_3 == 1L typedef unsigned int nfds_t; diff --git a/nsprpub/pr/src/linking/prlink.c b/nsprpub/pr/src/linking/prlink.c index 55101ed73bc..1896a72d181 100644 --- a/nsprpub/pr/src/linking/prlink.c +++ b/nsprpub/pr/src/linking/prlink.c @@ -80,7 +80,8 @@ * On these platforms, symbols have a leading '_'. */ #if defined(SUNOS4) || defined(RHAPSODY) || defined(NEXTSTEP) \ - || defined(OPENBSD) || defined(WIN16) || defined(NETBSD) + || defined(OPENBSD) || defined(WIN16) \ + || (defined(NETBSD) && !defined(__ELF__)) #define NEED_LEADING_UNDERSCORE #endif