Fix build error in aarch64 (#511)
[platform/core/dotnet/launcher.git] / packaging / dotnet-launcher.spec
index f7d3298..3a99d4e 100644 (file)
@@ -112,11 +112,33 @@ export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
 %endif
 %endif
 
-%ifarch x86_64 aarch64
+%ifarch x86_64 aarch64 riscv64
 export CFLAGS+=" -DBIT64 -DHOST_64BIT "
 export CXXFLAGS+=" -DBIT64 -DHOST_64BIT "
 %endif
 
+# add define HOST_XXX to support pal.h becuase processor-specifc glue code is removed from latest code
+%ifarch %{arm}
+export CFLAGS+=" -DHOST_ARM "
+export CXXFLAGS+=" -DHOST_ARM "
+%endif
+%ifarch aarch64
+export CFLAGS+=" -DHOST_ARM64 "
+export CXXFLAGS+=" -DHOST_ARM64 "
+%endif
+%ifarch %{ix86}
+export CFLAGS+=" -DHOST_X86 "
+export CXXFLAGS+=" -DHOST_X86 "
+%endif
+%ifarch x86_64
+export CFLAGS+=" -DHOST_AMD64"
+export CXXFLAGS+=" -DHOST_AMD64 "
+%endif
+%ifarch riscv64
+export CFLAGS+=" -DHOST_RISCV64 "
+export CXXFLAGS+=" -DHOST_RISCV64 "
+%endif
+
 dotnet msbuild Managed /t:clean
 dotnet msbuild Managed /t:restore /p:RestoreSources=/nuget
 dotnet msbuild Managed /p:Configuration=Release