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 build in OpenBSD #1502

Closed
wants to merge 1 commit into from
Closed

Fix build in OpenBSD #1502

wants to merge 1 commit into from

Conversation

Rangi42
Copy link
Contributor

@Rangi42 Rangi42 commented Sep 13, 2024

Fixes #1111, which was filed in December 2022, regarding building RGBDS v0.6.1 on OpenBSD 7.2. We're now up to RGBDS post-0.8.0 and OpenBSD 7.5. We've also switched from C entirely to C++. If this continues to build on the far-most-common CI targets of *buntu Linux, Windows, and macOS, and this fixes it for OpenBSD, then I think we can safely get rid of defining _POSIX_C_SOURCE=200809L.

image

@Rangi42 Rangi42 added bug Unexpected behavior / crashes; to be fixed ASAP! builds This affects the build process or release artifacts labels Sep 13, 2024
@Rangi42 Rangi42 added this to the v0.9.0 milestone Sep 13, 2024
@Rangi42 Rangi42 requested a review from ISSOtm September 13, 2024 01:08
@Rangi42
Copy link
Contributor Author

Rangi42 commented Sep 15, 2024

See the discussion in google/flatbuffers#6205 and WebAssembly/wabt#1360 for what to potentially do about this.

@Rangi42
Copy link
Contributor Author

Rangi42 commented Sep 15, 2024

Okay, so just removing -D_POSIX_C_SOURCE=200809L breaks the build in Cygwin (tested on Windows 7):

image

I wanted to try detecting the OS (either to opt into the -D on Cygwin and MinGW, or opt out of it on BSD), but BSD make doesn't support that (although it can be done with cmake, using if(MINGW OR CYGWIN)).

Other possibilities:

  1. Require GNU make
  2. Close Build fails on OpenBSD 7.2 #1111 as wontfix.

@Rangi42 Rangi42 marked this pull request as draft September 17, 2024 22:51
@ISSOtm
Copy link
Member

ISSOtm commented Sep 18, 2024

A possible fix would be to stop relying on POSIX APIs, in this case, not using fdopen. I don't know how realistic that would be.

(Why do we use it instead of just stdout, anyway?)

@pinobatch
Copy link
Member

Might it be a measure to avoid adding $0D bytes before every $0A byte if writing binary output to stdout and it happens to be in text mode on Windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior / crashes; to be fixed ASAP! builds This affects the build process or release artifacts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails on OpenBSD 7.2
3 participants