Discussion:
[oi-dev] build issue in percona-server-57
Rich Reynolds
2018-11-05 21:32:01 UTC
Permalink
[ 32%] Building CXX object sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o
/codebase/oi-userland/components/database/percona-server-57/percona-server-5.7.22-22/sql/binlog_crypt_data.cc:
In member function 'void Binlog_crypt_data::free_key(uchar*&,
std::size_t&)':
/codebase/oi-userland/components/database/percona-server-57/percona-server-5.7.22-22/sql/binlog_crypt_data.cc:62:37:
error: 'memset_s' was not declared in this scope
memset_s(key, 512, 0, key_length);
^
make[3]: *** [sql/CMakeFiles/binlog.dir/build.make:336:
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o] Error 1



this a patching, upstream or makefile issue? ill investigate if no one
knows off the top of head

rich
--
The first rule of propaganda is that if you repeat something enough
times people will start to believe it, no matter how false.
Bob Friesenhahn
2018-11-05 21:38:26 UTC
Permalink
Post by Rich Reynolds
[ 32%] Building CXX object sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o
error: 'memset_s' was not declared in this scope
memset_s(key, 512, 0, key_length);
^
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o] Error 1
this a patching, upstream or makefile issue? ill investigate if no one knows
off the top of head
This appears to be a C'11 function. See
https://en.cppreference.com/w/c/string/byte/memset. Depending on C'11
at this time is very optimistic.

What version of GCC are you using?

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Rich Reynolds
2018-11-06 00:07:10 UTC
Permalink
Post by Rich Reynolds
[ 32%] Building CXX object
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o
In member function 'void Binlog_crypt_data::free_key(uchar*&,
error: 'memset_s' was not declared in this scope
    memset_s(key, 512, 0, key_length);
                                    ^
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o] Error 1
this a patching, upstream or makefile issue?  ill investigate if no
one knows off the top of head
This appears to be a C'11 function.  See
https://en.cppreference.com/w/c/string/byte/memset.  Depending on C'11
at this time is very optimistic.
What version of GCC are you using?
Bob
cmake was fine with 6.4.0

-- Running cmake version 3.11.3
-- Found Git: /usr/bin/git (found version "2.19.1")
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/gcc/6/bin/gcc
-- Check for working C compiler: /usr/gcc/6/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/gcc/6/bin/g++
-- Check for working CXX compiler: /usr/gcc/6/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done

and cuz more information is better than less:

-- CMAKE_BUILD_TYPE: RELEASE
-- COMPILE_DEFINITIONS:
_FILE_OFFSET_BITS=64;__EXTENSIONS__;_POSIX_PTHREAD_SEMANTICS;_REENTRANT;_PTHREADS;BOOST_GEOMETRY_SQRT_CHECK_FINITENESS;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS: -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS: -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_LINK_FLAGS: -m32
-- CMAKE_CXX_LINK_FLAGS: -m32
-- CMAKE_C_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- Configuring done

rich
--
The first rule of propaganda is that if you repeat something enough
times people will start to believe it, no matter how false.
Michal Nowak
2018-11-06 07:28:43 UTC
Permalink
Post by Rich Reynolds
Post by Rich Reynolds
[ 32%] Building CXX object
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o
error: 'memset_s' was not declared in this scope
    memset_s(key, 512, 0, key_length);
                                    ^
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o] Error 1
this a patching, upstream or makefile issue?  ill investigate if no
one knows off the top of head
This appears to be a C'11 function.  See
https://en.cppreference.com/w/c/string/byte/memset.  Depending on C'11
at this time is very optimistic.
What version of GCC are you using?
Bob
cmake was fine with 6.4.0
-- Running cmake version 3.11.3
-- Found Git: /usr/bin/git (found version "2.19.1")
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/gcc/6/bin/gcc
-- Check for working C compiler: /usr/gcc/6/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/gcc/6/bin/g++
-- Check for working CXX compiler: /usr/gcc/6/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE: RELEASE
_FILE_OFFSET_BITS=64;__EXTENSIONS__;_POSIX_PTHREAD_SEMANTICS;_REENTRANT;_PTHREADS;BOOST_GEOMETRY_SQRT_CHECK_FINITENESS;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS: -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_LINK_FLAGS:  -m32
-- CMAKE_CXX_LINK_FLAGS:  -m32
-- CMAKE_C_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- Configuring done
rich
Three months ago illumos added support for memset_s(3C)
(https://www.illumos.org/issues/8548) before that it likely wasn't detected.

memset_s(3C) seems to require

#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>

I don't know how to do that properly in cmake/C++.

If anyone does know, I'll fix it in userland when updating Percona
Server to 5.7.23-23.

This works for cmake to use GCC 7.3:

GCC_VERSION = 7

Michal
Jim Klimov
2018-11-06 09:27:42 UTC
Permalink
Post by Rich Reynolds
Post by Rich Reynolds
Post by Rich Reynolds
[ 32%] Building CXX object
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o
error: 'memset_s' was not declared in this scope
    memset_s(key, 512, 0, key_length);
                                    ^
sql/CMakeFiles/binlog.dir/binlog_crypt_data.cc.o] Error 1
this a patching, upstream or makefile issue?  ill investigate if no
one knows off the top of head
This appears to be a C'11 function.  See
https://en.cppreference.com/w/c/string/byte/memset.  Depending on
C'11
Post by Rich Reynolds
at this time is very optimistic.
What version of GCC are you using?
Bob
cmake was fine with 6.4.0
-- Running cmake version 3.11.3
-- Found Git: /usr/bin/git (found version "2.19.1")
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/gcc/6/bin/gcc
-- Check for working C compiler: /usr/gcc/6/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/gcc/6/bin/g++
-- Check for working CXX compiler: /usr/gcc/6/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE: RELEASE
_FILE_OFFSET_BITS=64;__EXTENSIONS__;_POSIX_PTHREAD_SEMANTICS;_REENTRANT;_PTHREADS;BOOST_GEOMETRY_SQRT_CHECK_FINITENESS;HAVE_CONFIG_H;HAVE_LIBEVENT1
Post by Rich Reynolds
-- CMAKE_C_FLAGS: -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -m32 -O3 -Wall -Wextra -Wformat-security -Wvla
-Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_LINK_FLAGS:  -m32
-- CMAKE_CXX_LINK_FLAGS:  -m32
-- CMAKE_C_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG -DDBUG_OFF -DNDEBUG
-- Configuring done
rich
Three months ago illumos added support for memset_s(3C)
(https://www.illumos.org/issues/8548) before that it likely wasn't detected.
memset_s(3C) seems to require
#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>
I don't know how to do that properly in cmake/C++.
If anyone does know, I'll fix it in userland when updating Percona
Server to 5.7.23-23.
GCC_VERSION = 7
Michal
_______________________________________________
oi-dev mailing list
https://openindiana.org/mailman/listinfo/oi-dev
I would expect adding these lines to individual source files using the routine, maybe after other headers just in case so the macro does not add surprise when processing other headers that do work today :)

On userland side, extract this change into an automatically applied patch-file and the common web of makefiles should do the magic.

Jim
--
Typos courtesy of K-9 Mail on my Android

Loading...