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

[GBM] Unbreak on FreeBSD #17008

Merged
merged 2 commits into from Jan 13, 2020
Merged

[GBM] Unbreak on FreeBSD #17008

merged 2 commits into from Jan 13, 2020

Conversation

ghost
Copy link

@ghost ghost commented Dec 7, 2019

Description

  • Link with libepoll-shim [1] on FreeBSD. FreeBSD does not have epoll but there is a kqueue-based shim for it called epoll-shim. This allows the GBM platform to build and link properly on FreeBSD.
  • Use EPOLL_CLOEXEC for epoll1_create for now due to lack of features in epoll-shim [2]. It is not clear if this is appropriate for Linux or not, so I put this behind TARGET_FREEBSD for now.

[1] https://github.com/jiixyj/epoll-shim/
[2] https://github.com/jiixyj/epoll-shim/blob/9185474a4b382823cfaeaeaabfa75b277890c9e7/src/epoll.c#L97

How Has This Been Tested?

Build and run tested on FreeBSD. The patches are part of the kodi-devel package on FreeBSD.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

FreeBSD does not have epoll() but there is a kqueue-based shim for
it called epoll-shim.

This allows the GBM platform to build on FreeBSD.
@ghost ghost requested a review from lrusak as a code owner December 7, 2019 01:12
// epoll_create1() from libepoll-shim always fails with 0 and
// only supports EPOLL_CLOEXEC, so let's use that to make Kodi/GBM
// runnable on FreeBSD.
int epollFd = epoll_create1(EPOLL_CLOEXEC);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just make this the default and remove the ifdeffing? I'll give it a go on linux but I don't see why it wouldn't work.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, done.

Copy link
Author

Choose a reason for hiding this comment

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

So was it fine with EPOLL_CLOEXEC on Linux too?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems fine to me. I just tested it. Sorry for the delay. I just moved houses and finally set my workstation up again.

epoll_create1() from libepoll-shim always fails with 0 and only
supports EPOLL_CLOEXEC, so let's use that to make Kodi/GBM runnable
on FreeBSD.
@razzeee razzeee requested a review from lrusak December 15, 2019 15:38
@lrusak
Copy link
Contributor

lrusak commented Dec 19, 2019

jenkins build this please

@lrusak lrusak added this to the Matrix 19.0-alpha 1 milestone Dec 19, 2019
@ghost
Copy link
Author

ghost commented Dec 27, 2019

Thanks for testing and approving, @lrusak. What needs to happen next to get it merged?

@fritsch
Copy link
Member

fritsch commented Dec 27, 2019

jenkins build this please (something went wrong)

@ghost
Copy link
Author

ghost commented Jan 3, 2020

@fritsch It seems like something went wrong again with Jenkins?

@fritsch
Copy link
Member

fritsch commented Jan 3, 2020

jenkins build this please

@ghost
Copy link
Author

ghost commented Jan 5, 2020

Looks like the build was fine.

@ghost
Copy link
Author

ghost commented Jan 11, 2020

Ping?

@lrusak lrusak merged commit d827cd6 into xbmc:master Jan 13, 2020
@lrusak
Copy link
Contributor

lrusak commented Jan 13, 2020

Thanks for fixing this and sorry it took so long to merge! Hopefully in the future we can be more accommodating of FreeBSD changes now that our jenkins is building all green again 👍

Maven85 pushed a commit to Maven85/kodi that referenced this pull request Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants