On 11/09/15 11:32, Gavin Wraith wrote:
> I am trying to compile as a shared object, so.riscos, a piece of C code,
> riscoslib.c, that calls some short bits of machine code, in sys.o,
> which previously I had assembled with Objasm. I can get asasm to assemble to
> the elf file, sys.o, but the linker says:
>
> error: sys.o uses FPA instructions, whereas so.riscos does not
> error: sys.o uses hardware FP, whereas so.riscos uses software FP
> failed to merge target specific data of file sys.o
>
> Neither bits of code use any floating point whatsoever. So how do I
> tell the linker to calm down? What I want, for the project in general,
> is to use vfp in hardware for everything.
Although you don't use FP, you still have to ensure that all your object
files are marked as using the same FP model (I know it's a bit of a
pain).
When you assemble sys.o you can tell the assembler which FP to mark it
as using the -fpu option:
asasm -fpu=list
gives you the options; there's a lot more than I thought there'd be.
asasm -fpu=SoftVFP
seems the most likely candidate, but you may have to experiment.
> The linker also says of riscoslib.c:
> crt0.S:(.data+0x14): undefined reference to `main'
The linker thinks you're trying to create an executable rather than a
shared library. Pass option -shared to GCC when you link your library.
> No indeed, but it has a function "luaopen_riscos" which is supposed
> to be called after loading, to initialize itself. Is this something the
> linker needs to know? If so, how do I tell it?
No, the linker doesn't need to know this. luaopen_riscos will probably
be one of several functions that define the library's interface. When
the library is dlopen'd, the Lua runtime will use dlsym() to find the
address of a function within the library that returns a pointer to
a structure that defines this interface. luaopen_riscos can then be
called via this structure from the runtime.
Lee.
_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK
No comments:
Post a Comment