Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cygwin compatibility #4794

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix Cygwin compatibility #4794

wants to merge 2 commits into from

Conversation

KrystalDelusion
Copy link
Member

What are the reasons/motivation for this change?
Cygwin builds currently fail with two errors, one due to an overzealous compatibility check in libs/fst; the other in kernel/mem.cc due to redefining addr_t which is a system type.

Explain how this is achieved.
Drop __CYGWIN__ from the mmap compatibility check in libs/fst.
Remove the addr_t redefinition, instead using MemContents::addr_t where needed.

If applicable, please suggest to reviewers how they can test the change.

Avoid error:
```
kernel/mem.cc:1683:7: error: conflicting declaration ‘using addr_t = using addr_t = uint32_t’
 1683 | using addr_t = MemContents::addr_t;
      |       ^~~~~~
In file included from /usr/include/sys/types.h:222,
                 from /usr/include/pthread.h:11,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr.h:148,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/ext/atomicity.h:35,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/cow_string.h:37,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/basic_string.h:51,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/string:53,
                 from ./kernel/yosys_common.h:27,
                 from ./kernel/yosys.h:42,
                 from ./kernel/mem.h:23,
                 from kernel/mem.cc:20:
/usr/include/machine/types.h:63:15: note: previous declaration as ‘typedef char* addr_t’
   63 | typedef char *addr_t;
```

According to IntelliSense, only the return types need to be prefixed with `MemContents::`, the rest are automagically using the class definition and highlight as `using Yosys::MemContents::addr_t = uint32_t`.
Copy link
Collaborator

@Ravenslofty Ravenslofty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we can Just Merge It.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants