Ticket #1843 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

NetBSD fails compiling sysmem.c

Reported by: doughera Owned by:
Priority: normal Milestone: 2.10
Component: none Version: 2.10.0
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform:

Description

On NetBSD, attempting to build r49810 fails with the following message:

config/gen/platform/generic/sysmem.c: In function 'Parrot_sysmem_amount':
config/gen/platform/generic/sysmem.c:44: error: '_SC_AVPHYS_PAGES' undeclared (first use in this function)

I suspect that OpenBSD and DragonflyBSD will also suffer the same fate.

One workaround would be to make manual identical copies of config/gen/platform/freebsd/sysmem.c in the netbsd, openbsd, and dragonfly directories. I think a better fix would be to have Configure.pl check for sysctl(3) and then augment the generic sysmem.c file with the approppriate code protected by the appropriate #ifdef HAS_SYSCTL conditionals.

Attachments

Change History

in reply to: ↑ description   Changed 4 years ago by doughera

  • patch set to new

Replying to doughera:

I suspect that OpenBSD and DragonflyBSD will also suffer the same fate.

OpenBSD 4.8, at least, does have sysconf , and so will build fine.

One workaround would be to make manual identical copies of config/gen/platform/freebsd/sysmem.c in the netbsd, openbsd, and dragonfly directories.

This workaround was implemented for NetBSD only in commit c35e562750c6cac15a07bbdd90128a085f89f15e , so NetBSD will work again in 2.11. I'm not sure why OpenBSD and DragonflyBSD were omitted.

I think a better fix would be to have Configure.pl check for sysctl(3) and then augment the generic sysmem.c file with the approppriate code protected by the appropriate #ifdef HAS_SYSCTL conditionals.

I still think this is the better plan going forward, and have attached a patch to implement this strategy. Since modifying Configure.pl to probe for sysctl(3) today would have been too much of a hassle, I just went with what was easy to test, but it's probably good enough.

  Changed 4 years ago by dukeleto

  • status changed from new to closed
  • resolution set to fixed
  • patch changed from new to applied

Committed in 72908f9b2e536dd3af440874c0b4a8e6090ae1e3

Thanks for the patch!

Note: See TracTickets for help on using tickets.