Skip to content

Improve the compatibility by different gcc version #38

@rorychen

Description

@rorychen

Describe the bug
Assume std::__cxx11::basic_string is not compatible to std::string

To Reproduce
Steps to reproduce the behavior:

  1. python3 setup.py bdist_rpm
  2. python3.6 sed_cli.py --device=/dev/sdj
  3. A Seagate SATA SED drive

Expected behavior
My gcc is 11 under CentOS 7. The boost python lib through yum install may be complied without C++11 default. But pysed is compiled by C++ 11 default.

Screenshots
python3.6 sed_cli.py --device=/dev/sdj
Traceback (most recent call last):
File "sed_cli.py", line 1342, in
main(sys.argv)
File "sed_cli.py", line 1222, in main
SEDConfig = cSEDConfig(opts.device, opts.keymanager, opts)
File "sed_cli.py", line 169, in init
self.SED = SED(self.deviceHandle, callbacks=self)
File "/usr/lib64/python3.6/site-packages/TCGstorageAPI/tcgapi.py", line 254, in init
self.__pysed = pysed.Sed(dev, pysedSupport.getUidTables, PskCipherSuites, kwargs)
Boost.Python.ArgumentError: Python argument types in
Sed.init(Sed, str, function, type, dict)
did not match C++ signature:
init(_object*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, boost::python::api::object, boost::python::api::object, boost::python::dict)

Desktop (please complete the following information):

  • OS: [CentOS 7.4
  • Python 3.6

Additional context
If I compile pysed without C++11, the problem can disappear. The method is to add "-D_GLIBCXX_USE_CXX11_ABI=0" into setup.py file.
#extra_compile_args=['-O0','-g','-DDISABLE_NVME_PASSTHROUGH']
extra_compile_args=['-O0','-g','-DDISABLE_NVME_PASSTHROUGH','-D_GLIBCXX_USE_CXX11_ABI=0']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions