mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	yosys: fix pyosys initialization segfault
This commit is contained in:
		
							parent
							
								
									799497ebba
								
							
						
					
					
						commit
						37e61b993a
					
				
					 2 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -547,12 +547,6 @@ void yosys_setup()
 | 
			
		|||
	if(already_setup)
 | 
			
		||||
		return;
 | 
			
		||||
	already_setup = true;
 | 
			
		||||
	init_share_dirname();
 | 
			
		||||
	init_abc_executable_name();
 | 
			
		||||
 | 
			
		||||
#define X(_id) RTLIL::ID::_id = "\\" # _id;
 | 
			
		||||
#include "kernel/constids.inc"
 | 
			
		||||
#undef X
 | 
			
		||||
 | 
			
		||||
#ifdef WITH_PYTHON
 | 
			
		||||
	// With Python 3.12, calling PyImport_AppendInittab on an already
 | 
			
		||||
| 
						 | 
				
			
			@ -566,6 +560,13 @@ void yosys_setup()
 | 
			
		|||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	init_share_dirname();
 | 
			
		||||
	init_abc_executable_name();
 | 
			
		||||
 | 
			
		||||
#define X(_id) RTLIL::ID::_id = "\\" # _id;
 | 
			
		||||
#include "kernel/constids.inc"
 | 
			
		||||
#undef X
 | 
			
		||||
 | 
			
		||||
	Pass::init_register();
 | 
			
		||||
	yosys_design = new RTLIL::Design;
 | 
			
		||||
	yosys_celltypes.setup();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -76,7 +76,7 @@ class libyosys_so_ext(Extension):
 | 
			
		|||
        # yosys-abc
 | 
			
		||||
        yosys_abc_target = os.path.join(pyosys_path, "yosys-abc")
 | 
			
		||||
        shutil.copy("yosys-abc", yosys_abc_target)
 | 
			
		||||
        bext.spawn(["strip", "-S", "yosys-abc"])
 | 
			
		||||
        bext.spawn(["strip", "-S", yosys_abc_target])
 | 
			
		||||
 | 
			
		||||
        # share directory
 | 
			
		||||
        share_target = os.path.join(pyosys_path, "share")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue