3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-24 13:18:56 +00:00

Make all compile under OpenBSD (#3423)

Co-authored-by: Josuah Demangeon <me@josuah.net>
This commit is contained in:
Miodrag Milanović 2022-07-27 14:16:46 +02:00 committed by GitHub
parent bc012995b4
commit 29a5947bf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 3 deletions

View file

@ -192,6 +192,13 @@ void yosys_atexit()
#endif
}
#if defined(__OpenBSD__)
namespace Yosys {
extern char *yosys_argv0;
extern char yosys_path[PATH_MAX];
};
#endif
int main(int argc, char **argv)
{
std::string frontend_command = "auto";
@ -498,6 +505,12 @@ int main(int argc, char **argv)
if (print_stats)
log_hasher = new SHA1;
#if defined(__OpenBSD__)
// save the executable origin for proc_self_dirname()
yosys_argv0 = argv[0];
realpath(yosys_argv0, yosys_path);
#endif
#if defined(__linux__)
// set stack size to >= 128 MB
{