Clang/GCC compiler settings update [SECURITY] (#7358)
- Add the following compilation flags for clang -fpie -fstack-protector-all -fstack-check (non-release) - Add the following compilation flags for gcc -fpie -fstack-protector-all - Fix -Wunused-result errors from above compilation flag updates - Add _FORTIFY_SOURCE=2 to GCC DEFINES Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
This commit is contained in:
@@ -69,9 +69,11 @@ namespace UnitTest
|
||||
// Note that ConvertToAbsolutePath will perform a realpath on the result. The result of AZ::Utils::GetExecutableDirectory
|
||||
// uses AZ::Android::AndroidEnv::Get()->GetAppPrivateStoragePath() which will retrieve the storage path, but that path could
|
||||
// be symlinked, so we need to perform a real path on it before comparison
|
||||
char realExecutableDirectory[AZ::IO::MaxPathLength];
|
||||
ASSERT_TRUE(realpath(executableDirectory, realExecutableDirectory));
|
||||
|
||||
char* realExecutableDirectory = realpath(executableDirectory, nullptr);
|
||||
ASSERT_NE(realExecutableDirectory, nullptr);
|
||||
|
||||
EXPECT_STRCASEEQ(realExecutableDirectory, absolutePath->c_str());
|
||||
|
||||
free(realExecutableDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user