From af6e865a076af031213f9afc488c28306d6bc3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 15 Apr 2013 20:36:56 +0200 Subject: [PATCH 1/4] test: fix process_title failing on linux Shorten the test string from 40 to 38 characters because the title length is limited to 39 characters. Truncation of long titles was introduced intentionally by commit a0c1d84 (see discussion in joyent/node#5006). --- test/test-process-title.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-process-title.c b/test/test-process-title.c index 13d9dddfc..5bf5db9fa 100644 --- a/test/test-process-title.c +++ b/test/test-process-title.c @@ -43,7 +43,7 @@ static void set_title(const char* title) { TEST_IMPL(process_title) { /* Check for format string vulnerabilities. */ - set_title("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"); + set_title("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"); set_title("new title"); return 0; } From fe2a3150c0244759154c4cc472af12eca79df8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 15 Apr 2013 21:03:05 +0200 Subject: [PATCH 2/4] test: add error logging to tty unit test --- test/test-tty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test-tty.c b/test/test-tty.c index eb5d5df52..f3003efa6 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -30,6 +30,9 @@ # include #endif +#include +#include + TEST_IMPL(tty) { int r, width, height; @@ -62,7 +65,12 @@ TEST_IMPL(tty) { #else /* unix */ ttyin_fd = open("/dev/tty", O_RDONLY, 0); + if (ttyin_fd < 0) + LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno)); + ttyout_fd = open("/dev/tty", O_WRONLY, 0); + if (ttyout_fd < 0) + LOGF("Cannot open /dev/tty as write-only: %s\n", strerror(errno)); #endif ASSERT(ttyin_fd >= 0); From 96a2df80846af3769f6c0d432cae2c5963c51e2e Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 11 May 2013 14:48:52 -0700 Subject: [PATCH 3/4] build: convert predefined $PLATFORM to lower case --- build.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.mk b/build.mk index 61a9f4af8..ee01de7d8 100644 --- a/build.mk +++ b/build.mk @@ -18,7 +18,11 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') +ifdef PLATFORM +override PLATFORM := $(shell echo $(PLATFORM) | tr "[A-Z]" "[a-z]") +else +PLATFORM = $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') +endif CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private From 3eb6eb35ccf1aedbd2297c98b73df3cb81215e3a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 12 May 2013 14:48:58 +0200 Subject: [PATCH 4/4] build: set soname in shared library --- config-unix.mk | 5 +++++ src/version.c | 4 +++- uv.gyp | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config-unix.mk b/config-unix.mk index 2ab534f40..90798760c 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -151,6 +151,11 @@ CPPFLAGS += -Isrc/unix CFLAGS += -DHAVE_DTRACE endif +ifneq (darwin,$(PLATFORM)) +# Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR in src/version.c +LDFLAGS += -Wl,-soname,libuv.so.0.10 +endif + libuv.a: $(OBJS) $(AR) rcs $@ $^ diff --git a/src/version.c b/src/version.c index 6ee0cc934..5dbc3625e 100644 --- a/src/version.c +++ b/src/version.c @@ -24,7 +24,9 @@ /* * Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI * stable. When the minor version is odd, the API can change between patch - * releases. + * releases. Make sure you update the -soname directives in config-unix.mk + * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but + * not UV_VERSION_PATCH.) */ #undef UV_VERSION_MAJOR /* TODO(bnoordhuis) Remove in v0.11. */ diff --git a/uv.gyp b/uv.gyp index 0effb9211..54c771ee3 100644 --- a/uv.gyp +++ b/uv.gyp @@ -164,9 +164,16 @@ ], }, 'conditions': [ - ['"<(library)" == "shared_library"', { + ['library=="shared_library"', { 'cflags': [ '-fPIC' ], }], + ['library=="shared_library" and OS!="mac"', { + 'link_settings': { + # Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR + # in src/version.c + 'libraries': [ '-Wl,-soname,libuv.so.0.10' ], + }, + }], ], }], [ 'OS=="linux" or OS=="mac"', {