Page MenuHomePhabricator

modding luasandbox
Closed, InvalidPublic

Description

I will gratefully accept a hint on the following subject.

When I want to add some libraries (e.g., rex-pcre) to Lua environment provided by luasandbox, I edit library.c. I also need to link the .so (tried .a but failed) file that contains the definition of the new function that I refer to in library.c.

Under HHVM (and therefore C++), I edited the HHVM_LINK_LIBRARIES directive in config.cmake adding /usr/lib/x86_64-linux-gnu/liblua5.1-rex-pcre.so to achieve this. But under PHP 7.1 (pure C), config.cmake is, I guess, irrelevant.

My question is: in which file of luasandbox distribution can I inject a reference to an additional library for the C linker? Or is there an altogether neater way to fo it?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 23 2017, 3:04 PM

Found a more correct way to link extra libraries:

For PHP:

phpize && ./configure LDFLAGS="-L/usr/lib/x86_64-linux-gnu" LIBS="-llua5.1-rex-pcre" && sudo make install

For HHVM:

hphpize && cmake . -DCMAKE_CXX_STANDARD_LIBRARIES="-llua5.1 -llua5.1-rex-pcre" && sudo make install

My question is: in which file of luasandbox distribution can I inject a reference to an additional library for the C linker? Or is there an altogether neater way to fo it?

This sounds like a support question and not like a bug report or feature request which Phabricator is meant for?
Or is this a request to enhance the documentation (if yes, where exactly would you expect this to be documented)?

Formally, this is a request to enhance documentation on linking extra libraries to luasandbox. But if there is no such feature (which, I suspect is the case), then I think this can be closed as resolved by myself.

alex-mashin closed this task as Resolved.Sep 24 2017, 4:51 AM
Aklapper changed the task status from Resolved to Invalid.Sep 24 2017, 12:45 PM

Nothing fixed, hence nothing resolved :)