#!/bin/sh

# README.md recommends to run
# sed -i 's/-mgeneral-regs-only//' /lib/modules/$(uname -r)/build/arch/arm64/Makefile
# to build this code on aarch64.
# core/rtw_mp.c:31:5: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types
# We cannot modify it like this, so making a wrapper script that will remove this flag.
# Putting this script into /usr/libexec/rtl8821cu/gcc and setting
# PATH=/usr/libexec/rtl8821cu:$PATH

exec /usr/bin/gcc $(echo "$@" | sed -e 's,-mgeneral-regs-only,,g')
