FreeBSD (on arm64): partial support, only -run works - WIP
This commit is contained in:
		
							parent
							
								
									eab324a7cf
								
							
						
					
					
						commit
						f48a9ed001
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		
							
								
								
									
										6
									
								
								libtcc.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								libtcc.c
									
										
									
									
									
								
							|  | @ -881,9 +881,13 @@ LIBTCCAPI TCCState *tcc_new(void) | ||||||
|     tcc_define_symbol(s, "__linux", NULL); |     tcc_define_symbol(s, "__linux", NULL); | ||||||
| # endif | # endif | ||||||
| # if defined(__FreeBSD__) | # if defined(__FreeBSD__) | ||||||
|     tcc_define_symbol(s, "__FreeBSD__", "__FreeBSD__"); |     tcc_define_symbol(s, "__FreeBSD__", "12"); | ||||||
|     /* No 'Thread Storage Local' on FreeBSD with tcc */ |     /* No 'Thread Storage Local' on FreeBSD with tcc */ | ||||||
|     tcc_define_symbol(s, "__NO_TLS", NULL); |     tcc_define_symbol(s, "__NO_TLS", NULL); | ||||||
|  | #   if defined(__aarch64__) | ||||||
|  |     /* FIXME, __int128_t is used by setjump */ | ||||||
|  |     tcc_define_symbol(s, "__int128_t", "struct { unsigned char _dummy[16]; }"); | ||||||
|  | #   endif | ||||||
| # endif | # endif | ||||||
| # if defined(__FreeBSD_kernel__) | # if defined(__FreeBSD_kernel__) | ||||||
|     tcc_define_symbol(s, "__FreeBSD_kernel__", NULL); |     tcc_define_symbol(s, "__FreeBSD_kernel__", NULL); | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								tccrun.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								tccrun.c
									
										
									
									
									
								
							|  | @ -678,6 +678,9 @@ static void rt_getcontext(ucontext_t *uc, rt_context *rc) | ||||||
| #elif defined(__arm__) | #elif defined(__arm__) | ||||||
|     rc->ip = uc->uc_mcontext.arm_pc; |     rc->ip = uc->uc_mcontext.arm_pc; | ||||||
|     rc->fp = uc->uc_mcontext.arm_fp; |     rc->fp = uc->uc_mcontext.arm_fp; | ||||||
|  | #elif defined(__aarch64__) && defined(__FreeBSD__) | ||||||
|  |     rc->ip = uc->uc_mcontext.mc_gpregs.gp_elr; /* aka REG_PC */ | ||||||
|  |     rc->fp = uc->uc_mcontext.mc_gpregs.gp_x[29]; | ||||||
| #elif defined(__aarch64__) | #elif defined(__aarch64__) | ||||||
|     rc->ip = uc->uc_mcontext.pc; |     rc->ip = uc->uc_mcontext.pc; | ||||||
|     rc->fp = uc->uc_mcontext.regs[29]; |     rc->fp = uc->uc_mcontext.regs[29]; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue