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

Add omitframepointer API #1043

Merged
merged 12 commits into from
Apr 17, 2018
Merged

Conversation

tdesveauxPKFX
Copy link
Contributor

No description provided.

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of changes, but otherwise this is great! Thanks!

scope = "config",
kind = "string",
allowed = {
"Default",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't test this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an "unset". I was unsure that it is a value we want and kinda forgot.
So I see some APIs that have the option to set Default and others not. What is your take on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in the other comment chain, I've encountered the need for an "unset" value. So I'm 100% in favour of not having to hack around in my Premake scripts just to "unset" something.

api.deprecateValue("flags", "NoFramePointer", 'Use `framepointer "Off"` instead.',
function(value)
omitframepointer("On")
end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's two functions that can be defined, one for flags { "NoFramePointer" } and one for removeflags { "NoFramePointer" }. See above deprecation for StaticRuntime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I commented too soon.
I suppose this is the reason for a Default value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's this, but sometimes you just want to unset the value. Either it's causing you compile issues (compiler bugs, etc), or you're using a compiler that doesn't fully support the options. I've encountered the latter when people have assumed that Clang accepts all GCC flags, but it actually doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.
The problem that I see is that an API like -fvisibility has a Default value that does something (ie -fvisibility=default) so I feel that premake should take care of this at a higher level than per-API. Maybe something like the removeflags API? Or allowing user to set nil?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You raise a good point, @starkos @tvandijck @TurkeyMan thoughts on extending the API system to "unset" an API? I like the idea of using the remove prefix, it's consistent with the list-based APIs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer a "Default" or "Off" to "remove", since it makes the behavior of that particular switch more explicit. Do you actually need to emit -fvisibility=default? Isn't that the same as not including the flag at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I can't find anything about a difference between -fvisibility=default and not including the flag so I guess I could no output anything for visibility "Default".

I still stand against using "Off" as an equivalent to remove. In the UnsignedChar API I added, unsignedchar "Off" output -fno-unsigned-char and it is necessary as some platforms have unsigned char by default.

As for "Default", it does not sit well with me but I can't find a case that would cause an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if "Off" is not used as a "Default", it means that boolean APIs must either be changed to string or that the internal workings of boolean APIs accept "Default" as input.

Honestly, I'd rather that all APIs accept "nil" that would simplify things a lot.

Should I open an issue to discuss this? It concerns premake as a whole and not just this PR.

@@ -96,6 +95,10 @@
},
symbols = {
On = "-g"
},
omitframepointer = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Clang automatically pull this in? I feel like it doesn't, but it definitely should since the flag was pulled in.

@tdesveauxPKFX
Copy link
Contributor Author

I added a test for "Default" and will open an issue to discuss what to do for un-setting values.
I think this can be merged for now.

@tdesveauxPKFX
Copy link
Contributor Author

I replaced the references to NoFramePointer flag with the new API. I think that's all to do here.

I will wait for this to be merged before resolving the conflicts on my other PRs as it would result with more of the same conflicts.

@tdesveauxPKFX
Copy link
Contributor Author

The linux fail doesn't seem to be from this PR and I can't reproduce it on my linux. Any idea?

@samsinsane samsinsane merged commit 2061b15 into premake:master Apr 17, 2018
@tdesveauxPKFX tdesveauxPKFX deleted the omit-frame-pointer branch April 17, 2018 11:50
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

Successfully merging this pull request may close these issues.

3 participants