From: Arnaud Giersch Date: Thu, 26 Sep 2013 13:04:35 +0000 (+0200) Subject: Determine assembly flavor at a single place. X-Git-Tag: v3_9_90~63^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a5700748e9db05e5e91e50c92cb3054f71b9b515?hp=ab4dd058e59625e67e29b3328b8aad99f6f90c27 Determine assembly flavor at a single place. In smx_context_raw.c, check if variable exists *and* has a nonnull value (and not only if it's defined). --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e5edbe63ca..b68c5034ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,10 +190,6 @@ endif() include_directories(${INCLUDES}) -### Determine the assembly flavor that we need today -include(CMakeDetermineSystem) -set(PROCESSOR_${CMAKE_SYSTEM_PROCESSOR} 1) - ### Setup Options include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Option.cmake) diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 02fb7356e3..319f8f0fc9 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -7,14 +7,15 @@ set(CMAKE_MODULE_PATH # x86 # i.86 +### Determine the assembly flavor that we need today +include(CMakeDetermineSystem) IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86") IF(${ARCH_32_BITS}) + message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)") set(PROCESSOR_i686 1) - message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}") ELSE() - message(STATUS "System processor: amd64") + message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)") set(PROCESSOR_x86_64 1) - set(PROCESSOR_i686 0) ENDIF() set(HAVE_RAWCTX 1) diff --git a/src/simix/smx_context_raw.c b/src/simix/smx_context_raw.c index bd78c9cff9..2fdb6d9d2c 100644 --- a/src/simix/smx_context_raw.c +++ b/src/simix/smx_context_raw.c @@ -44,7 +44,7 @@ extern raw_stack_t raw_makecontext(char* malloced_stack, int stack_size, rawctx_entry_point_t entry_point, void* arg); extern void raw_swapcontext(raw_stack_t* old, raw_stack_t new); -#ifdef PROCESSOR_x86_64 +#if PROCESSOR_x86_64 __asm__ ( #if defined(APPLE) ".text\n"