On 15/09/15 09:38, Gavin Wraith wrote:
>> Looks like we're on the right track.
>
> Yes, the interpreter now compiles. For making my sample plugin "riscos"
> I am just using an Obeyfile with
>
> dir <Obey$dir>
> gcc -std=gnu99 -fPIC -O2 -Wall -Wextra -mfpu=vfp -DRISCOS -o so/riscos riscoslib.c sys.s -Wl,-E liblua
gcc -std=gnu99 -fPIC -O2 -Wall -Wextra -mfpu=vfp -DRISCOS -o so/riscos
riscoslib.c sys.s -shared
> but when I run it I get (apart from a warning about a possibly uninitialized variable in
> a switch statement - which is OK) the error
>
> .... In function `crt1_data':
> crt0.S:(.data+0x14): undefined reference to `main'
> collect2: error: ld returned 1 exit status
>
> I am evidently omitting some flag to say that it is supposed to be a plugin, without a
> main function. There is no 'main' in riscoslib.c or sys.s or in any of the sources
> that make liblua.
Option "-shared" is the one that tells GCC to create a shared library.
I've also removed liblua, as you want to use what's in the
interpreter rather than link another copy into the plugin.
The -Wl,-E exports the dynamic symbols from the interpreter and should
be included on the interpreter's link line rather than the plugin's.
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