From 6fca791632b4d629a788cf2f36d1fbbcbacc4db2 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 27 May 2013 08:48:45 +0200 Subject: [PATCH] Fortify on release doesn't work and throws warnings on F18 --- indra/cmake/00-Common.cmake | 27 ++++++--------------------- indra/newview/llagent.cpp | 5 ----- indra/newview/llagent.h | 2 +- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 1a0356a83..e8ce73f7d 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -103,10 +103,12 @@ if (LINUX) -pthread ) - # Don't catch SIGCHLD in our base application class for the viewer - # some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! - # The viewer doesn't need to catch SIGCHLD anyway. - add_definitions(-DLL_IGNORE_SIGCHLD) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2 ") + + # Don't catch SIGCHLD in our base application class for the viewer + # some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! + # The viewer doesn't need to catch SIGCHLD anyway. + add_definitions(-DLL_IGNORE_SIGCHLD) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") find_program(GXX g++) @@ -136,16 +138,6 @@ if (LINUX) OUTPUT_VARIABLE CXX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - # Here's a giant hack for Fedora 8, where we can't use - # _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1. - if (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - add_definitions(-D_FORTIFY_SOURCE=2) - else (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") - add_definitions(-D_FORTIFY_SOURCE=2) - endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") - endif (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - #Lets actually get a numerical version of gxx's version STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION}) @@ -190,10 +182,6 @@ if (LINUX) set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}") endif (${ARCH} STREQUAL "x86_64") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - add_definitions( - -D_FORTIFY_SOURCE=2 - ) - if (NOT STANDALONE) # this stops us requiring a really recent glibc at runtime add_definitions(-fno-stack-protector) @@ -206,9 +194,6 @@ if (LINUX) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") - add_definitions( - -D_FORTIFY_SOURCE=2 - ) if (NOT STANDALONE) # this stops us requiring a really recent glibc at runtime diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 794f4c952..b3e0eb56d 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -885,11 +885,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp) //----------------------------------------------------------------------------- // getRegion() //----------------------------------------------------------------------------- -LLViewerRegion *LLAgent::getRegion() const -{ - return mRegionp; -} - const LLHost& LLAgent::getRegionHost() const { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 6ae193677..bcc469f5e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -242,7 +242,7 @@ private: //-------------------------------------------------------------------- public: void setRegion(LLViewerRegion *regionp); - LLViewerRegion *getRegion() const; + LLViewerRegion *getRegion() const { return mRegionp; } const LLHost& getRegionHost() const; BOOL inPrelude(); std::string getSLURL() const; //Return uri for current region