From cd8f31759fd04b9ce9c903fa00cae81dc5bba546 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Fri, 16 Jan 2015 23:51:04 -0800 Subject: bitrig integration --- src/libstd/sys/common/net.rs | 3 ++- src/libstd/sys/common/stack.rs | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys/common') diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 7325e0a5ac8..aa0883e097e 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -689,7 +689,8 @@ impl TcpStream { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, seconds as libc::c_int) } - #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly"))] fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, seconds as libc::c_int) diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs index 8dd2f154fa8..bc4ea662318 100644 --- a/src/libstd/sys/common/stack.rs +++ b/src/libstd/sys/common/stack.rs @@ -189,11 +189,18 @@ pub unsafe fn record_sp_limit(limit: uint) { unsafe fn target_record_sp_limit(limit: uint) { asm!("movq $0, %fs:24" :: "r"(limit) :: "volatile") } - #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] + #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] + #[inline(always)] unsafe fn target_record_sp_limit(limit: uint) { asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile") } + #[cfg(target_os = "bitrig")] + #[inline(always)] + unsafe fn target_record_sp_limit(_: uint) { + // segmented stacks are disabled + } + // x86 #[cfg(all(target_arch = "x86", any(target_os = "macos", target_os = "ios")))] @@ -276,12 +283,18 @@ pub unsafe fn get_sp_limit() -> uint { asm!("movq %fs:24, $0" : "=r"(limit) ::: "volatile"); return limit; } - #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] + #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] + #[inline(always)] unsafe fn target_get_sp_limit() -> uint { let limit; asm!("movq %fs:32, $0" : "=r"(limit) ::: "volatile"); return limit; } + #[cfg(target_os = "bitrig")] + #[inline(always)] + unsafe fn target_get_sp_limit() -> uint { + return 2048; + } // x86 -- cgit 1.4.1-3-g733a5 From 2ece7a6831ed3cc034ff0526236c68d92b1b7510 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Thu, 5 Feb 2015 11:34:59 -0800 Subject: PR review fixes --- mk/platform.mk | 18 +++++++++--------- src/libstd/sys/common/stack.rs | 14 ++------------ 2 files changed, 11 insertions(+), 21 deletions(-) (limited to 'src/libstd/sys/common') diff --git a/mk/platform.mk b/mk/platform.mk index 3b172e87bda..ed50585822e 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -144,14 +144,14 @@ FIND_COMPILER = $(word 1,$(1:ccache=)) define CFG_MAKE_TOOLCHAIN # Prepend the tools with their prefix if cross compiling ifneq ($(CFG_BUILD),$(1)) - CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1)) - CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1)) - CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1)) - AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1)) - RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(1))) \ - -C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1)) - - RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1)) + CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1)) + CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1)) + CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1)) + AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1)) + RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(1))) \ + -C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1)) + + RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1)) endif CFG_COMPILE_C_$(1) = $$(CC_$(1)) \ @@ -200,7 +200,7 @@ define CFG_MAKE_TOOLCHAIN # For the ARM, AARCH64, MIPS and POWER crosses, use the toolchain assembler # FIXME: We should be able to use the LLVM assembler CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \ - $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1) + $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1) endif diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs index bc4ea662318..5ebc851e194 100644 --- a/src/libstd/sys/common/stack.rs +++ b/src/libstd/sys/common/stack.rs @@ -195,12 +195,6 @@ pub unsafe fn record_sp_limit(limit: uint) { asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile") } - #[cfg(target_os = "bitrig")] - #[inline(always)] - unsafe fn target_record_sp_limit(_: uint) { - // segmented stacks are disabled - } - // x86 #[cfg(all(target_arch = "x86", any(target_os = "macos", target_os = "ios")))] @@ -240,6 +234,7 @@ pub unsafe fn record_sp_limit(limit: uint) { #[cfg(any(target_arch = "aarch64", target_arch = "powerpc", all(target_arch = "arm", target_os = "ios"), + target_os = "bitrig", target_os = "openbsd"))] unsafe fn target_record_sp_limit(_: uint) { } @@ -290,12 +285,6 @@ pub unsafe fn get_sp_limit() -> uint { asm!("movq %fs:32, $0" : "=r"(limit) ::: "volatile"); return limit; } - #[cfg(target_os = "bitrig")] - #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { - return 2048; - } - // x86 #[cfg(all(target_arch = "x86", @@ -344,6 +333,7 @@ pub unsafe fn get_sp_limit() -> uint { #[cfg(any(target_arch = "aarch64", target_arch = "powerpc", all(target_arch = "arm", target_os = "ios"), + target_os = "bitrig", target_os = "openbsd"))] #[inline(always)] unsafe fn target_get_sp_limit() -> uint { -- cgit 1.4.1-3-g733a5