building nss-3.89.1 under SLES12 SP5

18 views
Skip to first unread message

Brian Reichert

unread,
May 24, 2023, 3:57:18 PM5/24/23
to dev-tec...@lists.mozilla.org
I'm exploring building nss-3.89.1 under SLES12 SP5, but hitting a
brick wall, right out of the gate.

This host is fully updated, has gcc9-c++, gyp, and ninja installed.

This also has mozilla-nspr-devel-4.35-19.12.0.x86_64 installed
(locally built); that has put header files under /usr/include/nspr4.

I've be happy to provide specific dev toolchain version numbers,
if that would be helpful.

Steps taken:

breichert@sles12breichert:~/build> wget https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_89_1_RTM/src/nss-3.89.1.tar.gz

breichert@sles12breichert:~/build> tar zxf nss-3.89.1.tar.gz

breichert@sles12breichert:~/build> cd nss-3.89.1/

breichert@sles12breichert:~/build/nss-3.89.1> nss/build.sh
--with-nspr=/usr/include/nspr4 -v >& build.log

The build starts to go wrong here; dunno if anyone has any feedback
they can provide. I'm not a C++ developer, and never have enjoyed
untangling C++ build failures:

[220/1256] c++ -MMD -MF
obj/gtests/util_gtest/util_gtest.util_b64_unittest.o.d -DNSS_FIPS_DISABLED
-DNSS_NO_INIT_SUPPORT -DNSS_X86_OR_X64 -DNSS_X64 -DNSS_USE_64
-DNSS_USE_STATIC_LIBS -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/util -I/usr/include/nspr4
-I/home/breichert/build/nss-3.89.1/dist/private/nss
-I../../gtests/google_test/gtest/include -I../../gtests/common
-I../../cpputil -I/home/breichert/build/nss-3.89.1/dist/public/nss
-Wsign-compare -fPIC -pipe -ffunction-sections -fdata-sections -m64 -Werror
-Wall -Wshadow -O0 -g -gdwarf-2 -std=c++11 -c
../../gtests/util_gtest/util_b64_unittest.cc -o
obj/gtests/util_gtest/util_gtest.util_b64_unittest.o
FAILED: obj/gtests/util_gtest/util_gtest.util_b64_unittest.o
c++ -MMD -MF obj/gtests/util_gtest/util_gtest.util_b64_unittest.o.d
-DNSS_FIPS_DISABLED -DNSS_NO_INIT_SUPPORT -DNSS_X86_OR_X64 -DNSS_X64
-DNSS_USE_64 -DNSS_USE_STATIC_LIBS -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/util -I/usr/include/nspr4
-I/home/breichert/build/nss-3.89.1/dist/private/nss
-I../../gtests/google_test/gtest/include -I../../gtests/common
-I../../cpputil -I/home/breichert/build/nss-3.89.1/dist/public/nss
-Wsign-compare -fPIC -pipe -ffunction-sections -fdata-sections -m64 -Werror
-Wall -Wshadow -O0 -g -gdwarf-2 -std=c++11 -c
../../gtests/util_gtest/util_b64_unittest.cc -o
obj/gtests/util_gtest/util_gtest.util_b64_unittest.o
In file included from
../../gtests/google_test/gtest/include/gtest/internal/gtest-death-test-internal.h:39:0,
from
../../gtests/google_test/gtest/include/gtest/gtest-death-test.h:41,
from
../../gtests/google_test/gtest/include/gtest/gtest.h:64,
from ../../gtests/util_gtest/util_b64_unittest.cc:11:
../../gtests/google_test/gtest/include/gtest/gtest-matchers.h: In static
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
std::is_trivially_copy_constructible<M>::value &&


--
Brian Reichert <reic...@numachi.com>
BSD admin/developer at large

Dennis Jackson

unread,
May 25, 2023, 9:15:26 AM5/25/23
to Brian Reichert, dev-tec...@lists.mozilla.org
Hi Brian,

The error you're seeing is in 3rd party code (gtest) and from a quick search looks like it's caused by the GCC version being too old (see this patch identifying gcc 5 as a requirement). This SUSE article  states that the default gcc version for SLES 12 is 4.8. 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. 

Best,
Dennis

--
You received this message because you are subscribed to the Google Groups "dev-tec...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-tech-cryp...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-tech-crypto/20230524184301.GA5612%40numachi.com.

Brian Reichert

unread,
May 25, 2023, 11:02:54 AM5/25/23
to Dennis Jackson, Brian Reichert, dev-tec...@lists.mozilla.org
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

Robert Relyea

unread,
May 26, 2023, 1:13:45 PM5/26/23
to dev-tec...@mozilla.org
On 5/25/23 8:02 AM, Brian Reichert wrote:
> 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.

I will sometimes have to disable gtests when building on older
platforms, but it doesn't look like there's a gyp option to do this (we
build with gmake and the option there is NSS_DISABLE_GTESTS)

bob

Martin Sirringhaus

unread,
May 30, 2023, 9:28:05 AM5/30/23
to Brian Reichert, dev-tec...@lists.mozilla.org
Hi Brian,

you could also have a look at how openSUSE builds NSS:
https://github.com/openSUSE/firefox-maintenance/blob/master/nss/mozilla-nss.spec

This spec-file works on SLE12 as well.

We do use make instead of gyp, simply to keep dependencies down. But I
did try using gyp at one point and it works similarly.

Not sure if that is your problem, but it could be that you have to set
not only CXX but also CCC to g++-9.

Hope this helps.

Cheers,
Martin
Reply all
Reply to author
Forward
0 new messages