提交 4c2ee984 编写于 作者: C Chris Hajas

Remove solaris and 32-bit specific code

This simplifies some of the cmake files further.
上级 0e6e8fb6
......@@ -21,11 +21,6 @@ if(NOT CMAKE_BUILD_TYPE)
endif(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# Override CMAKE_SYSTEM_PROCESSOR if it has been explicitly set in a toolchain file.
if (FORCED_CMAKE_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${FORCED_CMAKE_SYSTEM_PROCESSOR})
endif()
# Turn on compiler flags for all warnings if available.
include(CheckCXXCompilerFlag)
......@@ -83,20 +78,6 @@ endif()
set(GPOS_${CMAKE_SYSTEM_NAME} 1)
set(GPOS_${CMAKE_SYSTEM_PROCESSOR} 1)
# Autodetect bit-width if not already set by toolchain file.
if (NOT GPOS_ARCH_BITS)
# Autodetect bit-width.
if (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(GPOS_ARCH_BITS 64)
elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(GPOS_ARCH_BITS 32)
else()
message(FATAL_ERROR "Could not detect 32-bit OR 64-bit architecture")
endif()
endif()
set (GPOS_${GPOS_ARCH_BITS}BIT 1)
# Library dependencies for optimizer.
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
......
set(GPOS_ARCH_BITS "32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set(FORCED_CMAKE_SYSTEM_PROCESSOR "i386")
# Older GCC versions give linking errors when using certain builtins without
# explicitly setting a 32-bit -march. Tell the root CMakeLists file to set that
# flag if needed.
set(ENABLE_OLD_GCC_32BIT_MARCH 1)
set(GPOS_ARCH_BITS "64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64" CACHE STRING "c flags")
set(FORCED_CMAKE_SYSTEM_PROCESSOR "x86_64")
......@@ -17,15 +17,10 @@ add_library(gpdbcost ${srcs})
target_link_libraries(gpdbcost
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}
gpos
${XERCES_LIBRARIES}
${GPORCA_SOLARIS_EXTRA_LIBS})
${XERCES_LIBRARIES})
# Prevent linker errors from undefined symbols on OSX.
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(gpdbcost PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup")
endif()
set_target_properties(gpdbcost PROPERTIES
SOVERSION ${GPORCA_ABI_VERSION}
VERSION ${GPORCA_VERSION_STRING})
......@@ -21,9 +21,4 @@ target_link_libraries(gpopt
naucrates
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}
gpos
${XERCES_LIBRARIES}
${GPORCA_SOLARIS_EXTRA_LIBS})
set_target_properties(gpopt PROPERTIES
SOVERSION ${GPORCA_ABI_VERSION}
VERSION ${GPORCA_VERSION_STRING})
${XERCES_LIBRARIES})
......@@ -36,9 +36,5 @@ add_library(gpos ${srcs})
target_link_libraries(gpos ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
set_target_properties(gpos PROPERTIES
SOVERSION ${GPORCA_ABI_VERSION}
VERSION ${GPORCA_VERSION_STRING})
# Tests reside in the 'server' subdirectory.
add_subdirectory(server)
......@@ -24,11 +24,7 @@
// pattern used to mark deallocated memory, this must match
// GPOS_MEM_FREED_PATTERN_CHAR in CMemoryPool.h
#ifdef GPOS_32BIT
#define GPOS_WIPED_MEM_PATTERN 0xCdCdCdCd
#else
#define GPOS_WIPED_MEM_PATTERN 0xCdCdCdCdCdCdCdCd
#endif
namespace gpos
{
......
......@@ -41,11 +41,6 @@ namespace gpos
// append formatted symbol description
void AppendSymbolInfo(CWString *ws, CHAR *demangling_symbol_buffer, SIZE_T size, const Dl_info &symbol_info_array, ULONG index) const;
#if (GPOS_sparc)
// method called by walkcontext function to store return addresses
static INT GetStackFrames(ULONG_PTR func_ptr, INT sig __attribute__((unused)), void *context);
#endif // GPOS_sparc
// reset descriptor
void Reset()
{
......
......@@ -28,21 +28,6 @@ namespace gpos
typedef INT (*Comparator)(const void *, const void *);
#ifdef GPOS_sparc
#include <ucontext.h>
typedef INT (*Callback)(ULONG_PTR, INT, void *);
// get current user context
INT GetContext(ucontext_t *user_ctxt);
// call the user-supplied function callback for each routine found on
// the call stack and each signal handler invoked
INT WalkContext(const ucontext_t *user_ctxt, Callback callback, void *arg);
#endif
// get an environment variable
CHAR *GetEnv(const CHAR *name);
......
......@@ -110,14 +110,12 @@ namespace gpos
// inject I/O error for functions whose returned value type is INT
BOOL SimulateIOError(INT *return_value, INT error_no, const CHAR *file, ULONG line_num);
#if defined(GPOS_64BIT) || defined(GPOS_Darwin)
// inject I/O error for functions whose returned value type is INT_PTR
inline
BOOL SimulateIOError(INT_PTR *return_value, INT error_no, const CHAR *file, ULONG line_num)
{
return SimulateIOError((INT*) return_value, error_no, file, line_num);
}
#endif
// inject I/O error for functions whose returned value type is CHAR*
BOOL SimulateIOError(CHAR **return_value, INT error_no, const CHAR *file, ULONG line_num);
......
......@@ -79,11 +79,7 @@ namespace gpos
};
typedef uintptr_t ULONG_PTR;
#ifdef GPOS_32BIT
#define ULONG_PTR_MAX (gpos::ulong_max)
#else
#define ULONG_PTR_MAX (gpos::ullong_max)
#endif
typedef uint16_t USINT;
typedef int16_t SINT;
......
......@@ -21,39 +21,16 @@
#include "gpos/error/CException.h"
#include "gpos/io/COstreamBasic.h"
#if (GPOS_i386 || GPOS_i686 || GPOS_x86_64) && (GPOS_32BIT)
#define GPOS_ASMFP asm volatile ("movl %%ebp, %0" : "=g" (ulp));
#define GPOS_ASMSP asm volatile ("movl %%esp, %0" : "=g" (ulp));
#elif (GPOS_i386 || GPOS_i686 || GPOS_x86_64) && (GPOS_64BIT)
#define GPOS_ASMFP asm volatile ("movq %%rbp, %0" : "=g" (ulp));
#define GPOS_ASMSP asm volatile ("movq %%rsp, %0" : "=g" (ulp));
#elif (GPOS_sparc) && (GPOS_32BIT)
#define GPOS_ASMFP asm volatile ("st %%fp, %0" : "=g" (ulp));
#define GPOS_ASMSP asm volatile ("st %%sp, %0" : "=g" (ulp));
#elif (GPOS_sparc) && (GPOS_64BIT)
#define GPOS_ASMFP asm volatile ("stx %%fp, %0" : "=g" (ulp));
#define GPOS_ASMSP asm volatile ("stx %%sp, %0" : "=g" (ulp));
#endif
#define ALIGNED_16(x) (((ULONG_PTR) x >> 1) << 1 == (ULONG_PTR) x) // checks 16-bit alignment
#define ALIGNED_32(x) (((ULONG_PTR) x >> 2) << 2 == (ULONG_PTR) x) // checks 32-bit alignment
#define ALIGNED_64(x) (((ULONG_PTR) x >> 3) << 3 == (ULONG_PTR) x) // checks 64-bit alignment
#if GPOS_32BIT // align to 32 bits
#define MAX_ALIGNED(x) ALIGNED_32(x)
#else // align to 64 bits
#define MAX_ALIGNED(x) ALIGNED_64(x)
#endif
#if GPOS_32BIT // force alignment to 32 bits
#define ALIGN_STORAGE __attribute__((aligned (4)))
#else // force alignment to 64 bits
#define ALIGN_STORAGE __attribute__((aligned (8)))
#endif
#define GPOS_GET_FRAME_POINTER(x) do { ULONG_PTR ulp; GPOS_ASMFP; x = ulp; } while (0)
#define GPOS_GET_STACK_POINTER(x) do { ULONG_PTR ulp; GPOS_ASMSP; x = ulp; } while (0)
......
......@@ -18,81 +18,6 @@
using namespace gpos;
#if (GPOS_sparc)
//---------------------------------------------------------------------------
// @function:
// CStackDescriptor::GetStackFrames
//
// @doc:
// Method called by walkcontext function to store return addresses
//
//---------------------------------------------------------------------------
INT
CStackDescriptor::GetStackFrames
(
ULONG_PTR func_ptr,
INT sig __attribute__((unused)),
void *context
)
{
CStackDescriptor *stack_descriptor = (CStackDescriptor *) context;
// check if max number of frames has been reached
if (stack_descriptor->m_depth < GPOS_STACK_TRACE_DEPTH)
{
// set frame address
stack_descriptor->m_array_of_addresses[stack_descriptor->m_depth++] = (void *) func_ptr;
}
return 0;
}
//---------------------------------------------------------------------------
// @function:
// CStackDescriptor::BackTrace
//
// @doc:
// Store current stack
//
//---------------------------------------------------------------------------
void
CStackDescriptor::BackTrace
(
ULONG top_frames_to_skip
)
{
// reset stack depth
Reset();
// retrieve stack context
ucontext_t context;
if (0 != clib::GetContext(&context))
{
return;
}
// walk stack context to get stack addresses
if (0 != clib::WalkContext(&context, GetStackFrames, this))
{
return;
}
// skip top frames
if (top_frames_to_skip <= m_depth)
{
m_depth -= top_frames_to_skip;
for (ULONG i = 0; i < m_depth; i++)
{
m_array_of_addresses[i] = m_array_of_addresses[i + top_frames_to_skip];
}
}
}
#elif (GPOS_i386 || GPOS_i686 || GPOS_x86_64)
//---------------------------------------------------------------------------
// @function:
// CStackDescriptor::BackTrace
......@@ -156,20 +81,6 @@ CStackDescriptor::BackTrace
}
}
#else // unsupported platform
void
CStackDescriptor::BackTrace
(
ULONG
)
{
GPOS_CPL_ASSERT(!"Backtrace is not supported for this platform");
}
#endif
//---------------------------------------------------------------------------
// @function:
// CStackDescriptor::AppendSymbolInfo
......
......@@ -31,61 +31,6 @@
using namespace gpos;
#ifdef GPOS_sparc
#include <ucontext.h>
//---------------------------------------------------------------------------
// @function:
// clib::GetContext
//
// @doc:
// Get current user context
//
//---------------------------------------------------------------------------
INT
gpos::clib::GetContext
(
ucontext_t *user_ctxt
)
{
INT res = getcontext(user_ctxt);
GPOS_ASSERT_(0 == res && "Failed to retrieve stack context");
return res;
}
//---------------------------------------------------------------------------
// @function:
// clib::WalkContext
//
// @doc:
// Call the user-supplied function for each routine found on
// the call stack and each signal handler invoked
//
//---------------------------------------------------------------------------
INT
gpos::clib::WalkContext
(
const ucontext_t *user_ctxt,
Callback callback,
void *arg
)
{
INT res = walkcontext(user_ctxt, callback, arg);
GPOS_ASSERT_(0 == res && "Failed to walk stack context");
return res;
}
#endif //GPOS_sparc
//---------------------------------------------------------------------------
// @function:
// clib::USleep
......
......@@ -17,15 +17,10 @@ add_library(naucrates ${srcs})
target_link_libraries(naucrates
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}
gpos
${XERCES_LIBRARIES}
${GPORCA_SOLARIS_EXTRA_LIBS})
${XERCES_LIBRARIES})
# Prevent linker errors from undefined symbols on OSX.
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(naucrates PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup")
endif()
set_target_properties(naucrates PROPERTIES
SOVERSION ${GPORCA_ABI_VERSION}
VERSION ${GPORCA_VERSION_STRING})
......@@ -436,9 +436,7 @@ add_orca_test(CCastTest)
add_orca_test(CConstTblGetTest)
add_orca_test(CScalarIsDistinctFromTest)
if (GPOS_ARCH_BITS EQUAL 64)
add_orca_test(CSubqueryHandlerTest)
endif()
add_orca_test(CSubqueryHandlerTest)
add_orca_test(CBindingTest)
add_orca_test(CEngineTest)
......@@ -454,9 +452,7 @@ add_orca_test(CRangeTest)
add_orca_test(CPredicateUtilsTest)
add_orca_test(CPartConstraintTest)
if (NOT (${CMAKE_SYSTEM_NAME} MATCHES "SunOS"))
add_orca_test(CSearchStrategyTest)
endif()
add_orca_test(CSearchStrategyTest)
add_orca_test(COptimizationJobsTest)
add_orca_test(CStateMachineTest)
......
......@@ -197,9 +197,7 @@ static gpos::CUnittest rgut[] =
GPOS_UNITTEST_STD(CCastTest),
GPOS_UNITTEST_STD(CConstTblGetTest),
#if !defined(GPOS_32BIT)
GPOS_UNITTEST_STD(CSubqueryHandlerTest),
#endif // !defined(GPOS_32BIT)
GPOS_UNITTEST_STD(CBindingTest),
GPOS_UNITTEST_STD(CEngineTest),
GPOS_UNITTEST_STD(CEquivalenceClassesTest),
......@@ -214,9 +212,7 @@ static gpos::CUnittest rgut[] =
GPOS_UNITTEST_STD(CPredicateUtilsTest),
GPOS_UNITTEST_STD(CScalarIsDistinctFromTest),
GPOS_UNITTEST_STD(CPartConstraintTest),
#if !defined(GPOS_SunOS)
GPOS_UNITTEST_STD(CSearchStrategyTest),
#endif // !defined(GPOS_SunOS)
GPOS_UNITTEST_STD(COptimizationJobsTest),
GPOS_UNITTEST_STD(CStateMachineTest),
GPOS_UNITTEST_STD(CTableDescriptorTest),
......
......@@ -4633,12 +4633,8 @@ CTestUtils::EresUnittest_RunTests
{
BOOL fMatchPlans = false;
BOOL fTestSpacePruning = false;
#if defined(GPOS_Darwin) || defined(GPOS_Linux)
// restrict plan matching to OsX and Linux to avoid arithmetic operations differences
// across systems
fMatchPlans = true;
fTestSpacePruning = true;
#endif // GPOS_Darwin || GPOS_Linux
// enable (Redistribute, Broadcast) hash join plans
CAutoTraceFlag atf1(EopttraceEnableRedistributeBroadcastHashJoin, true /*value*/);
......
......@@ -76,11 +76,7 @@ const CHAR *rgszSubqueryFileNames[] =
"../data/dxl/minidump/Subquery-ExistsAllAggregates.mdp",
"../data/dxl/minidump/Subquery-ExistsAllAggregatesWithDisjuncts.mdp",
"../data/dxl/minidump/Subquery-AnyAllAggregates.mdp",
#ifndef GPOS_32BIT
// TODO: - 05/14/2014: the plan generates a different plan only for
// 32-bit rhel
"../data/dxl/minidump/Join-With-Subq-Preds-2.mdp",
#endif // GPOS_32BIT
};
......
......@@ -463,12 +463,8 @@ CTreeMapTest::EresUnittest_FailedPlanEnumerationTests()
BOOL fMatchPlans = false;
BOOL fTestSpacePruning = false;
#if defined(GPOS_Darwin) || defined(GPOS_Linux)
// restrict plan matching to OsX and Linux to avoid arithmetic operations differences
// across systems
fMatchPlans = true;
fTestSpacePruning = true;
#endif // GPOS_Darwin || GPOS_Linux
// enable plan enumeration only if we match plans
CAutoTraceFlag atf1(EopttraceEnumeratePlans, fMatchPlans);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册