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

Setting -fno-stack-protector does not disable nxdk's protector #662

Closed
GXTX opened this issue Oct 10, 2023 · 5 comments
Closed

Setting -fno-stack-protector does not disable nxdk's protector #662

GXTX opened this issue Oct 10, 2023 · 5 comments
Labels
invalid Issues which shouldn't even be here

Comments

@GXTX
Copy link
Contributor

GXTX commented Oct 10, 2023

LTO = y

CFLAGS += -Oz -DNDEBUG -fno-stack-protector
CXXFLAGS += -Oz -DNDEBUG -fno-stack-protector

NXDK_CFLAGS += -Oz -DNDEBUG -fno-stack-protector
NXDK_CXXFLAGS += -Oz -DNDEBUG -fno-stack-protector

image

@GXTX GXTX changed the title Setting -fno-stack-protector does not disable protector Setting -fno-stack-protector does not disable nxdk's protector Oct 10, 2023
@thrimbor
Copy link
Member

This needs more info. From which function is the above code? What were its exact compiler flags? Which LLVM version was used?
In any case, nxdk does not generate stack protectors, so if this is a legitimate bug, it should be reported upstream.

@GXTX
Copy link
Contributor Author

GXTX commented Oct 10, 2023

https://github.com/XboxDev/nxdk/blob/master/lib/xboxrt/vcruntime/stack_protection.c

I am attempting to disable this via compiler flag. Flags are shown in OP, LLVM version is w/e Ubuntu 22.04 bundles.

@thrimbor
Copy link
Member

That's the code for supporting stack protection, it does not generate the stack protection code.
If you have a problem with the compiler generating stack protection code when it's not supposed to, report the bug upstream, but make sure to include all required info (unlike above).

@GXTX
Copy link
Contributor Author

GXTX commented Oct 10, 2023

It's being included in nxdk compiled applications when I don't want it to. Is there a way to disable this beyond removing it?

@thrimbor
Copy link
Member

thrimbor commented Oct 10, 2023

Just like all other platforms you'll have to provide your own crt0 if you want to bypass runtime support functions.
In any case, this is not related to -fno-stack-protector so I'll close this issue as invalid.

@thrimbor thrimbor added the invalid Issues which shouldn't even be here label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues which shouldn't even be here
Development

No branches or pull requests

2 participants