Skip to content

Commit

Permalink
Merge pull request #4675 from YosysHQ/emil/pyosys-fix-segfault
Browse files Browse the repository at this point in the history
yosys: fix pyosys initialization segfault
  • Loading branch information
widlarizer authored Nov 1, 2024
2 parents 8fb73e1 + 37e61b9 commit b2d7858
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions kernel/yosys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def custom_build(self, bext: build_ext):
# 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")
Expand Down

0 comments on commit b2d7858

Please sign in to comment.