--- /dev/null
+
+CC$(sm) := $(CC_COMMAND)
+CPP$(sm) := cpp
+LD$(sm) := ld
+AR$(sm) := llvm-ar
+NM$(sm) := llvm-nm
+OBJCOPY$(sm) := objcopy
+OBJDUMP$(sm) := objdump
+READELF$(sm) := llvm-readelf
+
+nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \
+ -print-file-name=include 2> /dev/null)
+
+# Get location of libgcc from gcc
+libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \
+ -print-libgcc-file-name 2> /dev/null)
+
+# Define these to something to discover accidental use
+CC := false
+CPP := false
+LD := false
+AR := false
+NM := false
+OBJCOPY := false
+OBJDUMP := false
+READELF := false
+nostdinc := --bad-nostdinc-variable
+libgcc := --bad-libgcc-variable
+
+
%define compile_arch CFG_WITH_VFP=n
%endif
-%define compile_flags CROSS_COMPILE="" CROSS_COMPILE64="" CFLAGS=-lgcc_eh CFG_LIBUTEE_TUI=n CFLAGS=-lgcc_eh CFG_LIBUTEE_TUI=n %{log_env} %{compile_arch}
+%define compile_flags CROSS_COMPILE="" CROSS_COMPILE64="" CFLAGS="-L%{_libdir}/gcc/%{_host}/6.2.1 -lgcc_eh" CFG_LIBUTEE_TUI=n %{log_env} %{compile_arch}
%define export_dir export-ta_arm%{__isa_bits}
%define out_export_dir opt/optee/
%setup -q
%build
+if echo "$CC" | grep -q clang ; then
+ export COMPILER="clang-cc"
+ export CC_COMMAND="$CC"
+fi
%{?asan:/usr/bin/gcc-unforce-options}
make %{compile_flags} PLATFORM=rpi3
make %{compile_flags} PLATFORM=s5p6818 out/arm-plat-s5p6818/core/tee.bin