This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Tarantool -- an efficient key/value data store".
The branch master-stable has been updated
via a6c1f381f0254705bd12c2e42ab90dbcf0827982 (commit)
from f111b897671313f2db83bd8b74b344b55a199eef (commit)
Summary of changes:
CMakeLists.txt | 10 +++++++++-
core/CMakeLists.txt | 8 ++++++--
core/log_io.c | 3 ++-
core/tarantool.c | 11 +++++++++++
core/util.c | 4 ++++
include/config.h.cmake | 4 ++++
test/box/show.result | 2 +-
test/box/tarantool.cfg | 5 ++++-
test/box/tarantool_bad2.cfg | 2 +-
test/box/tarantool_bad3.cfg | 2 +-
test/box/tarantool_bad4.cfg | 2 +-
test/box/tarantool_bad5.cfg | 2 +-
test/box/tarantool_good.cfg | 2 +-
13 files changed, 46 insertions(+), 11 deletions(-)
commit a6c1f381f0254705bd12c2e42ab90dbcf0827982
Author: Konstantin Osipov <[email protected]>
Date: Mon Feb 28 17:46:37 2011 +0300
Some initial fixed to compile on FreeBSD.
Implement a number of simple fixes to compile on FreeBSD:
- work correctly with a GCC version that doesn't have
-Wno-unused-result
- compile even if not GNU libc
- tee doesn't have '--append' option on FreeBSD, use
the short version ('-a').
- fix a typo in log_io.c, ENOENT, not ENONET.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1991e2..c757d3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
project(tarantool)
include(CheckLibraryExists)
include(CheckIncludeFile)
+include(CheckCCompilerFlag)
find_program(ECHO echo)
find_program(CAT cat)
find_program(GIT git)
@@ -44,6 +45,12 @@ else()
endif()
#
+# Some versions of GNU libc define non-portable __libc_stack_end
+# which we use to determine the end (or beginning, actually) of
+# stack. Find whether or not it's present.
+check_library_exists("" __libc_stack_end "" HAVE_LIBC_STACK_END)
+
+#
# Tarantool uses 'coro' (coroutines) library # to implement
# cooperative multi-tasking. Since coro.h is included
# universally, define the underlying implementation switch
@@ -140,6 +147,7 @@ with gcc. If GNU binutils and binutils-dev libraries are
installed, backtrace
is output with resolved function (symbol) names. Otherwise only frame
addresses are printed." ${CMAKE_COMPILER_IS_GNUCC})
+set (HAVE_BFD False)
if (ENABLE_BACKTRACE)
if (NOT ${CMAKE_COMPILER_IS_GNUCC} OR
NOT (${CMAKE_SYSTEM_PROCESSOR} MATCHES "86"))
@@ -151,7 +159,7 @@ if (ENABLE_BACKTRACE)
check_library_exists (bfd bfd_init "" HAVE_BFD_LIB)
check_include_file(bfd.h HAVE_BFD_H)
if (HAVE_BFD_LIB AND HAVE_BFD_H)
- set (HAVE_BFD 1)
+ set (HAVE_BFD True)
message (STATUS "Found GNU bfd headers and libs, enabling symbol ")
message (STATUS "resolve in backtraces.")
elseif (NOT HAVE_BFD_LIB)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 7d0ef61..391c018 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -3,8 +3,12 @@
#
add_library(ev tarantool_ev.c)
-set_source_files_properties(tarantool_ev.c
- PROPERTIES COMPILE_FLAGS "-Wno-unused-result")
+check_c_compiler_flag ("-Wno-unused-result" gcc_has_wno_unused_result)
+
+if (gcc_has_wno_unused_result)
+ set_source_files_properties(tarantool_ev.c
+ PROPERTIES COMPILE_FLAGS "-Wno-unused-result")
+endif()
if (TARGET_OS_LINUX)
#
diff --git a/core/log_io.c b/core/log_io.c
index 6c5df8e..b4f4f97 100644
--- a/core/log_io.c
+++ b/core/log_io.c
@@ -596,7 +596,8 @@ inprogress_log_unlink(char *filename)
assert(strcmp(suffix, inprogress_suffix) == 0);
#endif
if (unlink(filename) != 0) {
- if (errno == ENONET)
+ /* Don't panic if there is no such file. */
+ if (errno == ENOENT)
return 0;
say_syserror("can't unlink %s", filename);
diff --git a/core/tarantool.c b/core/tarantool.c
index 6964498..67c74a2 100644
--- a/core/tarantool.c
+++ b/core/tarantool.c
@@ -313,6 +313,17 @@ main(int argc, char **argv)
#endif
const char *cfg_paramname = NULL;
+#ifndef HAVE_LIBC_STACK_END
+/*
+ * GNU libc provides a way to get at the top of the stack. This
+ * is, of course, not standard and doesn't work on non-GNU
+ * systems, such as FreeBSD. But as far as we're concerned, argv
+ * is at the top of the main thread's stack, so save the address
+ * of it.
+ */
+ __libc_stack_end = (void*) &argv;
+#endif
+
master_pid = getpid();
stat_init();
palloc_init();
diff --git a/core/util.c b/core/util.c
index d38f883..9e53cab 100644
--- a/core/util.c
+++ b/core/util.c
@@ -42,6 +42,10 @@
#include <util.h>
#include <fiber.h>
+#ifndef HAVE_LIBC_STACK_END
+void *__libc_stack_end;
+#endif
+
void
close_all_xcpt(int fdc, ...)
{
diff --git a/include/config.h.cmake b/include/config.h.cmake
index cadf475..e8cad3c 100644
--- a/include/config.h.cmake
+++ b/include/config.h.cmake
@@ -32,6 +32,10 @@
*/
#cmakedefine HAVE_BFD 1
/*
+ * Set if this is a GNU system and libc has __libc_stack_end.
+ */
+#cmakedefine HAVE_LIBC_STACK_END 1
+/*
* vim: syntax=c
*/
#endif /* TARANTOOL_CONFIG_H_INCLUDED */
diff --git a/test/box/show.result b/test/box/show.result
index 0811fbe..53f2d43 100644
--- a/test/box/show.result
+++ b/test/box/show.result
@@ -35,7 +35,7 @@ configuration:
slab_alloc_factor: "2"
work_dir: (null)
pid_file: "box.pid"
- logger: "tee --append tarantool.log"
+ logger: "tee -a tarantool.log"
logger_nonblock: "1"
io_collect_interval: "0"
backlog: "1024"
diff --git a/test/box/tarantool.cfg b/test/box/tarantool.cfg
index d7cd0fe..6743880 100644
--- a/test/box/tarantool.cfg
+++ b/test/box/tarantool.cfg
@@ -2,7 +2,10 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+
+# Use -a not -a to work correctly on FreeBSD
+#
+logger="tee -a tarantool.log"
primary_port = 33013
secondary_port = 33014
diff --git a/test/box/tarantool_bad2.cfg b/test/box/tarantool_bad2.cfg
index 0d03bfd..699a08b 100644
--- a/test/box/tarantool_bad2.cfg
+++ b/test/box/tarantool_bad2.cfg
@@ -2,7 +2,7 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+logger="tee -a tarantool.log"
#primary_port = 33013
secondary_port = 33014
diff --git a/test/box/tarantool_bad3.cfg b/test/box/tarantool_bad3.cfg
index 8c1d14c..934acbe 100644
--- a/test/box/tarantool_bad3.cfg
+++ b/test/box/tarantool_bad3.cfg
@@ -2,7 +2,7 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+logger="tee -a tarantool.log"
primary_port = 33013
secondary_port = 33014
diff --git a/test/box/tarantool_bad4.cfg b/test/box/tarantool_bad4.cfg
index 67b9c89..305de0e 100644
--- a/test/box/tarantool_bad4.cfg
+++ b/test/box/tarantool_bad4.cfg
@@ -2,7 +2,7 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+logger="tee -a tarantool.log"
primary_port = 33013
secondary_port = 33014
diff --git a/test/box/tarantool_bad5.cfg b/test/box/tarantool_bad5.cfg
index 1390839..7854bd4 100644
--- a/test/box/tarantool_bad5.cfg
+++ b/test/box/tarantool_bad5.cfg
@@ -2,7 +2,7 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+logger="tee -a tarantool.log"
primary_port = 33013
secondary_port = 33014
diff --git a/test/box/tarantool_good.cfg b/test/box/tarantool_good.cfg
index d7cd0fe..32f2c82 100644
--- a/test/box/tarantool_good.cfg
+++ b/test/box/tarantool_good.cfg
@@ -2,7 +2,7 @@ slab_alloc_arena = 0.1
pid_file = "box.pid"
-logger="tee --append tarantool.log"
+logger="tee -a tarantool.log"
primary_port = 33013
secondary_port = 33014
--
Tarantool -- an efficient key/value data store
_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help : https://help.launchpad.net/ListHelp