LuaJIT OSX x64 Linker Options

Mac OSX specific forum
User avatar
grabiller
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Jun 01, 2011 9:38 am
Location: France - 89220 Rogny-Les-Septs-Ecluses
Contact:

LuaJIT OSX x64 Linker Options

Post 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.
guy rabiller | radfac founder / ceo | raafal.org
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: LuaJIT OSX x64 Linker Options

Post 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
User avatar
grabiller
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Jun 01, 2011 9:38 am
Location: France - 89220 Rogny-Les-Septs-Ecluses
Contact:

Re: LuaJIT OSX x64 Linker Options

Post 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.
guy rabiller | radfac founder / ceo | raafal.org
Post Reply