Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to remove RTTI requirement #7810

Open
nirvedhmeshram opened this issue Nov 20, 2023 · 2 comments
Open

Request to remove RTTI requirement #7810

nirvedhmeshram opened this issue Nov 20, 2023 · 2 comments

Comments

@nirvedhmeshram
Copy link

nirvedhmeshram commented Nov 20, 2023

Currently some parts of the XRT C++ API require use of RTTI which down stream projects may have disabled. To see the issue you may build this snippet.

https://gist.github.com/nirvedhmeshram/eb051397606439aa50016780ead8cf00

With the following compile command

clang++ -fno-rtti test.cpp -o test.exe -I/opt/xilinx/xrt/include -L/opt/xilinx/xrt/lib -lxrt_coreutil

We will have a runtime error with

./test.exe 
terminate called after throwing an instance of 'boost::wrapexcept<boost::bad_any_cast>'
  what():  boost::bad_any_cast: failed conversion using boost::any_cast
Aborted (core dumped)

if you remove -fno-rtti flag then it works but down stream projects may choose to not use rtti in which case we have problems.

@keryell
Copy link
Member

keryell commented Nov 20, 2023

I guess you need to compile XRT without RTTI at the first place to have it to work.

@stsoe
Copy link
Collaborator

stsoe commented Dec 4, 2023

XRT is built with rtti enabled which is the default in modern C++. I don't understand the aversion to building an application with rtti enabled, but regardless you don't have to, but you just can't use the info API which requires rtti. No other APIs rely on rtti being enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants