Index: /trunk/ccl/lisp-kernel/x86-spentry64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 4948)
+++ /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 4949)
@@ -186,5 +186,6 @@
 _startfn(C(misc_ref_common))
 	__(movzbl %imm1_b,%imm1_l)
-	__(jmp *local_label(misc_ref_jmp)(,%imm1,8))
+        __(lea local_label(misc_ref_jmp)(%rip),%temp2)
+	__(jmp *(%temp2,%imm1,8))
 	.p2align 3
 local_label(misc_ref_jmp):	
@@ -620,5 +621,6 @@
 _startfn(C(misc_set_common))
 	__(movzbl %imm1_b,%imm1_l)
-	__(jmp *local_label(misc_set_jmp)(,%imm1,8))
+        __(lea local_label(misc_set_jmp)(%rip),%temp2)
+	__(jmp *(%temp2,%imm1,8))
 	.p2align 3
 local_label(misc_set_jmp):		
@@ -1720,5 +1722,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp0,%imm1,8))
+        __(lock)
+        __(btsq %imm0,(%temp0,%imm1,8))
         __(jmp *%ra0)
 _endsubp(rplaca)
@@ -1741,5 +1744,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp0,%imm1,8))
+        __(lock)
+        __(btsq %imm0,(%temp0,%imm1,8))
         __(jmp *%ra0)
 _endsubp(rplacd)
@@ -1765,5 +1769,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp0,%imm1,8))
+        __(lock) 
+        __(btsq %imm0,(%temp0,%imm1,8))
         __(jmp *%ra0)                
 _endsubp(gvset)
@@ -1791,5 +1796,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp0,%imm1,8))
+        __(lock)
+        __( btsq %imm0,(%temp0,%imm1,8))
         /* Now memoize the address of the hash vector   */
         __(movq %arg_x,%imm0)
@@ -1800,5 +1806,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp0,%imm1,8))
+        __(lock)
+        __(btsq %imm0,(%temp0,%imm1,8))
         __(jmp *%ra0)                
 _endsubp(set_hash_key)
@@ -1818,5 +1825,6 @@
 	__(movq %temp1,%imm0)
 	__(jne 3f)
-	__(lock cmpxchgq %arg_z,(%arg_x,%imm1))
+	__(lock)
+        __(cmpxchgq %arg_z,(%arg_x,%imm1))
         .globl C(egc_store_node_conditional_success_test)
 C(egc_store_node_conditional_success_test):
@@ -1832,5 +1840,6 @@
         __(shrq $bitmap_shift,%imm1)
         __(xorb $63,%imm0_b)
-        __(lock btsq %imm0,(%temp1,%imm1,8))
+        __(lock)
+        __(btsq %imm0,(%temp1,%imm1,8))
         .globl C(egc_write_barrier_end)
 C(egc_write_barrier_end):
@@ -4194,8 +4203,10 @@
 	__(push %rbx)
 	__(push %rbp)
-	/* TCR initialized for lisp ?   */
-	__(movq %fs:current_tcr@TPOFF+tcr.linear,%rax)
-	__(testq %rax,%rax)
-	__(jne 1f)
+        __ifdef([HAVE_TLS])
+	 /* TCR initialized for lisp ?   */
+	 __(movq %fs:current_tcr@TPOFF+tcr.linear,%rax)
+	 __(testq %rax,%rax)
+	 __(jne 1f)
+        __endif
 	__(movq %r11,%r12)
 	__(ref_global(get_tcr,%rax))
