Re: Porting libreoffice to riscv64 arch
Hi,
Am 22.05.22 um 16:06 schrieb Bo YU:
It seems it was passed for riscv64 bridge "build check". But it stops
at pdfium here:
```
In file included from
/<<PKGBUILDDIR>>/workdir/UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_font.h:16,
from
/<<PKGBUILDDIR>>/workdir/UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_docpagedata.h:14,
from
/<<PKGBUILDDIR>>/workdir/UnpackedTarball/pdfium/fpdfsdk/fpdf_dataavail.cpp:12:
/<<PKGBUILDDIR>>/workdir/UnpackedTarball/pdfium/build/build_config.h:127:2:
error: #error Please add support for your architecture in
build/build_config.h
127 | #error Please add support for your architecture in
build/build_config.h
| ^~~~~
[...]
But I have added riscv64 arch here:
```
--- a/external/pdfium/configs/build_config.h
+++ b/external/pdfium/configs/build_config.h
@@ -121,6 +121,8 @@
#elif defined(__m68k__)
#define ARCH_CPU_M68K 1
#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_RISCV64 1
+#define ARCH_CPU_64_BITS 1
#else
#error Please add support for your architecture in build/build_config.h
#endif
Which obviously can't work since you added it inside a #elif
defined(__m68k__) and so your definitions will never be done on risc64
and thus falls into the #else?
>ou need to add a new #elif.
https://wiki.debian.org/ArchitectureSpecificsMemo says _riscv &&
__riscv_xlen==64 is the symbols to check, so the trivial(!) patch would
actually be addding
#elif defined_riscv && __riscv_xlen==64
#define ARCH_CPU_RISCV64 1
#define ARCH_CPU_64_BITS 1
No idea whether something more is needed inside pdfium actually.
(Note that this file is gone in 7.4:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=71b952340726190d1f178ef0dadfa89677f2c1dd,
so patching this in 7.4 will be more interesting, I assume.
> It seems the build_config.h can not detect the cpu info.
It doesn't detect anything, it just defines variables, which you in fact
don't (see above).
Regards,
Rene
Reply to: