www-client/elinks-0.12_pre5-r1 fails to link. Reproducible: Always related: bug #350256 and bug #349660
Created attachment 277099 [details] build log build.log. the error: lib.o: In function `continue_download': download.c:(.text+0x7b171): warning: the use of `tempnam' is dangerous, better use `mkstemp' lib.o: In function `setup_safeguard.clone.0': spidermonkey.c:(.text+0x45426): undefined reference to `JS_SetOperationCallback
Created attachment 277101 [details] emerge --info
(In reply to comment #2) > Created attachment 277101 [details] > emerge --info What version of spidermonkey do you have installed on your system?
spidermonkey 1.9.2.15
This undefined reference seems to originate from the patch ".../elinks/files/elinks-0.12pre5-spidermonkey-callback.patch". Which seems to be for >=dev-lang/spidermonkey-1.9 (=dev-lang/spidermonkey-1.9.2.15). You can view the elinks/Changelog and see who committed the patch (and contact them?) -- maybe they misspelled the function name? I've commented out this patch within the elinks-0.12_pre5-r1.ebuild, and Elinks seems to build fine now here now, but have not tested Javascript functionality at all. I'm not sure why the person committed the previous stated patch. (On a side note, I now keep seeing portage wanting to rebuild elinks, even after it was already built -- complaining and wanting emerge -pv @preserved-rebuild. I'm sure this side issue is either nothing or miniscule. My notes for the time being, to lead you all in the right direction!)
This bug is induced by a leftover spidermonkey-1.7.0 "/usr/lib/libjs.so" file. See Spidermonkey Bug #372041. Manually move or remove it (mv/rm). (Spidermonkey-1.9.2.15 no longer has a "/usr/lib/libjs.so" file.) Then rebuild ELinks with the usual callback.patch.
After the suppression of libjs.so elinks compiles and links fine. The following script (a simple redirection with a timeOut) is supported. http://www.tizag.com/javascriptT/examples/timedelay.php
Javascript redirect works here on x86, too.
Thanks for the solution! Same here [amd64 / 64bit]: qlist spidermonkey|grep libjs: /usr/lib64/libjs.so /usr/lib64/libjs_static.a qlist spidermonkey|grep libjs|xargs rm USE=threadsafe emerge -vtq spidermonkey <<< HERE I HAVE TO ADMIT THAT I ALSO CHANGED THE threadsafe useflag... don't know if this changes the behaviour of the ebuild to generate [or not] the libjs.so file... ... but I guess not... qlist spidermonkey|grep libjs: /usr/lib64/libjs_static.a And then www-client/elinks-0.12_pre5-r1 compiled fine!
This bug can be closed, but be weary of other users who may have an orphaned libjs.so file to remaining on their system, elinks will then fail to compile. I'm marking as resolved-obsolete as this may have occurred by compiling using an old spidermonkey-1.7.0 ebuild, but was later fixed. Either manually removing the file, or reinstalling spidermonkey-1.7.0 and then upgrading to spidermonkey-1.9 should reclaim and remove the file after the upgrade to spidermonkey-1.9.