On Thu, May 25, 2023 at 02:14:46PM +0100, Dennis Jackson wrote:
> Are you sure that your
> environment is configured to use the correct gcc version? It might be you
> have gcc 9 installed but not selected.
I think you're on to something; I did already install gcc 9, as I
was aware is was necessary to build the source.
"rpm -qa '^gcc*" shows me several versions of gcc RPMs are installed.
Oddly, this distribution doesn't use 'update-alternatives' to manage
which version is in use, and indeed 4.8.5 is the default version
in play.
It looks like gcc 9's binary is named '/usr/bin/gcc-9'. Similarly,
g++ is '/usr/bin/g++-9'.
build.sh doesn't seem to directly support overriding the name of
the C compiler, but it looks like it honors some environment variables
(e.g. CC):
env CC=gcc-9 CXX=g++-9 nss/build.sh --with-nspr=/usr/include/nspr4 -v >&
build.log
And that gets me much farther. My new failure is in compiling
nss_bogo_shim.cc.
If you're willing to cast an eye on this:
FAILED: obj/gtests/nss_bogo_shim/nss_bogo_shim.nss_bogo_shim.o
g++-9 -MMD -MF obj/gtests/nss_bogo_shim/nss_bogo_shim.nss_bogo_shim.o.d
-DNSS_USE_STATIC_LIBS -DNSS_FIPS_DISABLED -DNSS_NO_INIT_SUPPORT
-DNSS_X86_OR_X64 -DNSS_X64 -DNSS_USE_64 -DUSE_UTIL_DIRECTLY
-DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DLINUX2_1
-DLINUX -Dlinux -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE
-DSDB_MEASURE_USE_TEMP_DIR -DHAVE_STRERROR -DXP_UNIX -D_REENTRANT
-DNSS_DISABLE_DBM -DNSS_DISABLE_LIBPKIX -DDEBUG -I../../lib/ssl
-I/usr/include/nspr4 -I/home/breichert/build/nss-3.89.1/dist/private/nss
-I/home/breichert/build/nss-3.89.1/dist/public/nss -I../../cpputil -fPIC
-pipe -ffunction-sections -fdata-sections -m64 -Werror -Wall -Wshadow -O0 -g
-gdwarf-2 -std=c++11 -c ../../gtests/nss_bogo_shim/nss_bogo_shim.cc -o
obj/gtests/nss_bogo_shim/nss_bogo_shim.nss_bogo_shim.o
../../gtests/nss_bogo_shim/nss_bogo_shim.cc: In function ‘void
StringRemoveNewlines(std::string&)’:
../../gtests/nss_bogo_shim/nss_bogo_shim.cc:42:66: error: no matching
function for call to
‘std::basic_string<char>::erase(__gnu_cxx::__normal_iterator<char*,
std::basic_string<char> >, std::basic_string<char>::const_iterator)’
42 | str.erase(std::remove(str.begin(), str.end(), '\n'), str.cend());
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from ../../gtests/nss_bogo_shim/config.h:16,
from ../../gtests/nss_bogo_shim/nss_bogo_shim.cc:6:
/usr/include/c++/9/bits/basic_string.h:4698:7: note: candidate:
‘std::basic_string<_CharT, _Traits, _Alloc>&
std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT,
_Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits,
_Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>;
_Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits,
_Alloc>::size_type = long unsigned int]’
4698 | erase(size_type __pos = 0, size_type __n = npos)
| ^~~~~
/usr/include/c++/9/bits/basic_string.h:4698:23: note: no known conversion
for argument 1 from ‘__gnu_cxx::__normal_iterator<char*,
std::basic_string<char> >’ to
‘std::basic_string<char>::size_type’ {aka
‘long unsigned int’}
4698 | erase(size_type __pos = 0, size_type __n = npos)
| ~~~~~~~~~~^~~~~~~~~
/usr/include/c++/9/bits/basic_string.h:4714:7: note: candidate:
‘std::basic_string<_CharT, _Traits, _Alloc>::iterator
std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT,
_Traits, _Alloc>::iterator) [with _CharT = char; _Traits =
std::char_traits<char>; _Alloc = std::allocator<char>;
std::basic_string<_CharT, _Traits, _Alloc>::iterator =
__gnu_cxx::__normal_iterator<char*, std::basic_string<char> >; typename
_Alloc::rebind<_CharT>::other::pointer = char*]’
4714 | erase(iterator __position)
| ^~~~~
/usr/include/c++/9/bits/basic_string.h:4714:7: note: candidate expects 1
argument, 2 provided
/usr/include/c++/9/bits/basic_string.h:4734:7: note: candidate:
‘std::basic_string<_CharT, _Traits, _Alloc>::iterator
std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT,
_Traits, _Alloc>::iterator, std::basic_string<_CharT, _Traits,
_Alloc>::iterator) [with _CharT = char; _Traits = std::char_traits<char>;
_Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits,
_Alloc>::iterator = __gnu_cxx::__normal_iterator<char*,
std::basic_string<char> >; typename _Alloc::rebind<_CharT>::other::pointer =
char*]’
4734 | erase(iterator __first, iterator __last);
| ^~~~~
/usr/include/c++/9/bits/basic_string.h:4734:40: note: no known conversion
for argument 2 from ‘__normal_iterator<const
char*,[...]>’ to
‘__normal_iterator<char*,[...]>’
4734 | erase(iterator __first, iterator __last);
| ~~~~~~~~~^~~~~~
../../gtests/nss_bogo_shim/nss_bogo_shim.cc:43:66: error: no matching
function for call to
‘std::basic_string<char>::erase(__gnu_cxx::__normal_iterator<char*,
std::basic_string<char> >, std::basic_string<char>::const_iterator)’
43 | str.erase(std::remove(str.begin(), str.end(), '\r'), str.cend());
|
etc...
> > member function ???static constexpr bool
> > testing::internal::MatcherBase<T>::IsInlined()???:
> > ../../gtests/google_test/gtest/include/gtest/gtest-matchers.h:414:12:
> > error:
> > ???is_trivially_copy_constructible??? is not a member of
> > ???std???
> > std::is_trivially_copy_constructible<M>::value &&
> > ^
> > ../../gtests/google_test/gtest/include/gtest/gtest-matchers.h:414:50:
> > error:
> > expected primary-expression before ???>??? token
> > std::is_trivially_copy_constructible<M>::value &&
> > ^
> > ../../gtests/google_test/gtest/include/gtest/gtest-matchers.h:414:51:
> > error:
> > ???::value??? has not been declared