Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As of Alchemy v0.5a, when compiling memcpy/memmove/memset the LLVM frontend will sometimes (on Mac OS X) emit intermediate code that the Alchemy backend linker can't handle. It will crash with the "cannot yet select" error.</p> <p>The workaround is either to compile on a different platform (Ubuntu, Windows) or to override the implementations of memcpy/memmove/memset:</p> <pre><code>static void * custom_memmove( void * destination, const void * source, size_t num ) { void *result; __asm__("%0 memmove(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); return result; } static void * custom_memcpy ( void * destination, const void * source, size_t num ) { void *result; __asm__("%0 memcpy(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); return result; } static void * custom_memset ( void * ptr, int value, size_t num ) { void *result; __asm__("%0 memset(%1, %2, %3)\n" : "=r"(result) : "r"(ptr), "r"(value), "r"(num)); return result; } #define memmove custom_memmove #define memcpy custom_memcpy #define memset custom_memset </code></pre> <p>Unfortunately this workaround requires putting the above code (via a #include) into every module that uses memcpy.</p> <p>Ultimately, I injected the memcpy/memset/memmove workarounds by overriding string.h (using -I and <a href="http://www.delorie.com/gnu/docs/gcc/cpp_11.html" rel="nofollow noreferrer">#include_next</a>), but this required hacking the achacks/gcc script so that the -I flags are processed in the right order:</p> <pre><code>sub dash_I { my $arg = (shift); my $path; if($arg =~ /-I=?(.*)/) { $path = $1 } else { $path = shift(ARGV) } my $ppath = $incmap{$path}; my @pathes = $ppath ? @$ppath : ($path); # BUGFIX: insert user -I header search paths # early so that they override the system search paths # #push(@compile, map { "-I$_" } @pathes); splice(@compile, 1, 0, map { "-I$_" } @pathes); 0 } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload