From 35f51948dd0ec61bd91d0bf7338a4b89bd874b4e Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 24 Oct 2021 16:34:48 +0200 Subject: [PATCH] Do not attempt to compile raw contextes when HAVE_RAW_CONTEXTS is not defined This was failing on Debian x32 at least. No idea of why is now broken, but trying to build simgrid v3.29 on x32 raised the cmake message "Disable fast raw contexts on x32 ABI" and then failed with: [ 95%] Linking CXX shared library lib/libsimgrid.so /usr/bin/cmake -E cmake_link_script CMakeFiles/simgrid.dir/link.txt --verbose=1 (very long c++ command line, listing all .o files) /tmp/ccRaRl4N.s: Assembler messages: /tmp/ccRaRl4N.s:23: Error: unsupported syntax for `ret' /tmp/ccRaRl4N.s:31: Error: invalid instruction suffix for `push' /tmp/ccRaRl4N.s:32: Error: invalid instruction suffix for `push' /tmp/ccRaRl4N.s:33: Error: invalid instruction suffix for `push' /tmp/ccRaRl4N.s:34: Error: invalid instruction suffix for `push' /tmp/ccRaRl4N.s:37: Error: invalid instruction suffix for `pop' /tmp/ccRaRl4N.s:38: Error: invalid instruction suffix for `pop' /tmp/ccRaRl4N.s:39: Error: invalid instruction suffix for `pop' /tmp/ccRaRl4N.s:40: Error: invalid instruction suffix for `pop' /tmp/ccRaRl4N.s:41: Error: unsupported syntax for `ret' lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status --- src/kernel/context/ContextRaw.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 9dedc92189..6360dc8d42 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -20,6 +20,8 @@ extern "C" void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context); // TODO, we should handle FP, MMX and the x87 control-word (for x86 and x86_64) +#if HAVE_RAW_CONTEXTS + #if SIMGRID_PROCESSOR_x86_64 __asm__ ( #if defined(__APPLE__) @@ -160,7 +162,10 @@ __asm__ ( " retl\n" ); #else +#error HAVE_RAW_CONTEXTS defined, but neither SIMGRID_PROCESSOR_x86_64 nor SIMGRID_PROCESSOR_i686. Please update the code. +#endif +#else /* not HAVE_RAW_CONTEXTS */ /* If you implement raw contexts for other processors, don't forget to update the definition of HAVE_RAW_CONTEXTS in tools/cmake/CompleteInFiles.cmake */ -- 2.20.1