diff --git a/src/Makefile b/src/Makefile
index d2dba295f..3248e32d9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -904,22 +904,40 @@ WIN_PYTHON              := /opt/win-python
 CFLAGS_CROSS_LINUX      := $(CFLAGS)
 CFLAGS_CROSS_LINUX      += -fPIC
 CFLAGS_CROSS_LINUX      += -DWITH_HWMON
+
+ifneq (,$(findstring clang, $(CC_LINUX)))
+CFLAGS_CROSS_LINUX      += -Wno-typedef-redefinition -Wno-unknown-warning-option
+endif
+
 CFLAGS_CROSS_WIN        := $(CFLAGS)
 CFLAGS_CROSS_WIN        += -fPIC
 CFLAGS_CROSS_WIN        += -I$(WIN_ICONV)/include/
 CFLAGS_CROSS_WIN        += -DWITH_HWMON
 
+ifneq (,$(findstring clang, $(CC_WIN)))
+CFLAGS_CROSS_WIN        += --target=x86_64-w64-mingw32 -D__INTRINSIC_DEFINED__xgetbv=1 -Wno-typedef-redefinition -Wno-ignored-attributes -Wno-unknown-warning-option
+endif
+
 LFLAGS_CROSS_LINUX      := $(LFLAGS)
 LFLAGS_CROSS_LINUX      += -lpthread
 LFLAGS_CROSS_LINUX      += -ldl
 LFLAGS_CROSS_LINUX      += -lm
 LFLAGS_CROSS_WIN        := $(LFLAGS)
+
+ifeq (,$(findstring clang, $(CC_WIN)))
 LFLAGS_CROSS_WIN        += -Wl,--dynamicbase
 LFLAGS_CROSS_WIN        += -Wl,--nxcompat
+endif
+
 LFLAGS_CROSS_WIN        += -lpsapi
 LFLAGS_CROSS_WIN        += -lws2_32
 LFLAGS_CROSS_WIN        += -lpowrprof
-LFLAGS_CROSS_WIN        += -static -static-libgcc -static-libstdc++
+LFLAGS_CROSS_WIN        += -static -static-libgcc
+
+ifeq (,$(findstring clang, $(CC_WIN)))
+LFLAGS_CROSS_WIN        += -static-libstdc++
+endif
+
 LFLAGS_CROSS_WIN        += -lole32 -loleaut32 -lwbemuuid
 
 CFLAGS_LZMA_WIN         := $(CFLAGS_LZMA)
@@ -932,6 +950,7 @@ CFLAGS_LZMA_WIN         += -Wno-misleading-indentation
 
 CFLAGS_UNRAR_WIN        += -Wno-misleading-indentation
 CFLAGS_UNRAR_WIN        += -Wno-class-memaccess
+CFLAGS_UNRAR_WIN        += -Wno-unknown-attributes
 endif
 
 ifeq ($(IS_ARM),1)
