Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing compile option -lrt when target is Linux #292

Open
spacelan opened this issue Jun 26, 2017 · 2 comments
Open

Missing compile option -lrt when target is Linux #292

spacelan opened this issue Jun 26, 2017 · 2 comments

Comments

@spacelan
Copy link

If not set, j2v8 may throw undefined reference to 'clock_gettime' at runtime

I added this option to https://github.com/eclipsesource/J2V8/blob/master/cmake/NodeJsUtils.cmake#L142 and solved this issue

set (njs_${config_name}_libs ${njs_libs} -lrt PARENT_SCOPE)
@irbull
Copy link
Member

irbull commented Jun 26, 2017

Some details about this flag here https://stackoverflow.com/questions/15821663/what-is-the-lrt-flag-in-gnu-make.

@drywolf Thoughts on this? do you know what platforms will need this flag?

@drywolf
Copy link
Contributor

drywolf commented Jun 26, 2017

Looks like the node.js source has some references to the clock_gettime function, so it would make sense that it needs to be included.
@irbull I had another look at the Dockerfiles you added to test the linux/android cross-builds and there you also made reference to librt. Also for the Android build there seem to be a couple of additional libraries that are linked, but will not report any hard linker errors if they are not included.

I had a quick look at some of the node.js build configs, and saw those libraries referenced as well in certain places. @irbull do you know how we could make sure that the necessary libraries are linked ? How did you figure out that -lrt might be needed for the linux build ?

drywolf added a commit to drywolf/J2V8 that referenced this issue Aug 2, 2017
matiwinnetou pushed a commit to matiwinnetou/J2V8 that referenced this issue Aug 16, 2017
irbull pushed a commit that referenced this issue Aug 28, 2017
irbull pushed a commit that referenced this issue Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants