Page 1 of 1

LuaJIT OSX x64 Linker Options

Posted: Mon Jun 06, 2016 8:47 am
by grabiller
Hi,

I'm trying to bind LuaJIT (in fact Terra) to PB and so far everything is working correctly on Windows and Linux but not on Mac OSX.

In the LuaJIT documentation it is mentioned:
../.. If you're building a 64 bit application on OSX which links directly or indirectly against LuaJIT, you need to link your main executable with these flags:

Code: Select all

-pagezero_size 10000 -image_base 100000000
I think the issue comes from that so I've tried to include some linker options in a text file and set the file in the linker option file from the IDE compiler options.

The file contains one instruction per line as specified in the PB documentation:

Code: Select all

-pagezero_size 10000
-image_base 100000000
But still no success. In fact if I write some garbage in the linker options file I get no error from PB at compile time so I even wonder if the linker options file is even used.

Does anyone has some experience with linker options on Mac OSX or even perhaps with LuaJIT on Mac OSX ?

Cheers,
Guy.

Re: LuaJIT OSX x64 Linker Options

Posted: Mon Jun 06, 2016 10:27 am
by Keya
i dont have a direct answer for you sorry, but "image_base" and "pagezero_size" both sound like fields possibly in the (Mach) executable header -- i know ImageBase is in the Windows PE header for example, so perhaps you can just use some sort of binary editor to manually patch those two fields post-compile

Re: LuaJIT OSX x64 Linker Options

Posted: Mon Jun 06, 2016 12:12 pm
by grabiller
Good idea indeed. So far I've noticed there is a __PAGEZERO but not sure about image_base. I'll investigate further.

Meanwhile I would be interested to know if the linker options file is supposed to work on Mac OSX because whatever I put in there I get the same result, no different, no error, no warning. It seems it is not used at all but perhaps I'm overlooking something.