[racket] Racket without thread-local storage?

From: Juan Francisco Cantero Hurtado (iam at juanfra.info)
Date: Mon Feb 25 19:30:18 EST 2013

Hi. I have this issue when I compile racket with GCC 4.2 on OpenBSD:

cd ../foreign; make all
make foreign.lo
/usr/bin/libtool --mode=compile --tag=CC cc -O2 -pipe -g 
-I/usr/local/include -I/usr/X11R6/include -DMZ_USE_JIT_SSE 
-I/usr/local/include -pthread    -DMZ_USES_SHARED_LIB  -I./../racket 
-I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/include -I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/src 
   -c /usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/foreign.c -o 
foreign.lo
cc -O2 -pipe -g -I/usr/local/include -I/usr/X11R6/include 
-DMZ_USE_JIT_SSE -I/usr/local/include -pthread -DMZ_USES_SHARED_LIB 
-I./../racket 
-I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/include -I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/src 
-c /usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/foreign.c -fPIC 
-DPIC -o .libs/foreign.o
In file included from 
/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/include/scheme.h:1169,
                  from 
/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/src/schpriv.h:22,
                  from 
/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/foreign.c:10:
/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/include/schthread.h:483: 
error: thread-local storage not supported for this target
Error while executing cc -O2 -pipe -g -I/usr/local/include 
-I/usr/X11R6/include -DMZ_USE_JIT_SSE -I/usr/local/include -pthread 
-DMZ_USES_SHARED_LIB -I./../racket 
-I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/include -I/usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/../racket/src 
-c /usr/ports/pobj/racket-5.3.3/racket-5.3.3/src/foreign/foreign.c -fPIC 
-DPIC -o .libs/foreign.o
*** Error 2 in foreign (Makefile:43 'foreign.lo')
*** Error 1 in foreign (Makefile:18 'all')
*** Error 1 in racket (Makefile:130 'foreign-stuff')
*** Error 1 in racket (Makefile:76 'common')
*** Error 1 in racket (Makefile:79 'cgc')
*** Error 1 in racket (Makefile:85 '3m')
*** Error 1 in . (Makefile:40 '3m')
*** Error 1 in /usr/ports/pobj/racket-5.3.3/build-amd64 (Makefile:37 'all')


I know the problem is the lack of support for TLS on OpenBSD/GCC. Now I 
compile racket with GCC 4.6 because this version has TLS support 
emulated but I think this workaround is adding other bugs to racket. Is 
it possible to compile racket in a OS/compiler without thread-local 
storage?.

My configure options: --enable-libffi --enable-gracket --enable-jit 
--enable-foreign --enable-places --enable-float --enable-docs 
--enable-pthread --enable-lt=/usr/bin/libtool --enable-futures


Posted on the users mailing list.