Linux64 port

11 views
Skip to first unread message

markc

unread,
Oct 24, 2010, 4:19:21 PM10/24/10
to jslibs
Is this ready yet?

I've checked out from svn but make all still tries to do a 32bit
build. Is there some flags I need to pass to make?

I keep looking at this project every now and then, for a couple of
years, but the lack of x86_64 support (linux and >4Gb ram) has been a
showstopper for me.

soubok

unread,
Oct 24, 2010, 4:42:46 PM10/24/10
to jsl...@googlegroups.com
Hi,

jslibs should compile properly on Linux64 (but I still have some issues at runtime that should be fixed quickly).
I recommend you to compile jslibs using waf (see http://code.google.com/p/jslibs/wiki/jslibsBuild#using_waf)
If you cannot use waf, I will have to update my Makefile.
The main difference between waf and Makefile is that waf script uses system libraries instead of jslibs/libs/* sources.

Franck.



markc

unread,
Oct 25, 2010, 8:39:45 PM10/25/10
to jslibs
Ah, it seems "BITS=64 make all" quicked the compile off but I ran into
this error with jshost about a missing JL_UNUSED. This is on Archlinux
x86_64 with gcc 4.5.1.

[...]
gcc -o plgetopt.o -c -fvisibility=hidden -Wall -pthread -O2 -fPIC
-UDEBUG -DNDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -
DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -D_GNU_SOURCE=1 -
DHAVE_FCNTL_FILE_LOCKING=1 -DLINUX=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1
-D_REENTRANT=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
-I../../../dist/include/nspr ../../../../src/lib/libc/src/plgetopt.c
rm -f libplc4.a
/usr/bin/ar cr libplc4.a ./plvrsion.o ./strlen.o ./strcpy.o ./
strdup.o ./strcase.o ./strcat.o ./strcmp.o ./strchr.o ./strpbrk.o ./
strstr.o ./strtok.o ./base64.o ./plerror.o ./plgetopt.o
ranlib libplc4.a
rm -f libplc4.so
gcc -shared -Wl,-soname -Wl,libplc4.so -o libplc4.so ./plvrsion.o ./
strlen.o ./strcpy.o ./strdup.o ./strcase.o ./strcat.o ./strcmp.o ./
strchr.o ./strpbrk.o ./strstr.o ./strtok.o ./base64.o ./plerror.o ./
plgetopt.o -L../../../dist/lib -lnspr4
/usr/bin/strip libplc4.so
../../../config/./nsinstall -R -m 444 ./libplc4.a ./
libplc4.so ../../../dist/lib
../../../config/./nsinstall -R -m 444 ./libplc4.so ../../../dist/bin
make[5]: Leaving directory `/home/markc/jslibs/libs/nspr/Linux_opt_64/
lib/libc/src'
make[4]: Leaving directory `/home/markc/jslibs/libs/nspr/Linux_opt_64/
lib/libc'
make[3]: Leaving directory `/home/markc/jslibs/libs/nspr/Linux_opt_64/
lib'
make[2]: Leaving directory `/home/markc/jslibs/libs/nspr/Linux_opt_64'
make[1]: Leaving directory `/home/markc/jslibs/libs/nspr'
make -C src/jshost all BUILD=opt BITS=64 DEST_DIR=/home/markc/jslibs/
Linux_64_opt/
make[1]: Entering directory `/home/markc/jslibs/src/jshost'
make -w -C ../host/ -f Makefile all
make[2]: Entering directory `/home/markc/jslibs/src/host'
mkdir -p Linux_opt_64/
gcc -c -I../common -I../../libs/js/Linux_opt_64/ -I../../libs/js/src -
Wall -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -Wno-
multichar -g0 -O3 -s -funroll-loops -m64 -fPIC -fno-exceptions -fno-
rtti -felide-constructors -o Linux_opt_64/host.o host.cpp
In file included from ../common/jlalloc.h:18:0,
from ../common/jlhelper.h:23,
from stdafx.h:17,
from host.cpp:15:
../common/jlplatform.h: In function 'int JLSemaphoreAcquire(sem_t*,
int)':
../common/jlplatform.h:1262:18: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLSemaphoreRelease(sem_t*)':
../common/jlplatform.h:1279:17: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLSemaphoreFree(sem_t**)':
../common/jlplatform.h:1294:15: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function '__JSMUtexHandler*
JLMutexCreate()':
../common/jlplatform.h:1341:17: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void
JLMutexFree(__JSMUtexHandler**)':
../common/jlplatform.h:1355:17: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void
JLMutexAcquire(__JSMUtexHandler*)':
../common/jlplatform.h:1370:17: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void
JLMutexRelease(__JSMUtexHandler*)':
../common/jlplatform.h:1383:17: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void
JLEventFree(__JLEventHandler**)':
../common/jlplatform.h:1743:15: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'int
JLEventWait(__JLEventHandler*, int)':
../common/jlplatform.h:1848:16: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLThreadFree(pthread_t**)':
../common/jlplatform.h:1938:16: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLThreadCancel(pthread_t*)':
../common/jlplatform.h:1966:15: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLThreadPriority(pthread_t*,
JLThreadPriorityType)':
../common/jlplatform.h:1988:15: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLThreadWait(pthread_t*,
unsigned int*)':
../common/jlplatform.h:2004:15: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'JLTLSKey JLTLSAllocKey()':
../common/jlplatform.h:2027:16: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLTLSFreeKey(JLTLSKey)':
../common/jlplatform.h:2045:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void JLTLSSet(JLTLSKey, void*)':
../common/jlplatform.h:2060:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlplatform.h: In function 'void
JLDynamicLibraryClose(void**)':
../common/jlplatform.h:2120:15: error: 'JL_UNUSED' was not declared in
this scope
In file included from ../../libs/js/src/jsinterp.h:48:0,
from ../../libs/js/src/jscntxt.h:56,
from ../common/jlhelper.h:32,
from stdafx.h:17,
from host.cpp:15:
../../libs/js/src/jsfun.h: In function 'js::ArgsPrivateNative*
js::GetArgsPrivateNative(JSObject*)':
../../libs/js/src/jsfun.h:291:52: warning: converting to non-pointer
type 'long unsigned int' from NULL
In file included from ../common/jlhelper.h:32:0,
from stdafx.h:17,
from host.cpp:15:
../../libs/js/src/jscntxt.h: In function 'JSContext*
js_ContextFromLinkField(JSCList*)':
../../libs/js/src/jscntxt.h:2686:44: warning: invalid access to non-
static data member 'JSContext::link' of NULL object
../../libs/js/src/jscntxt.h:2686:44: warning: (perhaps the 'offsetof'
macro was used incorrectly)
In file included from stdafx.h:17:0,
from host.cpp:15:
../common/jlhelper.h: In function 'void* JL_GetPrivate(const
JSContext*, const JSObject*)':
../common/jlhelper.h:480:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In function 'void JL_SetPrivate(const
JSContext*, JSObject*, void*)':
../common/jlhelper.h:486:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In function 'JSBool
JL_GetReservedSlot(JSContext*, JSObject*, uint32, jsval*)':
../common/jlhelper.h:492:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In function 'uint32_t JL_StackSize(const
JSContext*, const JSStackFrame*)':
../common/jlhelper.h:529:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In function 'bool JsvalIsScript(const
JSContext*, jsval)':
../common/jlhelper.h:632:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In function 'bool JsvalIsFunction(const
JSContext*, jsval)':
../common/jlhelper.h:638:14: error: 'JL_UNUSED' was not declared in
this scope
In file included from stdafx.h:17:0,
from host.cpp:15:
../common/jlhelper.h: In function 'JSBool BoolToJsval(JSContext*,
bool, jsval*)':
../common/jlhelper.h:1373:14: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In static member function 'static void
jl::CppAllocators::operator delete(void*, size_t)':
../common/jlhelper.h:2271:18: error: 'JL_UNUSED' was not declared in
this scope
../common/jlhelper.h: In static member function 'static void
jl::CppAllocators::operator delete [](void*, size_t)':
../common/jlhelper.h:2275:18: error: 'JL_UNUSED' was not declared in
this scope
make[2]: *** [Linux_opt_64/host.o] Error 1
make[2]: Leaving directory `/home/markc/jslibs/src/host'
make[1]: *** [../host/Makefile] Error 2
make[1]: Leaving directory `/home/markc/jslibs/src/jshost'
make: *** [src/jshost] Error 2

markc

unread,
Oct 25, 2010, 9:03:55 PM10/25/10
to jslibs
And FWIW...

~ ./waf configure --prefix=/usr
Checking for program gcc,cc : ok /usr/bin/gcc
Checking for program cpp : ok /usr/bin/cpp
Checking for program ar : ok /usr/bin/ar
Checking for program ranlib : ok /usr/bin/ranlib
Checking for program g++,c++ : ok /usr/bin/g++
Checking for xulrunner-nspr >= 4.8.2 : fail
Checking for sqlite3 >= 3.6.20 : ok
Checking for zlib >= 1.2.3 : ok
Checking for library iconv : ok
Checking for iconvlist function : not found
Checking for iconv const proto : fail
Checking for libtomcrypt >= 1.17 : fail
Checking for library tommath : not found
Checking for library fastcgi : ok
Checking for libpng >= 1.2.40 : ok
[...]
JL_DISABLED_MODULE: jsio (missing NSPR library) jscrypt (missing
Tomcrypt or Tommath libraries)

~ ll /usr/lib/*nspr* (v4.8.6)
-rw-r--r-- 1 root root 461276 Aug 18 00:49 /usr/lib/libnspr4.a
-rwxr-xr-x 1 root root 236792 Aug 18 00:49 /usr/lib/libnspr4.so

~ ll /usr/lib/libtomcrypt.a (v1.17)
-rwxr-xr-x 1 root wheel 1536422 Oct 26 10:30 /usr/lib/libtomcrypt.a

~ ll /usr/lib/libtfm.a (v0.12)
-rwxr-xr-x 1 root wheel 571008 Oct 26 10:29 /usr/lib/libtfm.a

Julien Charbon

unread,
Oct 26, 2010, 5:16:06 AM10/26/10
to jsl...@googlegroups.com, markc

Hi marc,

when testing NSPR development libraries waf use pkgconfig. Can you
check the result of this command on your side?

$ pkg-config --cflags --libs xulrunner-nspr

On my side it's:

$ pkg-config --cflags --libs xulrunner-nspr
-I/usr/include/nspr -lplds4 -lplc4 -lnspr4 -lpthread -ldl

And:

$ locate xulrunner-nspr.pc

On my side it's:

$ locate xulrunner-nspr.pc
/usr/lib/pkgconfig/xulrunner-nspr.pc

Same for tomcrypt:

$ pkg-config --cflags --libs libtomcrypt -ltomcrypt

For libtommath there is no pkgconfig file provided, thus waf just
check the header 'tommath.h' and successful compilation of the function
mp_init().

At least on Debian, every needed files are provided by the devel
packages of these libraries:

libnspr4-dev
libtomcrypt-dev
libtommath-dev

--
Julien

Reply all
Reply to author
Forward
0 new messages