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

Makefile: fix check-libroach with linux release toolchain #26298

Merged
merged 1 commit into from
May 31, 2018
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
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,22 @@ else ifeq ($(TYPE),release-linux-gnu)
# this toolchain's libstdc++ version is quite recent and must be statically
# linked to avoid depending on the target's available libstdc++.
XHOST_TRIPLE := x86_64-unknown-linux-gnu
override LINKFLAGS += -extldflags "-static-libgcc -static-libstdc++"
override LDFLAGS = -static-libgcc -static-libstdc++
override LINKFLAGS += -extldflags "$(LDFLAGS)"
override SUFFIX := $(SUFFIX)-linux-2.6.32-gnu-amd64
BUILD_TYPE := release
else ifeq ($(TYPE),release-linux-musl)
XHOST_TRIPLE := x86_64-unknown-linux-musl
override LINKFLAGS += -extldflags "-static"
override LDFLAGS = -static
override LINKFLAGS += -extldflags "$(LDFLAGS)"
override SUFFIX := $(SUFFIX)-linux-2.6.32-musl-amd64
BUILD_TYPE := release
else ifeq ($(TYPE),release-aarch64-linux)
XGOARCH := arm64
export CGO_ENABLED := 1
XHOST_TRIPLE := aarch64-unknown-linux-gnueabi
override LINKFLAGS += -extldflags "-static-libgcc -static-libstdc++"
override LDFLAGS = -static-libgcc -static-libstdc++
override LINKFLAGS += -extldflags "$(LDFLAGS)"
override SUFFIX := $(SUFFIX)-linux-3.7.10-gnu-aarch64
BUILD_TYPE := release
else ifeq ($(TYPE),release-darwin)
Expand All @@ -174,7 +177,8 @@ XGOOS := windows
export CGO_ENABLED := 1
XHOST_TRIPLE := x86_64-w64-mingw32
override SUFFIX := $(SUFFIX)-windows-6.2-amd64
override LINKFLAGS += -extldflags "-static"
override LDFLAGS += -static
override LINKFLAGS += -extldflags "$(LDFLAGS)"
BUILD_TYPE := release
else
$(error unknown build type $(TYPE))
Expand Down
4 changes: 4 additions & 0 deletions c-deps/libroach/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ foreach(tsrc ${tests})
${SNAPPY_LIB}
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${tname} rt)
endif()

set_target_properties(${tname} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
Expand Down