21.05 toolchain C tls variables compilation problem

Alexander Tormasov a.tormasov at innopolis.ru
Wed Jun 9 16:45:17 CEST 2021


found that key problem here is
> __thread G *g __asm__("" "runtime.g»);
in form of
> __thread G *g ;
it works, so, question - how to use this asm synonym for __thread variables in 10.3? 

> 9 июня 2021 г., в 17:01, Alexander Tormasov via users <users at lists.genode.org> написал(а):
> 
> small c file:
> 
> typedef int G;
> __thread G *g __asm__("" "runtime.g");
> G* runtime_g(void) __attribute__ ((noinline, no_split_stack));
> G* runtime_g(void) {  return g; }
> 
> during compilation using genode-x86-gcc 10.3 error in asm (and checked genode-x86-as as well):
> tt1.s: Assembler messages:
> tt1.s:22: Error: junk at end of line, first unrecognized character is `*'
> tt1.s:25: Error: unrecognized symbol type ""
> tt1.s:25: Error: junk at end of line, first unrecognized character is `*'
> tt1.s:26: Error: expected comma after name `__emutls_v.' in .size directive
> tt1.s:27: Error: invalid character '*' in mnemonic
> tt1.s:13: Error: invalid operands (*UND* and *UND* sections) for `*’
> 
> generated asm:
> 	.file	"tt1.c"
> 	.text
> 	.globl	runtime_g
> 	.type	runtime_g, @function
> runtime_g:
> .LFB0:
> 	.cfi_startproc
> 	pushq	%rbp
> 	.cfi_def_cfa_offset 16
> 	.cfi_offset 6, -16
> 	movq	%rsp, %rbp
> 	.cfi_def_cfa_register 6
> 	movl	$__emutls_v.*runtime.g, %edi
> 	call	__emutls_get_address
> 	movq	(%rax), %rax
> 	popq	%rbp
> 	.cfi_def_cfa 7, 8
> 	ret
> 	.cfi_endproc
> .LFE0:
> 	.size	runtime_g, .-runtime_g
> 	.globl	__emutls_v.*runtime.g
> ^^^^^^^ first error line ^^^^^^^^^^^^^^^^^
> 	.data
> 	.align 32
> 	.type	__emutls_v.*runtime.g, @object
> 	.size	__emutls_v.*runtime.g, 32
> __emutls_v.*runtime.g:
> 	.quad	8
> 	.quad	8
> 	.quad	0
> 	.quad	0
> 	.ident	"GCC: (GNU) 10.3.0"
> 
> 
> 
> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users



More information about the users mailing list