# Unresonable checks of Linux headers, while running CMake on FreeBSD 13

**URL:** https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539
**Category:** Usage
**Created:** [January 13, 2021, 10:10pm UTC](https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539 "2021-01-13T22:10:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Serdyuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ivan_serdyuk/32/217_2.png) [@Ivan\_Serdyuk](https://discourse.cmake.org/u/Ivan_Serdyuk)
#### Post date: [January 13, 2021, 10:10pm UTC](https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539/1 "2021-01-13T22:10:56Z")

</div>

Hello.  
I am experiencing some inappropriate behavior of CMake (apparently cause of both lack of platform specific patch and due to a need to re-write project specific build rules).

Some headers have no sense on BSD systems. The current issue is more about specifically kqueue versus epoll headers.

I wasn’t to reference Github’s issue directly - but an opened one has an ID 42282.

So while building gollvm (FreeBSD 13.0, x86\_64) I got this:

> CMake Error at **tools/gollvm/cmake/modules/AutoGenGo.cmake:389** (message):  
> \*\*\* struct epoll\_event data.fd offset unknown  
> Call Stack (most recent call first):  
> **tools/gollvm/libgo/CMakeLists.txt:323** (mkepoll)  
> This shouldn’t be even considered, since epoll is present on Linux (but not on FreeBSD).  
> Instead it has check for kqueue.  
> The above Github issue contains the list of libgo’s source files, some which depend on kqueue.  
> Despite the fact that gollvm project has CMake’s configuration as a replacement of “configure” and autotools - ensuring that libgo’s C files would compiled, by probing via some dummy, should be enough.  
> I wouldn’t expect anything expect an abort, if the probed sample source file wouldn’t compile.

---

<div class="post-metadata">

### Author: ![bill.hoffman](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bill.hoffman/32/13_2.png) [@bill.hoffman](https://discourse.cmake.org/u/bill.hoffman)
#### Post date: [January 13, 2021, 10:40pm UTC](https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539/2 "2021-01-13T22:40:54Z")

</div>

These are the issues you are referring to:

> <https://github.com/golang/go/issues/42282>
>
> Hi.
> I was investigating current blocking issues, on FreeBSD 13.0.
> $cmake -DCMAKE\_CXX\_FLAGS=' -I~/workarea/freebsd\_src/include ' -DCMAKE\_C\_FLAGS=' -I~/workarea/freebsd\_src/include ' ../
> 
> \-- The C compiler identification is...

  

> **[gollvm - Git at Google](https://go.googlesource.com/gollvm/)**

This looks like a libgo CMakeLists.txt issue and not an issue with CMake itself AFAIK.

---

<div class="post-metadata">

### Author: ![Ivan\_Serdyuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ivan_serdyuk/32/217_2.png) [@Ivan\_Serdyuk](https://discourse.cmake.org/u/Ivan_Serdyuk)
#### Post date: [March 22, 2021, 8:29pm UTC](https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539/3 "2021-03-22T20:29:22Z")

</div>

I see that this script is working, on FreeBSD 12.0 Aarch64:

[https://github.com/skroll/cmake-modules/blob/master/modules/CheckKqueue.cmake](https://github.com/skroll/cmake-modules/blob/master/modules/CheckKqueue.cmake)

> $ git clone [GitHub - skroll/cmake-modules: A collection of CMake modules to simplify projects.](https://github.com/skroll/cmake-modules)  
> Cloning into ‘cmake-modules’…  
> remote: Enumerating objects: 24, done.  
> remote: Counting objects: 100% (24/24), done.  
> remote: Compressing objects: 100% (15/15), done.  
> remote: Total 24 (delta 9), reused 24 (delta 9), pack-reused 0  
> Receiving objects: 100% (24/24), done.  
> Resolving deltas: 100% (9/9), done.  
> $ cd cmake-modules  
> $ ls  
> CMakeLists.txt README.md modules  
> $ mkdir build  
> $ cd build  
> $ cmake …  
> – The C compiler identification is Clang 8.0.1  
> – The CXX compiler identification is Clang 8.0.1  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – Check for working C compiler: /usr/bin/cc - skipped  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – Check for working CXX compiler: /usr/bin/c++ - skipped  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done  
> CMake Deprecation Warning at CMakeLists.txt:2 (cmake\_minimum\_required):  
> Compatibility with CMake \< 2.8.12 will be removed from a future version of  
> CMake.
> 
> Update the VERSION argument value or use a … suffix to tell  
> CMake that the project does not need compatibility with older versions.
> 
> – Check if the system supports kqueue  
> – Looking for kqueue  
> – Looking for kqueue - found  
> – Check if the system supports kqueue - yes  
> – Check if the system supports epoll  
> – Looking for epoll\_create  
> – Looking for epoll\_create - not found  
> – Check if the system supports epoll - no  
> – Configuring done  
> – Generating done  
> – Build files have been written to: /usr/home/oceanfish81/cmake-modules/build

> $ uname -a  
> FreeBSD ams1-c1-large-arm-01 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC arm64

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [March 23, 2021, 6:54am UTC](https://discourse.cmake.org/t/unresonable-checks-of-linux-headers-while-running-cmake-on-freebsd-13/2539/4 "2021-03-23T06:54:01Z")

</div>

I don’t see checking any headers in that log.  
But if you’re referring to the “epoll” - it’s not CMake itself - it’s the project that decides to check for it. From the other hand this is the role of this system - to check for stuff and setup build accordingly.
