lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I took Alex's suggestion and it almost worked.  The resulting dummy.so
consisted of only 1800+ bytes instead of 160000+ as before.  The command
"lua -v -ldummy" did also produce the desired "hello" message.

BUT it also now produces the message "Illegal instruction(coredump)."

Below is a detailed report of these results. (The command line prompt is a
$, preceded by a line showing the current directory).

:/mydirectory/lua-5.1/src
$ xlc -bnoquiet -G -bnoentry -o dummy.so -qmkshrobj dummy.c
(ld): halt 4
(ld): setopt noautoexp
(ld): setopt rtl
(ld): setopt nortllib
(ld): setopt symbolic:0
(ld): lrgpage 0
(ld): savename dummy.so
(ld): filelist 2 2
(ld): setopt noprogram
(ld): noentry
NOENTRY: There is no entry point.
(ld): i dummy.o
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libc.a[shr.o]: 2562 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[posix_aio.o]: 17 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 5 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 2
(ld): exports /tmp/xlcSEK2icye
EXPORTS: Symbols exported: 1
(ld): resolve
RESOLVE: 7 of 2978 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 3 symbols.
(ld): mismatch
MISMATCH: No type mismatches exist.
(ld): comprld
COMPRLD: Kept 12 of 12 relocation entries.
(ld): origin page 0x10000000 0x20000000
(ld): save SRE .
SAVE: Section sizes = 249+31+0 (0xF9+0x1F+0x0 hex)
SAVE: Size of TOC: 16 (0x10 hex)
(ld): rc
RC: Highest return code was 0.
:/mydirectory/lua-5.1/src
$ lua
Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
>
:/mydirectory/lua-5.1/src
$ lua -v -ldummy
Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
hello from dummy
Illegal instruction(coredump)
:/mydirectory/lua-5.1/src
$

Mark F. Morss
Principal Analyst, Market Risk
American Electric Power



                                                                           
             Mike Pall                                                     
             <mikelu-0602@mike                                             
             .de>                                                       To 
             Sent by:                  Lua list                            
             lua-bounces@bazar         <lua@bazar2.conectiva.com.br>       
             2.conectiva.com.b                                          cc 
             r                                                             
                                                                   Subject 
                                       Re: SUCCESS installing Lua 5.1 on   
             02/15/2006 10:41          AIX 5.2                             
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
                 Lua list                                                  
             <lua@bazar2.conec                                             
               tiva.com.br>                                                
                                                                           
                                                                           




Hi,

Alex Queiroz wrote:
> On 2/14/06, mfmorss@aep.com <mfmorss@aep.com> wrote:
> > xlc -I/mydirectory/include -L/mydirector/lib -llua -lm -o dummy.so
> > -qmkshrobj dummy.c
>
>      There may be a problem, tough. The whole Lua library is being
> linked into the dummy module, which is undesirable. This can quickly
> take much space if you are going to use lots of modules.

There are more problems because the different instances of the
Lua core don't know of each other but compare pointers to globals.
This leads to subtle failure scenarios.

It's mentioned on the Wiki:

  http://lua-users.org/wiki/BuildingModules
  Section: "Do Not Link Modules to the Lua Core Libraries"

I'd like to add a definitive solution for AIX + xlc to the page.
Please keep us updated.

Bye,
     Mike