免费帕斯卡尔为Android在MIPS [英] Free Pascal for Android on MIPS

查看:275
本文介绍了免费帕斯卡尔为Android在MIPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图端口一个Delphi库到Android。免费帕斯卡尔拥有的Andr​​oid / ARM的支持 - 一个prebuilt编译器Windows可用。不过,Android NDK现在支持MIPS和x86也是如此。什么是支持那些在FPC的状态?现在,我的项目是多还是少的CPU无关 - 本机位是建立在所有四个支持的体系结构。不想放手的那个。

Trying to port a Delphi library to Android. Free Pascal has Android/ARM support - a prebuilt compiler for Windows is available. However, Android NDK now supports MIPS and x86 as well. What's the status of support for those in FPC? For now, my project is more or less CPU agnostic - the native bits are built for all four supported architectures. Don't want to let go of that.

我不是Android开发在帕斯卡的完整周期之后 - 只是一个算法库,不进行I / O操作。我试着将其转化为与P2C C,但译者扼流圈的来源。

I'm not after the full cycle of Android development in Pascal - just an algorithm library that does no I/O. I tried translating it into C with p2c, but the translator chokes on the sources.

我是不是应该尝试建立交叉编译器的Linux相关的CPU,然后对NDK库链接?

Should I just try and build cross-compiler for the relevant CPU with Linux, and then link against the NDK libraries?

编辑:我已经建立了交叉编译器的Intel / Linux的Andr​​oid的分支的来源。它的工作原理,但你必须调用 ppcross386 来编译,不是 FPC 。后者,似乎忽略了-Tlinux选项,并调用英特尔/ Win32的编译器。

I've built the cross-compiler for Intel/Linux from the sources of the Android branch. It works, except you have to invoke ppcross386 to compile, not fpc. The latter, it seems, ignores the -Tlinux option and invokes the Intel/Win32 compiler.

EDIT2:用一个小的变化,以makefile文件和消息人士透露,MIPS交叉编译器生成。然而,随着建设转移到跨CPU RTL,就出现了错误几乎马上。

with a small change to the makefile and sources, the MIPS cross-compiler builds. However, as building moves on to the cross-CPU RTL, it errors out almost right away.

推荐答案

编辑,最后:为Android / MIPSEL编译的目标是支持在FPC主干可用。导出最新,构建交叉编译器,code了。

EDIT, finally: support for Android/MIPSEL compilation target is available in the FPC trunk. Export the latest, build the crosscompiler, code away.

虽然MIPS ISA支持,可以在这里和那里发现了FP来源,这不是官方没有完成。等待2.7版本。

While support for MIPS ISA can be found here and there in the FP sources, it's not officially done yet. Waiting for the 2.7 release.

在此期间,有在树干编译为Java字节code 的支持,它的记录在FP维基。也许我可以利用作为一个权宜之计...

In the meantime, there's support for compiling to Java bytecode in the trunk, it's documented in the FP wiki. Maybe I can leverage that as a stopgap...

编辑:免费帕斯卡尔在JVM工作一般于Android,但它的规则有所不同经常帕斯卡。编译为JVM否则正确帕斯卡尔conks出来。因此,它不适合移植未与JVM考虑在首位的书面遗产帕斯卡尔code的大型机构。

Free Pascal over JVM works in general on Android, but its rules are somewhat different from regular Pascal. Otherwise correct Pascal conks out when compiled to JVM. So it's unfit for porting large bodies of legacy Pascal code that was not written with JVM in mind in the first place.

编辑:我得到了MIPS / Android的我FPC项目的工作,但我的食谱不适合一般消费,因为帕斯卡RTL的使用在我的项目的范围是非常有限的。它涉及到交叉编译从帕斯卡MIPS组件(针对MIPSEL / Linux上,在FPC主干可用),然后喂生成的程序集源NDK的编译系统,沿着帕斯卡RTL的有限子集的C /组件重新实现提供。

I got my FPC project working on MIPS/Android, but my recipe is not fit for general consumption, because the scope of Pascal RTL usage in my project is very limited. It involves cross-compiling from Pascal to MIPS assembly (targeting MIPSEL/Linux, available in the FPC trunk), then feeding the generated assembly sources to the NDK build system, providing along a C/assembly reimplementation of a limited subset of Pascal RTL.

帕斯卡尔RTL的整个身体是大而可怕的。我的解决方案,其中涉及从头开始重新实现帕斯卡尔RTL在C,是,好,普遍适用的对立面。

The whole body of Pascal RTL is big and scary. My solution, which involves reimplementing the Pascal RTL in C from scratch, is, well, the opposite of generally applicable.

这篇关于免费帕斯卡尔为Android在MIPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆