* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-15 6:09 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-15 6:09 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO:
1) src/box/memtx_rtree.c: In function ‘mp_decode_rect’:
src/box/memtx_rtree.c:86:24: error: ‘c’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
rect->coords[i * 2] = c;
^
src/box/memtx_rtree.c:74:10: note: ‘c’ was declared here
coord_t c;
^
2) src/box/sql/func.c: In function ‘quoteFunc’:
src/box/sql/func.c:1103:3: error: ‘b’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
sql_result_text(context, sql_value_boolean(argv[0]) ?
^
src/box/sql/vdbeapi.c:217:7: note: ‘b’ was declared here
bool b;
^
3) src/box/tuple_update.c: In function ‘update_read_ops’:
src/box/tuple_update.c:1022:4: error: ‘field_no’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
diag_set(ClientError, ER_NO_SUCH_FIELD_NO, field_no);
^
src/box/tuple_update.c:1014:11: note: ‘field_no’ was declared here
int32_t field_no;
^
4) src/httpc.c: In function ‘httpc_set_verbose’:
src/httpc.c:267:2: error: call to ‘_curl_easy_setopt_err_long’
declared with attribute warning: curl_easy_setopt expects a long
argument for this option [-Werror]
curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
^
5) src/lua/httpc.c: In function ‘luaT_httpc_request’:
src/lua/httpc.c:128:64: error: ‘MEM[(int *)&parser + 20B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 20B]’ was declared here
struct http_parser parser;
^
src/lua/httpc.c:124:64: error: ‘MEM[(int *)&parser + 16B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 16B]’ was declared here
struct http_parser parser;
^
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 3 ++-
.travis.yml | 4 ++--
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..af392e62d 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,7 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..92fb54686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,10 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..cdc832efc 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,7 +64,7 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
+ struct http_parser parser = { 0 };
parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
if (parser.hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-16 6:26 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-16 6:26 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Added CC/CXX environment to docker's container runs to set
clang for cmake.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO:
1) src/box/memtx_rtree.c: In function ‘mp_decode_rect’:
src/box/memtx_rtree.c:86:24: error: ‘c’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
rect->coords[i * 2] = c;
^
src/box/memtx_rtree.c:74:10: note: ‘c’ was declared here
coord_t c;
^
2) src/box/sql/func.c: In function ‘quoteFunc’:
src/box/sql/func.c:1103:3: error: ‘b’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
sql_result_text(context, sql_value_boolean(argv[0]) ?
^
src/box/sql/vdbeapi.c:217:7: note: ‘b’ was declared here
bool b;
^
3) src/box/tuple_update.c: In function ‘update_read_ops’:
src/box/tuple_update.c:1022:4: error: ‘field_no’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
diag_set(ClientError, ER_NO_SUCH_FIELD_NO, field_no);
^
src/box/tuple_update.c:1014:11: note: ‘field_no’ was declared here
int32_t field_no;
^
4) src/httpc.c: In function ‘httpc_set_verbose’:
src/httpc.c:267:2: error: call to ‘_curl_easy_setopt_err_long’
declared with attribute warning: curl_easy_setopt expects a long
argument for this option [-Werror]
curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
^
5) src/lua/httpc.c: In function ‘luaT_httpc_request’:
src/lua/httpc.c:128:64: error: ‘MEM[(int *)&parser + 20B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 20B]’ was declared here
struct http_parser parser;
^
src/lua/httpc.c:124:64: error: ‘MEM[(int *)&parser + 16B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 16B]’ was declared here
struct http_parser parser;
^
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 7 +++++--
.travis.yml | 4 ++--
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 34 ++++++++++++++++++----------------
7 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..55bee9980 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,9 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
+ -e CC=${CC} \
+ -e CXX=${CXX} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
@@ -37,7 +40,7 @@ deps_ubuntu:
libcurl4-openssl-dev libunwind-dev libicu-dev \
python python-pip python-setuptools python-dev \
python-msgpack python-yaml python-argparse python-six python-gevent \
- lcov ruby
+ lcov ruby clang llvm llvm-dev
test_ubuntu: deps_ubuntu
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..92fb54686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,10 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..c174ffce0 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,9 +64,10 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
- parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
- if (parser.hdr_name == NULL) {
+ struct http_parser *parser = (struct http_parser *)
+ malloc(sizeof(*parser));
+ parser->hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
+ if (parser->hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
"malloc", "hdr_name");
return -1;
@@ -75,7 +76,7 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_pushstring(L, "headers");
lua_newtable(L);
while (true) {
- int rc = http_parse_header_line(&parser, &buffer, end_buf,
+ int rc = http_parse_header_line(parser, &buffer, end_buf,
max_header_name_len);
if (rc == HTTP_PARSE_INVALID || rc == HTTP_PARSE_CONTINUE) {
continue;
@@ -84,35 +85,35 @@ parse_headers(lua_State *L, char *buffer, size_t len,
break;
}
if (rc == HTTP_PARSE_OK) {
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
/* check value of header, if exists */
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
lua_gettable(L, -3);
- int value_len = parser.hdr_value_end -
- parser.hdr_value_start;
+ int value_len = parser->hdr_value_end -
+ parser->hdr_value_start;
/* table of values to handle duplicates*/
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
} else if (lua_istable(L, -1)) {
lua_pushinteger(L, lua_objlen(L, -1) + 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
}
- /*headers[parser.header] = {value}*/
+ /*headers[parser->header] = {value}*/
lua_settable(L, -3);
}
}
- free(parser.hdr_name);
+ free(parser->hdr_name);
/* headers */
lua_settable(L, -3);
@@ -121,15 +122,16 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
+ lua_pushinteger(L, (parser->http_major > 0) ? parser->http_major: 0);
lua_settable(L, -3);
lua_pushinteger(L, 2);
- lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
+ lua_pushinteger(L, (parser->http_minor > 0) ? parser->http_minor: 0);
lua_settable(L, -3);
/* proto */
lua_settable(L, -3);
+ free(parser);
return 0;
}
/* }}}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-15 18:04 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-15 18:04 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Added CC/CXX environment to docker's container runs to set
clang for cmake.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO:
1) src/box/memtx_rtree.c: In function ‘mp_decode_rect’:
src/box/memtx_rtree.c:86:24: error: ‘c’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
rect->coords[i * 2] = c;
^
src/box/memtx_rtree.c:74:10: note: ‘c’ was declared here
coord_t c;
^
2) src/box/sql/func.c: In function ‘quoteFunc’:
src/box/sql/func.c:1103:3: error: ‘b’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
sql_result_text(context, sql_value_boolean(argv[0]) ?
^
src/box/sql/vdbeapi.c:217:7: note: ‘b’ was declared here
bool b;
^
3) src/box/tuple_update.c: In function ‘update_read_ops’:
src/box/tuple_update.c:1022:4: error: ‘field_no’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
diag_set(ClientError, ER_NO_SUCH_FIELD_NO, field_no);
^
src/box/tuple_update.c:1014:11: note: ‘field_no’ was declared here
int32_t field_no;
^
4) src/httpc.c: In function ‘httpc_set_verbose’:
src/httpc.c:267:2: error: call to ‘_curl_easy_setopt_err_long’
declared with attribute warning: curl_easy_setopt expects a long
argument for this option [-Werror]
curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
^
5) src/lua/httpc.c: In function ‘luaT_httpc_request’:
src/lua/httpc.c:128:64: error: ‘MEM[(int *)&parser + 20B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 20B]’ was declared here
struct http_parser parser;
^
src/lua/httpc.c:124:64: error: ‘MEM[(int *)&parser + 16B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 16B]’ was declared here
struct http_parser parser;
^
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 7 +++++--
.travis.yml | 4 ++--
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 34 ++++++++++++++++++----------------
7 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..f6458be4c 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,9 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
+ -e CC=${CC} \
+ -e CXX=${CXX} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
@@ -37,7 +40,7 @@ deps_ubuntu:
libcurl4-openssl-dev libunwind-dev libicu-dev \
python python-pip python-setuptools python-dev \
python-msgpack python-yaml python-argparse python-six python-gevent \
- lcov ruby
+ lcov ruby clang
test_ubuntu: deps_ubuntu
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..92fb54686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,10 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..c174ffce0 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,9 +64,10 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
- parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
- if (parser.hdr_name == NULL) {
+ struct http_parser *parser = (struct http_parser *)
+ malloc(sizeof(*parser));
+ parser->hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
+ if (parser->hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
"malloc", "hdr_name");
return -1;
@@ -75,7 +76,7 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_pushstring(L, "headers");
lua_newtable(L);
while (true) {
- int rc = http_parse_header_line(&parser, &buffer, end_buf,
+ int rc = http_parse_header_line(parser, &buffer, end_buf,
max_header_name_len);
if (rc == HTTP_PARSE_INVALID || rc == HTTP_PARSE_CONTINUE) {
continue;
@@ -84,35 +85,35 @@ parse_headers(lua_State *L, char *buffer, size_t len,
break;
}
if (rc == HTTP_PARSE_OK) {
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
/* check value of header, if exists */
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
lua_gettable(L, -3);
- int value_len = parser.hdr_value_end -
- parser.hdr_value_start;
+ int value_len = parser->hdr_value_end -
+ parser->hdr_value_start;
/* table of values to handle duplicates*/
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
} else if (lua_istable(L, -1)) {
lua_pushinteger(L, lua_objlen(L, -1) + 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
}
- /*headers[parser.header] = {value}*/
+ /*headers[parser->header] = {value}*/
lua_settable(L, -3);
}
}
- free(parser.hdr_name);
+ free(parser->hdr_name);
/* headers */
lua_settable(L, -3);
@@ -121,15 +122,16 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
+ lua_pushinteger(L, (parser->http_major > 0) ? parser->http_major: 0);
lua_settable(L, -3);
lua_pushinteger(L, 2);
- lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
+ lua_pushinteger(L, (parser->http_minor > 0) ? parser->http_minor: 0);
lua_settable(L, -3);
/* proto */
lua_settable(L, -3);
+ free(parser);
return 0;
}
/* }}}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-15 17:31 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-15 17:31 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Added CC/CXX environment to docker's container runs to set
clang for cmake.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO:
1) src/box/memtx_rtree.c: In function ‘mp_decode_rect’:
src/box/memtx_rtree.c:86:24: error: ‘c’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
rect->coords[i * 2] = c;
^
src/box/memtx_rtree.c:74:10: note: ‘c’ was declared here
coord_t c;
^
2) src/box/sql/func.c: In function ‘quoteFunc’:
src/box/sql/func.c:1103:3: error: ‘b’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
sql_result_text(context, sql_value_boolean(argv[0]) ?
^
src/box/sql/vdbeapi.c:217:7: note: ‘b’ was declared here
bool b;
^
3) src/box/tuple_update.c: In function ‘update_read_ops’:
src/box/tuple_update.c:1022:4: error: ‘field_no’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
diag_set(ClientError, ER_NO_SUCH_FIELD_NO, field_no);
^
src/box/tuple_update.c:1014:11: note: ‘field_no’ was declared here
int32_t field_no;
^
4) src/httpc.c: In function ‘httpc_set_verbose’:
src/httpc.c:267:2: error: call to ‘_curl_easy_setopt_err_long’
declared with attribute warning: curl_easy_setopt expects a long
argument for this option [-Werror]
curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
^
5) src/lua/httpc.c: In function ‘luaT_httpc_request’:
src/lua/httpc.c:128:64: error: ‘MEM[(int *)&parser + 20B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 20B]’ was declared here
struct http_parser parser;
^
src/lua/httpc.c:124:64: error: ‘MEM[(int *)&parser + 16B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 16B]’ was declared here
struct http_parser parser;
^
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 7 +++++--
.travis.yml | 10 +++++-----
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 34 ++++++++++++++++++----------------
7 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..f6458be4c 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,9 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
+ -e CC=${CC} \
+ -e CXX=${CXX} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
@@ -37,7 +40,7 @@ deps_ubuntu:
libcurl4-openssl-dev libunwind-dev libicu-dev \
python python-pip python-setuptools python-dev \
python-msgpack python-yaml python-argparse python-six python-gevent \
- lcov ruby
+ lcov ruby clang
test_ubuntu: deps_ubuntu
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..4b247b8d5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,16 +37,16 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
- if: branch = "master"
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
+ #if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
- if: branch = "master"
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
+ #if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
os: osx
env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
- if: branch = "master"
+ #if: branch = "master"
# Deploy targets (they also catch distro-specific problems).
- name: "Create and deploy tarball"
env: TARGET=source
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..c174ffce0 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,9 +64,10 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
- parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
- if (parser.hdr_name == NULL) {
+ struct http_parser *parser = (struct http_parser *)
+ malloc(sizeof(*parser));
+ parser->hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
+ if (parser->hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
"malloc", "hdr_name");
return -1;
@@ -75,7 +76,7 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_pushstring(L, "headers");
lua_newtable(L);
while (true) {
- int rc = http_parse_header_line(&parser, &buffer, end_buf,
+ int rc = http_parse_header_line(parser, &buffer, end_buf,
max_header_name_len);
if (rc == HTTP_PARSE_INVALID || rc == HTTP_PARSE_CONTINUE) {
continue;
@@ -84,35 +85,35 @@ parse_headers(lua_State *L, char *buffer, size_t len,
break;
}
if (rc == HTTP_PARSE_OK) {
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
/* check value of header, if exists */
- lua_pushlstring(L, parser.hdr_name,
- parser.hdr_name_idx);
+ lua_pushlstring(L, parser->hdr_name,
+ parser->hdr_name_idx);
lua_gettable(L, -3);
- int value_len = parser.hdr_value_end -
- parser.hdr_value_start;
+ int value_len = parser->hdr_value_end -
+ parser->hdr_value_start;
/* table of values to handle duplicates*/
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
} else if (lua_istable(L, -1)) {
lua_pushinteger(L, lua_objlen(L, -1) + 1);
- lua_pushlstring(L, parser.hdr_value_start,
+ lua_pushlstring(L, parser->hdr_value_start,
value_len);
lua_settable(L, -3);
}
- /*headers[parser.header] = {value}*/
+ /*headers[parser->header] = {value}*/
lua_settable(L, -3);
}
}
- free(parser.hdr_name);
+ free(parser->hdr_name);
/* headers */
lua_settable(L, -3);
@@ -121,15 +122,16 @@ parse_headers(lua_State *L, char *buffer, size_t len,
lua_newtable(L);
lua_pushinteger(L, 1);
- lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
+ lua_pushinteger(L, (parser->http_major > 0) ? parser->http_major: 0);
lua_settable(L, -3);
lua_pushinteger(L, 2);
- lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
+ lua_pushinteger(L, (parser->http_minor > 0) ? parser->http_minor: 0);
lua_settable(L, -3);
/* proto */
lua_settable(L, -3);
+ free(parser);
return 0;
}
/* }}}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-15 12:44 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-15 12:44 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Added CC/CXX environment to docker's container runs to set
clang for cmake.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO:
1) src/box/memtx_rtree.c: In function ‘mp_decode_rect’:
src/box/memtx_rtree.c:86:24: error: ‘c’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
rect->coords[i * 2] = c;
^
src/box/memtx_rtree.c:74:10: note: ‘c’ was declared here
coord_t c;
^
2) src/box/sql/func.c: In function ‘quoteFunc’:
src/box/sql/func.c:1103:3: error: ‘b’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
sql_result_text(context, sql_value_boolean(argv[0]) ?
^
src/box/sql/vdbeapi.c:217:7: note: ‘b’ was declared here
bool b;
^
3) src/box/tuple_update.c: In function ‘update_read_ops’:
src/box/tuple_update.c:1022:4: error: ‘field_no’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
diag_set(ClientError, ER_NO_SUCH_FIELD_NO, field_no);
^
src/box/tuple_update.c:1014:11: note: ‘field_no’ was declared here
int32_t field_no;
^
4) src/httpc.c: In function ‘httpc_set_verbose’:
src/httpc.c:267:2: error: call to ‘_curl_easy_setopt_err_long’
declared with attribute warning: curl_easy_setopt expects a long
argument for this option [-Werror]
curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
^
5) src/lua/httpc.c: In function ‘luaT_httpc_request’:
src/lua/httpc.c:128:64: error: ‘MEM[(int *)&parser + 20B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_minor > 0) ? parser.http_minor: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 20B]’ was declared here
struct http_parser parser;
^
src/lua/httpc.c:124:64: error: ‘MEM[(int *)&parser + 16B]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
lua_pushinteger(L, (parser.http_major > 0) ? parser.http_major: 0);
^
src/lua/httpc.c:67:21: note: ‘MEM[(int *)&parser + 16B]’ was declared here
struct http_parser parser;
^
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 5 ++++-
.travis.yml | 4 ++--
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 2 +-
7 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..c6af08803 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,9 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
+ -e CC=${CC} \
+ -e CXX=${CXX} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..92fb54686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,10 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..cdc832efc 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,7 +64,7 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
+ struct http_parser parser = { 0 };
parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
if (parser.hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v1] Fix LTO in travis-ci
@ 2019-05-14 19:33 Alexander V. Tikhonov
0 siblings, 0 replies; 6+ messages in thread
From: Alexander V. Tikhonov @ 2019-05-14 19:33 UTC (permalink / raw)
To: Alexander Turenko; +Cc: Alexander V. Tikhonov, tarantool-patches
Made fixes:
- Added CMAKE_EXTRA_PARAMS environment to docker's container
runs to enable -DENABLE_LTO=ON/OFF cmake option.
- Changed LTO docker's image to 'debian-buster' due to LTO needed
higher versions of packages, check for more information commit:
commit f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date: Thu Mar 22 11:37:06 2018 +0300
- Fixed sources to avoid of failures on builds with LTO.
Close #4215
---
Github: https://github.com/tarantool/tarantool/compare/avtikhon/lto-build-fix
Issue: https://github.com/tarantool/tarantool/issues/4215
.travis.mk | 3 ++-
.travis.yml | 4 ++--
src/box/memtx_rtree.c | 2 +-
src/box/sql/vdbeapi.c | 2 +-
src/box/tuple_update.c | 2 +-
src/httpc.c | 2 +-
src/lua/httpc.c | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/.travis.mk b/.travis.mk
index 4ac3fc11a..af392e62d 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -2,7 +2,7 @@
# Travis CI rules
#
-DOCKER_IMAGE:=packpack/packpack:debian-stretch
+DOCKER_IMAGE?=packpack/packpack:debian-stretch
all: package
@@ -27,6 +27,7 @@ docker_%:
-e CCACHE_DIR=/cache/ccache \
-e COVERALLS_TOKEN=${COVERALLS_TOKEN} \
-e TRAVIS_JOB_ID=${TRAVIS_JOB_ID} \
+ -e CMAKE_EXTRA_PARAMS=${CMAKE_EXTRA_PARAMS} \
${DOCKER_IMAGE} \
make -f .travis.mk $(subst docker_,,$@)
diff --git a/.travis.yml b/.travis.yml
index 6e79cf2fe..92fb54686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,10 @@ jobs:
if: branch = "master"
# Special targets (only LTO for now).
- name: "LTO build + test (Linux, gcc)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
- name: "LTO build + test (Linux, clang)"
- env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON
+ env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON DOCKER_IMAGE=packpack/packpack:debian-buster
if: branch = "master"
compiler: clang
- name: "LTO build + test (OS X Mojave 10.14)"
diff --git a/src/box/memtx_rtree.c b/src/box/memtx_rtree.c
index 45e8fb8e3..b91a405d7 100644
--- a/src/box/memtx_rtree.c
+++ b/src/box/memtx_rtree.c
@@ -71,7 +71,7 @@ static inline int
mp_decode_rect(struct rtree_rect *rect, unsigned dimension,
const char *mp, unsigned count, const char *what)
{
- coord_t c;
+ coord_t c = 0;
if (count == dimension) { /* point */
for (unsigned i = 0; i < dimension; i++) {
if (mp_decode_num(&mp, i, &c) < 0)
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index d2868567b..04083914a 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -214,7 +214,7 @@ sql_value_double(sql_value * pVal)
bool
sql_value_boolean(sql_value *val)
{
- bool b;
+ bool b = false;
mem_value_bool((struct Mem *) val, &b);
return b;
}
diff --git a/src/box/tuple_update.c b/src/box/tuple_update.c
index 849073258..7a203ced8 100644
--- a/src/box/tuple_update.c
+++ b/src/box/tuple_update.c
@@ -1011,7 +1011,7 @@ update_read_ops(struct tuple_update *update, const char *expr,
"field id must be a number");
return -1;
}
- int32_t field_no;
+ int32_t field_no = 0;
if (mp_read_i32(update->index_base, op, &expr, &field_no))
return -1;
if (field_no - update->index_base >= 0) {
diff --git a/src/httpc.c b/src/httpc.c
index 80dabd59c..813a3e387 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -267,7 +267,7 @@ httpc_set_low_speed_limit(struct httpc_request *req, long low_speed_limit)
void
httpc_set_verbose(struct httpc_request *req, bool curl_verbose)
{
- curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, curl_verbose);
+ curl_easy_setopt(req->curl_request.easy, CURLOPT_VERBOSE, (long) curl_verbose);
}
void
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index c39a2f0de..cdc832efc 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -64,7 +64,7 @@ static int
parse_headers(lua_State *L, char *buffer, size_t len,
int max_header_name_len)
{
- struct http_parser parser;
+ struct http_parser parser = { 0 };
parser.hdr_name = (char *) calloc(max_header_name_len, sizeof(char));
if (parser.hdr_name == NULL) {
diag_set(OutOfMemory, max_header_name_len * sizeof(char),
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-16 6:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 6:09 [tarantool-patches] [PATCH v1] Fix LTO in travis-ci Alexander V. Tikhonov
-- strict thread matches above, loose matches on Subject: below --
2019-05-16 6:26 Alexander V. Tikhonov
2019-05-15 18:04 Alexander V. Tikhonov
2019-05-15 17:31 Alexander V. Tikhonov
2019-05-15 12:44 Alexander V. Tikhonov
2019-05-14 19:33 Alexander V. Tikhonov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox