Skip to content

Instantly share code, notes, and snippets.

@dg1sbg
Last active January 31, 2022 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dg1sbg/2f997df6bd4183578aae24b02663bd73 to your computer and use it in GitHub Desktop.
Save dg1sbg/2f997df6bd4183578aae24b02663bd73 to your computer and use it in GitHub Desktop.
SDL is cloned from Github into /opt/sdl and itself buids fine.
My test script:
#!/bin/bash
# set -x
C2FFI_EXE="c2ffi"
CLANG_VERSION=12
LLVM_VERSION=12
CLANG_INCLUDE_DIR="/usr/lib/clang/$CLANG_VERSION/include"
LLVM_INCLUDE_DIR="/usr/lib/llvm-$LLVM_VERSION/include"
SYS_INCLUDE_DIR="/usr/include"
SDL_H_FILE="/opt/common-lisp/quicklisp/dists/quicklisp/software/cl-sdl2-20211230-git/src/spec/SDL2.h"
MACRO_FILE="/home/frgo/tmp/macros.c"
ARCHITECTURE="aarch64-pc-linux-gnu"
SDL_INCLUDE_DIR="/opt/sdl/include"
C2FFI_DRIVER="null"
LOG_FILE="/home/frgo/tmp/c2ffi.log"
$C2FFI_EXE $SDL_H_FILE \
-D $C2FFI_DRIVER \
-M $MACRO_FILE \
-A $ARCHITECTURE \
-i $SYS_INCLUDE_DIR \
-i $CLANG_INCLUDE_DIR \
-i $LLVM_INCLUDE_DIR \
-i $SDL_INCLUDE_DIR 2>&1 > $LOG_FILE
Running this gives:
  ~/tmp ❯ ./c2ffi.sh frgo@goeded01  09:44:24
In file included from /opt/common-lisp/quicklisp/dists/quicklisp/software/cl-sdl2-20211230-git/src/spec/SDL2.h:1:
In file included from /opt/sdl/include/SDL2/SDL.h:38:
In file included from /opt/sdl/include/SDL2/SDL_cpuinfo.h:81:
/usr/lib/llvm-12/lib/clang/12.0.0/include/arm_neon.h:1730:47: error: passing 'int8x16_t' (aka 'signed char') to parameter of incompatible type '__attribute__((__vector_size__(16 * sizeof(signed char)))) signed char' (vector of 16 'signed char' values)
__ret = (uint8x16_t) __builtin_neon_vabdq_v((int8x16_t)__p0, (int8x16_t)__p1, 48);
... loads more of similar error messages.
@dg1sbg
Copy link
Author

dg1sbg commented Jan 31, 2022

Solution: Put the following content in SDL2.h:

#define SDL_DISABLE_ARM_NEON_H 1
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment