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

[Build] Allow exceptions and runtime type information #29368

Closed
xvortep opened this issue Sep 21, 2023 · 2 comments · Fixed by #29376
Closed

[Build] Allow exceptions and runtime type information #29368

xvortep opened this issue Sep 21, 2023 · 2 comments · Fixed by #29376

Comments

@xvortep
Copy link

xvortep commented Sep 21, 2023

Build issue(s)

Greetings,

Some SDKs work with exceptions and require rtti. In order for such SDKs to be integrated, flags like -fexception and -frtti have to be set. As far as I can see, there are no methods for setting -fexceptions and -frtti flags other than changing the compiler/BUILD.gn file.

Additionally, rtti flag can be set by providing an additional argument to gn:
enable_rtti = true
which overrides these few lines in compiler/BUILD.gn:
declare_args() { /# Enable Runtime Type Information (RTTI) enable_rtti = current_os == "mac" || current_os == "ios" }
This method does not sit well with me because of overriding.

However, such mechanism doesn't exist for exceptions, so the only way to set the -fexceptions flag is to change this line in compiler/BUILD.gn:
config("exceptions_default") { configs = [ ":no_exceptions" ] }
to:
config("exceptions_default") { configs = [ ":exceptions" ] }

Platform: Linux ubuntu 20.04

If there is a way to do this adequately, please correct me.
Thanks.

Platform

No response

Anything else?

No response

@bzbarsky-apple
Copy link
Contributor

This method does not sit well with me because of overriding.

This is not "overriding". This is a build config option (declare_args means "this is an argument consumers can set"), which has some default value (enabled on macOS/iOS, disabled elsewhere) but you can set it to whatever you want to get the behavior you want.

@xvortep It seems like the right thing to do here is to add a similar enable_exceptions build config option, right?

@xvortep
Copy link
Author

xvortep commented Sep 25, 2023

This method does not sit well with me because of overriding.

This is not "overriding". This is a build config option (declare_args means "this is an argument consumers can set"), which has some default value (enabled on macOS/iOS, disabled elsewhere) but you can set it to whatever you want to get the behavior you want.

@xvortep It seems like the right thing to do here is to add a similar enable_exceptions build config option, right?

Sounds right. Thank you.

HunsupJung pushed a commit to HunsupJung/connectedhomeip that referenced this issue Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants