Subject: pkg/33949: 2006Q1,2006Q2 lang/spidermonkey fails to build on 3.0/amd64
To: None <,,>
From: Rhialto <>
List: pkgsrc-bugs
Date: 07/08/2006 13:35:00
>Number:         33949
>Category:       pkg
>Synopsis:       lang/spidermonkey fails to build on 3.0/amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 08 13:35:00 +0000 2006
>Originator:     Rhialto
>Release:        NetBSD 3.0
System: NetBSD 3.0 NetBSD 3.0 (Radls Doordringend Onjuiste Akkoord) #0: Sat Jan 28 16:44:07 CET 2006 amd64
Architecture: x86_64
Machine: amd64
	This was already an issue for 2006Q1; it still is.

Date: Tue, 4 Apr 2006 22:29:44 +0200
From: Rhialto <>
Subject: 2006Q1 lang/spidermonkey fails to build on 3.0/amd64
Message-ID: <>

cc -o pkgsrc_DBG.OBJ/jsopcode.o -c -O2 -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  jsopcode.c
cc -o pkgsrc_DBG.OBJ/jsparse.o -c -O2 -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  jsparse.c
jsparse.c: In function `FunctionDef':
jsparse.c:781: warning: cast to pointer from integer of different size
cc -o pkgsrc_DBG.OBJ/jsprf.o -c -O2 -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE   -DDEBUG -DDEBUG_root -DEDITLINE -Ipkgsrc_DBG.OBJ  jsprf.c
jsprf.c: In function `BuildArgArray':
jsprf.c:620: error: incompatible types in assignment
gmake[1]: *** [pkgsrc_DBG.OBJ/jsprf.o] Error 1
gmake[1]: Leaving directory `/pkg_comp/obj/pkgsrc/lang/spidermonkey/default/js/src'
gmake: *** [all] Error 2
*** Error code 2

make: stopped in /usr/pkgsrc/lang/spidermonkey

The offending line reads:

        VARARGS_ASSIGN(nas[cn].ap, ap); 

VARARGS_ASSIGN is defined like this (red alert!)

** Note: on some platforms va_list is defined as an array,
** and requires array notation.
#define VARARGS_ASSIGN(foo, bar)        VA_COPY(foo,bar)
#elif defined(HAVE_VA_LIST_AS_ARRAY)
#define VARARGS_ASSIGN(foo, bar)        foo[0] = bar[0]
#define VARARGS_ASSIGN(foo, bar)        (foo) = (bar)

since C99 defines va_copy and therefore should be used.

There is a file that seems to set compiler options for VA_COPY:

./js/src/config/ += -DHAVE_VA_COPY -DVA_COPY=va_copy

but apparently these flags are not really passed to the compiler, for
the only file where it is relevant.

If I work around that, the next hurdle is about PIC:

a - pkgsrc_DBG.OBJ/jsxdrapi.o
a - pkgsrc_DBG.OBJ/prmjtime.o
echo pkgsrc_DBG.OBJ/libjs.a
ld -shared  -o pkgsrc_DBG.OBJ/ pkgsrc_DBG.OBJ/jsapi.o pkgsrc_DBG.OBJ/jsarena.o pkgsrc_DBG.OBJ/jsarray.o pkgsrc_DBG.OBJ/jsatom.o pkgsrc_DBG.OBJ/jsbool.o pkgsrc_DBG.OBJ/jscntxt.o pkgsrc_DBG.OBJ/jsdate.o pkgsrc_DBG.OBJ/jsdbgapi.o pkgsrc_DBG.OBJ/jsdhash.o pkgsrc_DBG.OBJ/jsdtoa.o pkgsrc_DBG.OBJ/jsemit.o pkgsrc_DBG.OBJ/jsexn.o pkgsrc_DBG.OBJ/jsfun.o pkgsrc_DBG.OBJ/jsgc.o pkgsrc_DBG.OBJ/jshash.o pkgsrc_DBG.OBJ/jsinterp.o pkgsrc_DBG.OBJ/jslock.o pkgsrc_DBG.OBJ/jslog2.o pkgsrc_DBG.OBJ/jslong.o pkgsrc_DBG.OBJ/jsmath.o pkgsrc_DBG.OBJ/jsnum.o pkgsrc_DBG.OBJ/jsobj.o pkgsrc_DBG.OBJ/jsopcode.o pkgsrc_DBG.OBJ/jsparse.o pkgsrc_DBG.OBJ/jsprf.o pkgsrc_DBG.OBJ/jsregexp.o pkgsrc_DBG.OBJ/jsscan.o pkgsrc_DBG.OBJ/jsscope.o pkgsrc_DBG.OBJ/jsscript.o pkgsrc_DBG.OBJ/jsstr.o pkgsrc_DBG.OBJ/jsutil.o pkgsrc_DBG.OBJ/jsxdrapi.o pkgsrc_DBG.OBJ/prmjtime.o   -lm -Lfdlibm/pkgsrc_DBG.OBJ -lfdm
/usr/bin/ld: pkgsrc_DBG.OBJ/jsapi.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
pkgsrc_DBG.OBJ/jsapi.o: could not read symbols: Bad value
gmake[1]: *** [pkgsrc_DBG.OBJ/] Error 1
gmake[1]: Leaving directory `/pkg_comp/obj/pkgsrc/lang/spidermonkey/default/js/src'
gmake: *** [all] Error 2
*** Error code 2

There are more errors, like

cat: ../../dist/pkgsrc_DBG.OBJ/nspr/Version: No such file or directory
gmake[1]: Circular jscpucfg.h <- pkgsrc_DBG.OBJ/jsautocfg.h dependency dropped.
gmake[1]: Circular pkgsrc_DBG.OBJ/jsautocfg.h <- pkgsrc_DBG.OBJ/jsautocfg.h dependency dropped.

	see above

I give up for the moment - but this package is required by avidemux. 

___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/        -- Cetero censeo "authored" delendum esse.