Skip to content

Commit

Permalink
Bug 1709654 Update for NetBSD configuration
Browse files Browse the repository at this point in the history
patch by Thomas Klausner
r=rrelyea

In the NetBSD configuration, the symbol hiding flags are not defined. This leads to conflicts when openssl and nss are linked into the same binary.
For a longer discussion on the topic, see
https://groups.google.com/a/mozilla.org/g/dev-tech-crypto/c/Al0Pt0zhARE


Match more closely to OpenBSD.mk, and in particular, hide symbols (MAPFILE).

- fix wrong value of CPU_ARCH on NetBSD/evbarm-earmv7f
- s/aarch64eb/aarch64/
  • Loading branch information
rjrelyea committed May 11, 2021
1 parent 70e7934 commit 0e96b77
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions coreconf/NetBSD.mk
Expand Up @@ -5,26 +5,25 @@

include $(CORE_DEPTH)/coreconf/UNIX.mk

DEFAULT_COMPILER = gcc
CC = gcc
CCC = g++
CC ?= gcc
CXX ?= g++
DEFAULT_COMPILER = ${CC}
CCC = ${CXX}
RANLIB = ranlib

CPU_ARCH := $(shell uname -p)
ifeq ($(CPU_ARCH),i386)
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
endif

ifndef OBJECT_FMT
OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi)
ifeq (,$(filter-out earm%,$(CPU_ARCH)))
CPU_ARCH = arm
endif
ifeq ($(CPU_ARCH),aarch64eb)
CPU_ARCH = aarch64
endif

ifeq ($(OBJECT_FMT),ELF)
DLL_SUFFIX = so
else
DLL_SUFFIX = so.1.0
endif

OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -Wno-switch -pipe -DNETBSD -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK

Expand All @@ -33,9 +32,16 @@ OS_LIBS = -lcompat
ARCH = netbsd

DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared
ifeq ($(OBJECT_FMT),ELF)
DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
DSO_LDOPTS = -shared -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)

#
# The default implementation strategy for NetBSD is pthreads.
#
ifndef CLASSIC_NSPR
USE_PTHREADS = 1
DEFINES += -D_THREAD_SAFE -D_REENTRANT
OS_LIBS += -pthread
DSO_LDOPTS += -pthread
endif

ifdef LIBRUNPATH
Expand All @@ -44,12 +50,8 @@ endif

MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $< $@


G++INCLUDES = -I/usr/include/g++
PROCESS_MAP_FILE = grep -v ';-' $< | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@

INCLUDES += -I/usr/X11R6/include

0 comments on commit 0e96b77

Please sign in to comment.