You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by James Peach <jp...@apache.org> on 2014/04/15 17:41:19 UTC

Re: git commit: TS-2711 Build with the include LuaJIT

On Apr 15, 2014, at 7:29 AM, zwoop@apache.org wrote:
...
> +# These are currently built separate, as part of building the lib/ tree, using
> +# the normal LuaJIT build system. We are using the .o's directly, instead of the
> +# luajit.a to avoid the linker from optimizing symbols away. We could maybe
> +# switch to using the luajit.so, but that involves making sure it installs safely
> +# and cleanly.

Can you elaborate on this?

> -if BUILD_LUA_SUPPORT
> +
> +# On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
> +# http://luajit.org/install.html.
> traffic_server_LDFLAGS += @LUA_LUAJIT_LDFLAGS@
> -endif

AFAICT nothing ever caused LUA_LUAJIT_LDFLAGS to be set.

> 
> traffic_logcat_SOURCES = logcat.cc
> traffic_logcat_LDFLAGS = @EXTRA_CXX_LDFLAGS@ @LIBTOOL_LINK_FLAGS@
> 


Re: git commit: TS-2711 Build with the include LuaJIT

Posted by James Peach <jp...@apache.org>.
On Apr 15, 2014, at 9:02 AM, Leif Hedstrom <zw...@apache.org> wrote:

> 
> On Apr 15, 2014, at 9:41 AM, James Peach <jp...@apache.org> wrote:
> 
>> On Apr 15, 2014, at 7:29 AM, zwoop@apache.org wrote:
>> ...
>>> +# These are currently built separate, as part of building the lib/ tree, using
>>> +# the normal LuaJIT build system. We are using the .o's directly, instead of the
>>> +# luajit.a to avoid the linker from optimizing symbols away. We could maybe
>>> +# switch to using the luajit.so, but that involves making sure it installs safely
>>> +# and cleanly.
>> 
>> Can you elaborate on this?
> 
> It doesn’t work with luajit.a, because it will optimize the symbols away. Installing a luajit.so would work, but we risk conflicting with system installs, so we’d want to rename it.

But why would that happen? If it's optimizing the symbols because they are not used, then that would stop once you start using them.

>>> -if BUILD_LUA_SUPPORT
>>> +
>>> +# On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
>>> +# http://luajit.org/install.html.
>>> traffic_server_LDFLAGS += @LUA_LUAJIT_LDFLAGS@
>>> -endif
>> 
>> AFAICT nothing ever caused LUA_LUAJIT_LDFLAGS to be set.
> 
> 
> 
> # On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
> # http://luajit.org/install.html.
> case $host_os in
>  darwin)
>    if test "x${enable_lua_support}" = "xLuaJIT"; then
>      LUA_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
>    fi
>    ;;
> esac
> 
> AC_SUBST(LUA_LUAJIT_LDFLAGS)
> 
> 
> This has not changed with this patch.

Is enable_lua_support ever set?

J

Re: git commit: TS-2711 Build with the include LuaJIT

Posted by Leif Hedstrom <zw...@apache.org>.
On Apr 15, 2014, at 10:02 AM, Leif Hedstrom <zw...@apache.org> wrote:

> 
>  darwin)
>    if test "x${enable_lua_support}" = "xLuaJIT"; then
>      LUA_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
>    fi
>    ;;
> esac
> 
> A


Oh duh, that if statement will obviously fail… Sigh.

Thanks!

— Leif


Re: git commit: TS-2711 Build with the include LuaJIT

Posted by Leif Hedstrom <zw...@apache.org>.
On Apr 15, 2014, at 9:41 AM, James Peach <jp...@apache.org> wrote:

> On Apr 15, 2014, at 7:29 AM, zwoop@apache.org wrote:
> ...
>> +# These are currently built separate, as part of building the lib/ tree, using
>> +# the normal LuaJIT build system. We are using the .o's directly, instead of the
>> +# luajit.a to avoid the linker from optimizing symbols away. We could maybe
>> +# switch to using the luajit.so, but that involves making sure it installs safely
>> +# and cleanly.
> 
> Can you elaborate on this?

It doesn’t work with luajit.a, because it will optimize the symbols away. Installing a luajit.so would work, but we risk conflicting with system installs, so we’d want to rename it.

> 
>> -if BUILD_LUA_SUPPORT
>> +
>> +# On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
>> +# http://luajit.org/install.html.
>> traffic_server_LDFLAGS += @LUA_LUAJIT_LDFLAGS@
>> -endif
> 
> AFAICT nothing ever caused LUA_LUAJIT_LDFLAGS to be set.



# On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
# http://luajit.org/install.html.
case $host_os in
  darwin)
    if test "x${enable_lua_support}" = "xLuaJIT"; then
      LUA_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
    fi
    ;;
esac

AC_SUBST(LUA_LUAJIT_LDFLAGS)


This has not changed with this patch.

— Leif