Opened 2 years ago

Closed 2 years ago

#7708 closed bug (fixed)

sys/cpuset.h cannot be found on FreeBSD

Reported by: kazu-yamamoto Owned by:
Priority: normal Milestone:
Component: Build System Version: 7.7
Keywords: Cc:
Operating System: FreeBSD Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Current "configure.ac" cannot detect "sys/cpuset.h" even if it exists on FreeBSD 9.1:

checking sys/cpuset.h presence... yes
configure: WARNING: sys/cpuset.h: present but cannot be compiled
configure: WARNING: sys/cpuset.h:     check for missing prerequisite headers?
configure: WARNING: sys/cpuset.h: see the Autoconf documentation
configure: WARNING: sys/cpuset.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/cpuset.h: proceeding with the compiler's result
configure: WARNING:     ## ----------------------------------------------- ##
configure: WARNING:     ## Report this to [email protected] ##
configure: WARNING:     ## ----------------------------------------------- ##
checking for sys/cpuset.h... no

This is because sys/param.h should be included in the test.

Attachments (1)

DIFF (1.1 KB) - added by kazu-yamamoto 2 years ago.
a patch for configure.ac

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by kazu-yamamoto

a patch for configure.ac

comment:1 Changed 2 years ago by kazu-yamamoto

The attached patch fixes this.

comment:2 Changed 2 years ago by igloo

  • difficulty set to Unknown
  • Status changed from new to patch

comment:3 Changed 2 years ago by kazu-yamamoto

What stops merging this patch?

comment:4 Changed 2 years ago by ezyang

I think probably people want to test the patch independently and make sure it works, but I don't have a BSD box handy for that :(

Question about a hunk:

+AC_CHECK_HEADERS([sys/cpuset.h], [], [],
+[[#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+]])

What is going on here?

comment:5 Changed 2 years ago by kazu-yamamoto

Manpage of cpuset_getaffinity() says:

#include <sys/param.h>
#include <sys/cpuset.h>

This bug happens because the check program only includes sys/cpuset.h. The patch first checks whether or not sys/param.h exist. If exists, check whether or not sys/cpuset.h exist with sys/param.h included.

comment:6 Changed 2 years ago by ian@…

commit 4a8e254cbc16b3a4f264c4dda15d8eeddd13abc7

Author: Ian Lynagh <[email protected]>
Date:   Fri Mar 1 00:50:47 2013 +0000

    Fix sys/cpuset.h on FreeBSD 9.1; patch from kazu-yamamoto; fixes #7708

 configure.ac |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

comment:7 Changed 2 years ago by igloo

  • Resolution set to fixed
  • Status changed from patch to closed

Applied, thanks!

Note: See TracTickets for help on using tickets.