Compile NVTT under G5/leopard
This commit is contained in:
parent
6ce542b5c0
commit
b5e373b734
@ -20,12 +20,21 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
|
||||||
IF(NV_SYSTEM_PROCESSOR STREQUAL "powerpc")
|
IF(NV_SYSTEM_PROCESSOR STREQUAL "powerpc")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=powerpc -maltivec -mabi=altivec -mpowerpc-gfxopt")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=powerpc -faltivec -maltivec -mabi=altivec -mpowerpc-gfxopt")
|
||||||
|
|
||||||
# ibook G4:
|
# ibook G4:
|
||||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec -mpowerpc-gfxopt")
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=7450 -mtune=7450 -faltivec -maltivec -mabi=altivec -mpowerpc-gfxopt")
|
||||||
|
|
||||||
|
# G5
|
||||||
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=G5 -faltivec -maltivec -mabi=altivec -mpowerpc-gfxopt")
|
||||||
|
|
||||||
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "powerpc")
|
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "powerpc")
|
||||||
|
|
||||||
|
# IF(DARWIN)
|
||||||
|
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")
|
||||||
|
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")
|
||||||
|
# ENDIF(DARWIN)
|
||||||
|
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
|
#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
|
||||||
# include <execinfo.h>
|
# include <execinfo.h> // backtrace
|
||||||
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
||||||
# include <cxxabi.h>
|
# include <cxxabi.h>
|
||||||
# endif
|
# endif
|
||||||
@ -39,6 +39,13 @@
|
|||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/sysctl.h> // sysctl
|
# include <sys/sysctl.h> // sysctl
|
||||||
# include <ucontext.h>
|
# include <ucontext.h>
|
||||||
|
# undef HAVE_EXECINFO_H
|
||||||
|
# if defined(HAVE_EXECINFO_H) // only after OSX 10.5
|
||||||
|
# include <execinfo.h> // backtrace
|
||||||
|
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
||||||
|
# include <cxxabi.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdexcept> // std::runtime_error
|
#include <stdexcept> // std::runtime_error
|
||||||
@ -128,6 +135,10 @@ namespace
|
|||||||
|
|
||||||
#if defined(HAVE_EXECINFO_H) // NV_OS_LINUX
|
#if defined(HAVE_EXECINFO_H) // NV_OS_LINUX
|
||||||
|
|
||||||
|
static bool nvHasStackTrace() {
|
||||||
|
return backtrace != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void nvPrintStackTrace(void * trace[], int size, int start=0) {
|
static void nvPrintStackTrace(void * trace[], int size, int start=0) {
|
||||||
char ** string_array = backtrace_symbols(trace, size);
|
char ** string_array = backtrace_symbols(trace, size);
|
||||||
|
|
||||||
@ -228,17 +239,18 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
# if defined(HAVE_EXECINFO_H)
|
# if defined(HAVE_EXECINFO_H)
|
||||||
|
if (nvHasStackTrace()) // in case of weak linking
|
||||||
|
{
|
||||||
|
void * trace[64];
|
||||||
|
int size = backtrace(trace, 64);
|
||||||
|
|
||||||
void * trace[64];
|
if (pnt != NULL) {
|
||||||
int size = backtrace(trace, 64);
|
// Overwrite sigaction with caller's address.
|
||||||
|
trace[1] = pnt;
|
||||||
if (pnt != NULL) {
|
}
|
||||||
// Overwrite sigaction with caller's address.
|
|
||||||
trace[1] = pnt;
|
nvPrintStackTrace(trace, size, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
nvPrintStackTrace(trace, size, 1);
|
|
||||||
|
|
||||||
# endif // defined(HAVE_EXECINFO_H)
|
# endif // defined(HAVE_EXECINFO_H)
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -373,9 +385,12 @@ namespace
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(HAVE_EXECINFO_H)
|
# if defined(HAVE_EXECINFO_H)
|
||||||
void * trace[64];
|
if (nvHasStackTrace())
|
||||||
int size = backtrace(trace, 64);
|
{
|
||||||
nvPrintStackTrace(trace, size, 3);
|
void * trace[64];
|
||||||
|
int size = backtrace(trace, 64);
|
||||||
|
nvPrintStackTrace(trace, size, 3);
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// Exit cleanly.
|
// Exit cleanly.
|
||||||
@ -422,9 +437,12 @@ void NV_CDECL nvDebug(const char *msg, ...)
|
|||||||
void debug::dumpInfo()
|
void debug::dumpInfo()
|
||||||
{
|
{
|
||||||
#if !NV_OS_WIN32 && defined(HAVE_SIGNAL_H) && defined(HAVE_EXECINFO_H)
|
#if !NV_OS_WIN32 && defined(HAVE_SIGNAL_H) && defined(HAVE_EXECINFO_H)
|
||||||
void * trace[64];
|
if (nvHasStackTrace())
|
||||||
int size = backtrace(trace, 64);
|
{
|
||||||
nvPrintStackTrace(trace, size, 1);
|
void * trace[64];
|
||||||
|
int size = backtrace(trace, 64);
|
||||||
|
nvPrintStackTrace(trace, size, 1);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
#error "Do not include this file directly."
|
#error "Do not include this file directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h> // uint8_t, int8_t, ...
|
#include <stdint.h> // uint8_t, int8_t, ...
|
||||||
|
|
||||||
|
|
||||||
// Function linkage
|
// Function linkage
|
||||||
#define DLL_IMPORT
|
#define DLL_IMPORT
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
#ifndef SQUISH_SIMD_VE_H
|
#ifndef SQUISH_SIMD_VE_H
|
||||||
#define SQUISH_SIMD_VE_H
|
#define SQUISH_SIMD_VE_H
|
||||||
|
|
||||||
|
#ifndef __APPLE_ALTIVEC__
|
||||||
#include <altivec.h>
|
#include <altivec.h>
|
||||||
#undef bool
|
#undef bool
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace squish {
|
namespace squish {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user