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

FreeBSD build fixes #657

Merged
merged 4 commits into from
Nov 24, 2015
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
HAVE_OPENSSL = @HAVE_OPENSSL@
HAVE_SODIUM = @HAVE_SODIUM@
LIBCURL_LIBS = @LIBCURL_LIBS@
OPENSSL_LIBS = @OPENSSL_LIBS@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
SODIUM_LIBS = @SODIUM_LIBS@
SQLITE3_LIBS = @SQLITE3_LIBS@
bash = @bash@
bindir = @bindir@
bsddiff_compat_include = @bsddiff_compat_include@
Expand Down
4 changes: 3 additions & 1 deletion mk/lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ ifeq ($(BUILD_SHARED_LIBS), 1)
endif
ifneq ($(OS), Darwin)
ifneq ($(OS), SunOS)
GLOBAL_LDFLAGS += -Wl,--no-copy-dt-needed-entries
ifneq ($(OS), FreeBSD)
GLOBAL_LDFLAGS += -Wl,--no-copy-dt-needed-entries
endif
endif
endif
SET_RPATH_TO_LIBS ?= 1
Expand Down
5 changes: 4 additions & 1 deletion src/libexpr/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ libexpr_CXXFLAGS := -Wno-deprecated-register

libexpr_LIBS = libutil libstore libformat

libexpr_LDFLAGS = -ldl
libexpr_LDFLAGS =
ifneq ($(OS), FreeBSD)
libexpr_LDFLAGS += -ldl
endif

# The dependency on libgc must be propagated (i.e. meaning that
# programs/libraries that use libexpr must explicitly pass -lgc),
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ libstore_SOURCES := $(wildcard $(d)/*.cc)

libstore_LIBS = libutil libformat

libstore_LDFLAGS = -lsqlite3 -lbz2 -lcurl
libstore_LDFLAGS = $(SQLITE3_LIBS) -lbz2 $(LIBCURL_LIBS)

ifeq ($(OS), SunOS)
libstore_LDFLAGS += -lsocket
Expand Down
4 changes: 4 additions & 0 deletions src/nix-daemon/nix-daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,10 @@ static PeerInfo getPeerInfo(int remote)

#elif defined(LOCAL_PEERCRED)

#if !defined(SOL_LOCAL)
#define SOL_LOCAL 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

#define  SOL_LOCAL SOL_SOCKET

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that would be wrong, potentially causing the xucred structure to be filled with nonsense (see this libvirt commit). I mentioned more reasons why defining it to be 0 is right in the 7888b2b commit message.

#endif

xucred cred;
socklen_t credLen = sizeof(cred);
if (getsockopt(remote, SOL_LOCAL, LOCAL_PEERCRED, &cred, &credLen) == -1)
Expand Down