Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetBSD port proposal #62

Merged
merged 1 commit into from Jul 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/common/fred.h
Expand Up @@ -74,7 +74,7 @@ class Fred {
#if defined(_WIN32)
#elif defined(__SVR4)
thr_setconcurrency (n);
#else
#elif !defined(__NetBSD__)
pthread_setconcurrency (n);
#endif
}
Expand Down
9 changes: 8 additions & 1 deletion src/GNUmakefile
Expand Up @@ -2,6 +2,7 @@
# Run make (with no arguments) to see the complete target list.

CPPFLAGS = -std=c++14 -flto -O3 -DNDEBUG -ffast-math -fno-builtin-malloc -Wall -Wextra -Wshadow -Wconversion -Wuninitialized # -DHL_NO_MALLOC_SIZE_CHECKS=1
CPPFLAGS_NOLTO = -std=c++14 -O3 -DNDEBUG -ffast-math -fno-builtin-malloc -Wall -Wextra -Wshadow -Wconversion -Wuninitialized # -DHL_NO_MALLOC_SIZE_CHECKS=1
#CPPFLAGS = -std=c++14 -g -O0 -ffast-math -fno-builtin-malloc -Wall -Wextra -Wshadow -Wconversion -Wuninitialized
CXX = clang++

Expand Down Expand Up @@ -40,6 +41,7 @@ help:
@echo -------------------------------------------------
@echo debian
@echo freebsd
@echo netbsd
@echo Linux-gcc-arm
@echo Linux-gcc-aarch64
@echo Linux-gcc-x86
Expand All @@ -54,7 +56,7 @@ help:
@echo generic-gcc
@echo windows

.PHONY: Darwin-gcc-i386 Darwin-gcc-arm debian freebsd Linux-gcc-x86 Linux-gcc-x86-debug SunOS-sunw-sparc SunOS-sunw-i386 SunOS-gcc-sparc generic-gcc Linux-gcc-arm Linux-gcc-aarch64 Linux-gcc-x86_64 Linux-gcc-unknown windows windows-debug clean test release
.PHONY: Darwin-gcc-i386 Darwin-gcc-arm debian freebsd netbsd Linux-gcc-x86 Linux-gcc-x86-debug SunOS-sunw-sparc SunOS-sunw-i386 SunOS-gcc-sparc generic-gcc Linux-gcc-arm Linux-gcc-aarch64 Linux-gcc-x86_64 Linux-gcc-unknown windows windows-debug clean test release

#
# Source files
Expand Down Expand Up @@ -93,6 +95,8 @@ WIN_INCLUDES = /I. /Iinclude /Iinclude/util /Iinclude/hoard /Iinclude/superblock

FREEBSD_COMPILE = $(CXX) -g $(CPPFLAGS) -DNDEBUG -fPIC $(INCLUDES) -D_REENTRANT=1 -shared $(SUNW_SRC) -Bsymbolic -o libhoard.so -lpthread

NETBSD_COMPILE = $(CXX) -g $(CPPFLAGS_NOLTO) -DNDEBUG -fPIC $(INCLUDES) -D_REENTRANT=1 -shared $(SUNW_SRC) -Bsymbolic -o libhoard.so -lpthread

DEBIAN_COMPILE = $(CXX) -g -O3 -fPIC -DNDEBUG -I. -Iinclude -Iinclude/util -Iinclude/hoard -Iinclude/superblocks -IHeap-Layers -D_REENTRANT=1 -shared source/libhoard.cpp source/unixtls.cpp Heap-Layers/wrappers/wrapper.cpp -Bsymbolic -o libhoard.so -lpthread -lstdc++ -ldl

# -ftls-model=local-dynamic
Expand Down Expand Up @@ -272,6 +276,9 @@ SunOS-sunw-sparc-debug:
freebsd:
$(FREEBSD_COMPILE)

netbsd:
$(NETBSD_COMPILE)

debian:
$(DEBIAN_COMPILE)

Expand Down
4 changes: 2 additions & 2 deletions src/source/unixtls.cpp
Expand Up @@ -48,7 +48,7 @@
#include <pthread.h>
#endif

#if defined(__SVR4) || defined(__FreeBSD__)
#if defined(__SVR4) || defined(__FreeBSD__) || defined(__NetBSD__)
#include <dlfcn.h>
#endif

Expand Down Expand Up @@ -352,7 +352,7 @@ extern "C" int pthread_create (pthread_t *thread,
const pthread_attr_t *attr,
void * (*start_routine)(void *),
void * arg)
#if !defined(__SUNPRO_CC) && !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__SUNPRO_CC) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
throw ()
#endif
{
Expand Down