| Index: ports/libgit2/nacl.patch
|
| diff --git a/ports/libgit2/nacl.patch b/ports/libgit2/nacl.patch
|
| index 01e516e9802493b6ce97219fdecc91a58ade4693..13387b78e4002c24a5558431ffdcf905045ae301 100644
|
| --- a/ports/libgit2/nacl.patch
|
| +++ b/ports/libgit2/nacl.patch
|
| @@ -1,36 +1,32 @@
|
| diff --git a/CMakeLists.txt b/CMakeLists.txt
|
| -index ac1032a..a238fbb 100644
|
| +index 6f1a97e..664d3f4 100644
|
| --- a/CMakeLists.txt
|
| +++ b/CMakeLists.txt
|
| -@@ -72,14 +72,21 @@ SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.")
|
| - SET(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.")
|
| -
|
| - FUNCTION(TARGET_OS_LIBRARIES target)
|
| -+ MESSAGE(">>>>>>> Libc = $ENV{NACL_LIBC}")
|
| -+
|
| - IF(WIN32)
|
| - TARGET_LINK_LIBRARIES(${target} ws2_32)
|
| - ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
| - TARGET_LINK_LIBRARIES(${target} socket nsl)
|
| - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lsocket -lnsl" PARENT_SCOPE)
|
| - ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
| -- TARGET_LINK_LIBRARIES(${target} rt)
|
| -- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
|
| -+ IF($ENV{NACL_LIBC} STREQUAL "newlib")
|
| -+ TARGET_LINK_LIBRARIES(${target} glibc-compat)
|
| -+ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lglibc-compat" PARENT_SCOPE)
|
| -+ ELSE()
|
| -+ TARGET_LINK_LIBRARIES(${target} rt)
|
| -+ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
|
| -+ ENDIF()
|
| +@@ -91,6 +91,10 @@ FUNCTION(TARGET_OS_LIBRARIES target)
|
| + TARGET_LINK_LIBRARIES(${target} rt)
|
| + SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
|
| ENDIF()
|
| ++ IF("$ENV{NACL_LIBC}" STREQUAL "newlib")
|
| ++ TARGET_LINK_LIBRARIES(${target} glibc-compat)
|
| ++ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lglibc-compat" PARENT_SCOPE)
|
| ++ ENDIF()
|
|
|
| - IF(USE_ICONV)
|
| + IF(THREADSAFE)
|
| + TARGET_LINK_LIBRARIES(${target} ${CMAKE_THREAD_LIBS_INIT})
|
| +@@ -364,6 +368,8 @@ FILE(GLOB SRC_H include/git2.h include/git2/*.h include/git2/sys/*.h)
|
| + IF (WIN32 AND NOT CYGWIN)
|
| + ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0501)
|
| + FILE(GLOB SRC_OS src/win32/*.c src/win32/*.h)
|
| ++ELSEIF (NACL)
|
| ++ ADD_DEFINITIONS(-DNO_MMAP)
|
| + ELSEIF (AMIGA)
|
| + ADD_DEFINITIONS(-DNO_ADDRINFO -DNO_READDIR_R -DNO_MMAP)
|
| + ELSE()
|
| diff --git a/src/pool.c b/src/pool.c
|
| -index d484769..287e08e 100644
|
| +index a516ff9..b1c2bfe 100644
|
| --- a/src/pool.c
|
| +++ b/src/pool.c
|
| -@@ -313,7 +313,7 @@ uint32_t git_pool__system_page_size(void)
|
| +@@ -312,7 +312,7 @@ uint32_t git_pool__system_page_size(void)
|
| #elif defined(__amigaos4__)
|
| size = (uint32_t)4096; /* 4K as there is no global value we can query */
|
| #else
|
| @@ -39,25 +35,39 @@ index d484769..287e08e 100644
|
| #endif
|
|
|
| size -= 2 * sizeof(void *); /* allow space for malloc overhead */
|
| -diff --git a/tests/blame/buffer.c b/tests/blame/buffer.c
|
| -index 912ee98..340b1dc 100644
|
| ---- a/tests/blame/buffer.c
|
| -+++ b/tests/blame/buffer.c
|
| -@@ -1,7 +1,7 @@
|
| - #include "blame_helpers.h"
|
| -
|
| --git_repository *g_repo;
|
| --git_blame *g_fileblame, *g_bufferblame;
|
| -+static git_repository *g_repo;
|
| -+static git_blame *g_fileblame, *g_bufferblame;
|
| +diff --git a/src/posix.h b/src/posix.h
|
| +index 965cd98..eb93cde 100644
|
| +--- a/src/posix.h
|
| ++++ b/src/posix.h
|
| +@@ -12,6 +12,10 @@
|
| + #include <time.h>
|
| + #include "fnmatch.h"
|
|
|
| - void test_blame_buffer__initialize(void)
|
| ++#if defined(__native_client__) && defined(_NEWLIB_VERSION)
|
| ++mode_t umask(mode_t cmask);
|
| ++#endif
|
| ++
|
| + #ifndef S_IFGITLINK
|
| + #define S_IFGITLINK 0160000
|
| + #define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
|
| +diff --git a/tests/clar.c b/tests/clar.c
|
| +index 1546447..839f7f3 100644
|
| +--- a/tests/clar.c
|
| ++++ b/tests/clar.c
|
| +@@ -222,7 +222,7 @@ static void
|
| + clar_run_suite(const struct clar_suite *suite, const char *filter)
|
| {
|
| + const struct clar_func *test = suite->tests;
|
| +- size_t i, matchlen;
|
| ++ size_t i, matchlen = 0;
|
| +
|
| + if (!suite->enabled)
|
| + return;
|
| diff --git a/tests/clar/fs.h b/tests/clar/fs.h
|
| -index b7a1ff9..1d508a3 100644
|
| +index 7c7dde6..e37aec1 100644
|
| --- a/tests/clar/fs.h
|
| +++ b/tests/clar/fs.h
|
| -@@ -250,7 +250,250 @@ cl_fs_cleanup(void)
|
| +@@ -250,6 +250,249 @@ cl_fs_cleanup(void)
|
| fs_rm(fixture_path(_clar_path, "*"));
|
| }
|
|
|
| @@ -133,6 +143,7 @@ index b7a1ff9..1d508a3 100644
|
| + const size_t buffer_size = 8192;
|
| + char buffer[buffer_size];
|
| + int result = 1;
|
| ++ FILE* dst_file = NULL;
|
| +
|
| + FILE* src_file = fopen(source, "r");
|
| + if (src_file == NULL) {
|
| @@ -141,7 +152,7 @@ index b7a1ff9..1d508a3 100644
|
| + goto error;
|
| + }
|
| +
|
| -+ FILE* dst_file = fopen(dest, "w");
|
| ++ dst_file = fopen(dest, "w");
|
| + if (dst_file == NULL) {
|
| + fprintf(stderr, "Error opening file %s for writing: %s\n",
|
| + dest, strerror(errno));
|
| @@ -271,7 +282,7 @@ index b7a1ff9..1d508a3 100644
|
| +
|
| +static int fs_rm_helper(const char* source) {
|
| + struct stat statbuf;
|
| -+ if (stat(source, &statbuf) != 0) {
|
| ++ if (lstat(source, &statbuf) != 0) {
|
| + fprintf(stderr, "Error stat'ing file %s: %s\n", source, strerror(errno));
|
| + return 0;
|
| + }
|
| @@ -304,20 +315,81 @@ index b7a1ff9..1d508a3 100644
|
| +}
|
| +
|
| #else
|
| -+
|
| - static int
|
| - shell_out(char * const argv[])
|
| +
|
| + #include <errno.h>
|
| +diff --git a/tests/clar/sandbox.h b/tests/clar/sandbox.h
|
| +index a44e291..a6aea62 100644
|
| +--- a/tests/clar/sandbox.h
|
| ++++ b/tests/clar/sandbox.h
|
| +@@ -110,8 +110,21 @@ static int build_sandbox_path(void)
|
| + return -1;
|
| + #else
|
| + if (mkdtemp(_clar_path) == NULL)
|
| ++#if defined(__native_client__)
|
| ++ {
|
| ++ // Under sel_ldr mkdtemp currently always fails. For now
|
| ++ // fake it.
|
| ++ struct stat buf;
|
| ++ strcpy(_clar_path + strlen(_clar_path) - 6, "123456");
|
| ++ if (stat(_clar_path, &buf) == 0)
|
| ++ fs_rm(_clar_path);
|
| ++ if (mkdir(_clar_path, 0700) != 0)
|
| ++ return -1;
|
| ++ }
|
| ++#else
|
| + return -1;
|
| + #endif
|
| ++#endif
|
| +
|
| + return 0;
|
| + }
|
| +diff --git a/tests/commit/parse.c b/tests/commit/parse.c
|
| +index 41e1624..f27bada 100644
|
| +--- a/tests/commit/parse.c
|
| ++++ b/tests/commit/parse.c
|
| +@@ -119,8 +119,8 @@ passing_signature_test_case passing_signature_cases[] = {
|
| + {"author Vicent Marti <tanoku@gmail.com> 1234567890 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 1234567890, 0},
|
| + {"author Vicent Marti <tanoku@gmail.com> 2147483647 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0x7fffffff, 0},
|
| + {"author Vicent Marti <tanoku@gmail.com> 4294967295 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0xffffffff, 0},
|
| +- {"author Vicent Marti <tanoku@gmail.com> 4294967296 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 4294967296, 0},
|
| +- {"author Vicent Marti <tanoku@gmail.com> 8589934592 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 8589934592, 0},
|
| ++ {"author Vicent Marti <tanoku@gmail.com> 4294967296 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 4294967296ll, 0},
|
| ++ {"author Vicent Marti <tanoku@gmail.com> 8589934592 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 8589934592ll, 0},
|
| +
|
| + {NULL,NULL,NULL,NULL,0,0}
|
| + };
|
| +diff --git a/tests/config/read.c b/tests/config/read.c
|
| +index 2567272..2db4b3d 100644
|
| +--- a/tests/config/read.c
|
| ++++ b/tests/config/read.c
|
| +@@ -477,7 +477,7 @@ void test_config_read__simple_read_from_specific_level(void)
|
| {
|
| -diff --git a/tests/index/addall.c b/tests/index/addall.c
|
| -index 44c5127..abc84b2 100644
|
| ---- a/tests/index/addall.c
|
| -+++ b/tests/index/addall.c
|
| -@@ -3,7 +3,7 @@
|
| - #include "posix.h"
|
| - #include "fileops.h"
|
| + git_config *cfg, *cfg_specific;
|
| + int i;
|
| +- int64_t l, expected = +9223372036854775803;
|
| ++ int64_t l, expected = +9223372036854775803ll;
|
| + const char *s;
|
|
|
| --git_repository *g_repo = NULL;
|
| -+static git_repository *g_repo = NULL;
|
| + cl_git_pass(git_config_new(&cfg));
|
| +diff --git a/tests/config/write.c b/tests/config/write.c
|
| +index 0f11ae8..675f7f4 100644
|
| +--- a/tests/config/write.c
|
| ++++ b/tests/config/write.c
|
| +@@ -18,7 +18,7 @@ void test_config_write__replace_value(void)
|
| + {
|
| + git_config *cfg;
|
| + int i;
|
| +- int64_t l, expected = +9223372036854775803;
|
| ++ int64_t l, expected = +9223372036854775803ll;
|
|
|
| - void test_index_addall__initialize(void)
|
| + /* By freeing the config, we make sure we flush the values */
|
| + cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
|
| +@@ -179,7 +179,7 @@ void test_config_write__add_value_at_specific_level(void)
|
| {
|
| + git_config *cfg, *cfg_specific;
|
| + int i;
|
| +- int64_t l, expected = +9223372036854775803;
|
| ++ int64_t l, expected = +9223372036854775803ll;
|
| + const char *s;
|
| +
|
| + // open config15 as global level config file
|
|
|