[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#995916: std::stoi, std::stol, std::stoul, ... broken on sh4



Source: gcc-10
Version: 10.3.0-11
Severity: important
User: debian-superh@lists.debian.org
Usertags: sh4
X-Debbugs-Cc: debian-superh@lists.debian.org
Control: affects -1 cmake ceph

Here is a failure from a recent build of "cmake" on sh4:
https://buildd.debian.org/status/fetch.php?pkg=cmake&arch=sh4&ver=3.21.3-4&stamp=1633638401&raw=0

g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2    -D_FILE_OFFSET_BITS=64    -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/<<PKGBUILDDIR>>/Build/Bootstrap.cmk   -I/<<PKGBUILDDIR>>/Source   -I/<<PKGBUILDDIR>>/Source/LexerParser   -I/<<PKGBUILDDIR>>/Utilities/std   -I/<<PKGBUILDDIR>>/Utilities  -c /<<PKGBUILDDIR>>/Source/cmFileCopier.cxx -o cmFileCopier.o
/<<PKGBUILDDIR>>/Source/cmFileCommand.cxx: In function ‘bool {anonymous}::HandleArchiveCreateCommand(const std::vector<std::__cxx11::basic_string<char> >&, cmExecutionStatus&)’:
/<<PKGBUILDDIR>>/Source/cmFileCommand.cxx:3473:45: error: invalid initialization of reference of type ‘const wstring&’ {aka ‘const std::__cxx11::basic_string<wchar_t>&’} from expression of type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
 3473 |     compressionLevel = std::stoi(parsedArgs.CompressionLevel);
      |                                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/string:55,
                 from /<<PKGBUILDDIR>>/Source/cmFileCommand.h:7,
                 from /<<PKGBUILDDIR>>/Source/cmFileCommand.cxx:3:
/usr/include/c++/10/bits/basic_string.h:6699:23: note: in passing argument 1 of ‘int std::__cxx11::stoi(const wstring&, std::size_t*, int)’
 6699 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
gmake[2]: *** [Makefile:126: cmFileCommand.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/<<PKGBUILDDIR>>/Build/Bootstrap.cmk'
---------------------------------------------
Error when bootstrapping CMake:


The std::stoi, std::stol, std::stoul, ... functions should be available
in two versions. One accepting a std::string and one accepting a
std::wstring.

In g++ version 10.3.0-11 on sh4 only the std::wstring version is
available, so when it tries to compile code that uses the std::string
version it fails.

The problem is that for some reason the the file

/usr/include/sh4-linux-gnu/c++/10/bits/c++config.h

provided by libstdc++-10-dev_10.3.0-11_sh4.deb contains the line

/* #undef _GLIBCXX11_USE_C99_STDLIB */

The corresponding file for other architectures contains

#define _GLIBCXX11_USE_C99_STDLIB 1

This is a regression wrt earlier versions, since this used to work
without problems.

	Mattias Ellert


Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: