Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 448228 - =sys-auth/polkit-0.110 with dev-lang/spidermonkey-1.8.7-r3 - .../work/polkit-0.109/src/polkitbackend/polkitbackendjsauthority.c:1370: undefined reference to `JSVAL_VOID'
Summary: =sys-auth/polkit-0.110 with dev-lang/spidermonkey-1.8.7-r3 - .../work/polkit-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Nirbheek Chauhan (RETIRED)
URL: http://cgit.freedesktop.org/polkit/co...
Whiteboard:
Keywords:
Depends on:
Blocks: mozjs187
  Show dependency tree
 
Reported: 2012-12-22 21:45 UTC by Christian Apeltauer
Modified: 2013-05-15 23:02 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
1356126031-install-sys-auth_polkit-0.109:0::gentoo.out (1356126031-install-sys-auth_polkit-0.109:0::gentoo.out,76.57 KB, text/plain)
2012-12-22 21:45 UTC, Christian Apeltauer
Details
output of paludis info polkit (info,13.17 KB, text/plain)
2012-12-22 21:46 UTC, Christian Apeltauer
Details
let polkit-0.110 compile with spidermonkey-1.8.7 (polkit-0.110-libjs.patch,491 bytes, patch)
2013-03-16 16:09 UTC, Alex Efros
Details | Diff
polkit-0.110-spidermonkey-187.patch (polkit-0.110-spidermonkey-187.patch,2.05 KB, patch)
2013-03-27 13:42 UTC, Richard Grenville
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Apeltauer 2012-12-22 21:45:21 UTC
sys-auth/polkit-0.109 fails to build with dev-lang/spidermonkey-1.8.7-r3 on hardened-amd64 because of undefined reference to JSVAL_VOID/JSVAL_NULL

Reproducible: Always
Comment 1 Christian Apeltauer 2012-12-22 21:45:54 UTC
Created attachment 333084 [details]
1356126031-install-sys-auth_polkit-0.109:0::gentoo.out
Comment 2 Christian Apeltauer 2012-12-22 21:46:21 UTC
Created attachment 333086 [details]
output of paludis info polkit
Comment 3 Jory A. Pratt gentoo-dev 2012-12-23 01:22:30 UTC
Dynamically load libmozjs185.so and cope with it not being available

http://cgit.freedesktop.org/polkit/commit/?id=34cb6353b9affd6c04ea480df5fc39d0ca72319d


So upstream is the reason for the breakage.
Comment 4 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2012-12-29 06:40:18 UTC
(In reply to comment #3)
> So upstream is the reason for the breakage.

So, what is next step to fix this issue? Should someone of us create issue on freedesktop's tracker (if it is exist), or should someone add spidermonkey:0/mozjs185 in pokit's deps? Or, may be, patch the sources to dlopen() 1.8.7? ;)
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2012-12-29 08:23:14 UTC
1. inherit flag-o-matic toolchain-funcs
2. Add these 2 lines to the start of src_configure() function:

has_version '>=dev-lang/spidermonkey-1.8.7' && \
append-ldflags "$($(tc-getPKG_CONFIG) --libs mozjs187)" #448228

Now it will compile, believe it or not, but it's wrongly linking against -lmozjs187 since it's supposed to be dlopen()'d now

FTR: -Wl,--as-needed has nothing to do with this, it seems

So I believe the problem lies somewhere in js/jsapi.h of spidermonkey, maybe with 'extern' of JSVAL_VOID, JSVAL_NULL, and more if something else comes up after sorting those out
Comment 6 Maxim Kammerer 2013-01-23 16:39:12 UTC
Is it possible to port USE=jit to 0/mozjs185 in the meanwhile? It is probably the reason that users on hardened prefer the masked 0/mozjs187.
Comment 7 brho 2013-01-24 22:57:24 UTC
Also fails to build on unhardened 32 bit x86, polkit-0.110, spidermonkey-1.8.7.
Comment 8 Martin Benz 2013-02-03 11:12:18 UTC
Can you finally do something? Never had a package not building for several versions and for such a long time, frustrating to see that nothing is done... ^^

And if you post "solutions" please post them correctly, copy past of those 2 lines won't work (I knwo what's wrong but please try yourself).
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2013-02-03 11:33:36 UTC
(In reply to comment #8)
> Can you finally do something? Never had a package not building for several
> versions and for such a long time, frustrating to see that nothing is
> done... ^^
> 
> And if you post "solutions" please post them correctly, copy past of those 2
> lines won't work (I knwo what's wrong but please try yourself).

Got a patch? This is not high priority as spidermonkey 1.8.7 is still in package.mask
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-02-03 11:36:02 UTC
(In reply to comment #8)
> And if you post "solutions" please post them correctly, copy past of those 2
> lines won't work (I knwo what's wrong but please try yourself).

And the workaround mentioned earlier in this bug is no longer valid. It used to work, but not for polkit-0.110 anymore.
While waiting for new one...
Comment 11 Maxim Kammerer 2013-02-03 11:47:25 UTC
(In reply to comment #9)
> This is not high priority as spidermonkey 1.8.7 is still in
> package.mask

It is high priority on hardened, hence my suggestion to backport USE=jit in comment #6.
Comment 12 Alex Efros 2013-03-16 16:09:06 UTC
Created attachment 342280 [details, diff]
let polkit-0.110 compile with spidermonkey-1.8.7
Comment 13 Alex Efros 2013-03-16 16:14:25 UTC
I'm not sure my patch is right way to go - because it will force polkitd to depend on libmozjs while I got impression polkit wanted to load libmozjs dynamically only if it needed - but it fix compile error on hardeded system with 1.8.7. Of course, you'll also include this patch in ebuild:

--- /usr/portage/sys-auth/polkit/polkit-0.110.ebuild	2013-03-12 13:31:30.000000000 +0200
+++ /usr/local/portage/sys-auth/polkit/polkit-0.110.ebuild	2013-03-16 18:05:47.020410365 +0200
@@ -58,6 +58,7 @@
 
 src_prepare() {
 	epatch "${FILESDIR}"/${P}-W_define.patch
+	epatch "${FILESDIR}"/${P}-libjs.patch
 
 	sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2013-03-16 16:20:39 UTC
(In reply to comment #12)
> Created attachment 342280 [details, diff] [details, diff]
> let polkit-0.110 compile with spidermonkey-1.8.7

The library is opened using dlopen() and should not be linked against. This patch is not correct, and is not going to Portage as is.

I ended up with same patch as workaround on my machine :-) Thanks for adding it here for others to use as workaround too.
Comment 15 Richard Grenville 2013-03-27 13:42:57 UTC
Created attachment 343429 [details, diff]
polkit-0.110-spidermonkey-187.patch

A patch that makes sys-auth/polkit-0.110 compile with spidermonkey-1.8.7... But not necessarily work with. I wrote it because of a request from another user, and I have not the slightest knowledge about polkit or spidermonkey. Basically my idea is to load the symbols of JSVAL_* global variables like all other dynamically loaded symbols in the patch.

Within my test polkit did run correctly, and pmap shows libmozjs187.so is loaded. Tried compiling with clang and didn't notice a related warning. No error on syslog as far as I could see. As I never use polkit myself, nonetheless, I do not know whether it works, and for any consequences of using the patch I cannot be liable.
Comment 16 Bertrand Jacquin 2013-04-26 23:46:14 UTC
Applying the following commit from master git fix it :

 f102bda3ced9958ed16df3e1885d6c086c675a41
 9943e730d0d7f26a239834a07acb3bc3039ba57c
 6bf958af19a1bfb1f6aacae869c7ace372d5c48b
 8ed4cb000ed420bf2f899770cab098dde96621f2
 0966ffc16bbd2998d7dad3064506e7a998d54bbb

Then add the following environnment variable :
 LDFLAGS=-lmozjs187 EXTRA_ECONF=--with-mozjs=auto

Everything is fine else
Comment 17 David Heidelberg (okias) 2013-04-30 21:37:08 UTC
Well, maybe it's different issue, but 
polkit-110 should be "<dev-lang/spidermonkey-1.8.8[-debug]"

I have to fix it everytime when update portage (otherwise it picks up new spidermonkey from mozilla portage, which is incompat)
Comment 18 Samuli Suominen (RETIRED) gentoo-dev 2013-05-15 23:02:42 UTC
Fixed in polkit-0.111 by added spidermonkey-17.0 support, support for 1.8.7 won't be added