Opened 13 years ago

Closed 13 years ago

#30076 closed defect (fixed)

boehmgc build fails on Tiger/PowerPC (error: 'MAP_ANON' undeclared) due to the configure.cppflags-append line

Reported by: vinc17@… Owned by: waqar@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia)
Port: boehmgc

Description

The build fails on Tiger with the error:

 /usr/bin/gcc-4.0 -DPACKAGE_NAME=\"gc\" -DPACKAGE_TARNAME=\"gc\" -DPACKAGE_VERSION=\"7.1\" "-DPACKAGE_STRING=\"gc 7.1\"" -DPACKAGE_BUGREPORT=\"Hans.Boehm@hp.com\" -DGC_VERSION_MAJOR=7 -DGC_VERSION_MINOR=1 -DPACKAGE=\"gc\" -DVERSION=\"7.1\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DHAS_PPC_THREAD_STATE_R0=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DGC_GCJ_SUPPORT=1 -DJAVA_FINALIZATION=1 -DATOMIC_UNCOLLECTABLE=1 -I./include -I/opt/local/include -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -fexceptions -I libatomic_ops/src -pipe -O2 -arch ppc -MT os_dep.lo -MD -MP -MF .deps/os_dep.Tpo -c os_dep.c  -fno-common -DPIC -o .libs/os_dep.o
os_dep.c: In function 'GC_unix_mmap_get_mem':
os_dep.c:1780: error: 'MAP_ANON' undeclared (first use in this function)
os_dep.c:1780: error: (Each undeclared identifier is reported only once
os_dep.c:1780: error: for each function it appears in.)
os_dep.c: In function 'GC_read_dirty':
os_dep.c:3063: warning: incompatible implicit declaration of built-in function 'bcopy'
os_dep.c:3065: warning: incompatible implicit declaration of built-in function 'bzero'

The problem seems to come from missing header inclusion. Version 7.1_0 was already installed, and the only significant change (excluding x86, as I have a PowerPC machine) is the new line:

configure.cppflags-append -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE

in Portfile. If I comment out this line, the build succeeds.

Change History (4)

comment:1 Changed 13 years ago by vinc17@…

Cc: jeremyhu@… added

Added jeremyhu to Cc, as the bug comes from r79740 (BTW, the real change does much more than what the log message says). There was a comment for darwin 11:

        # BUILD FIX TODO:
        # llvm-gcc-4.2 and clang fail to build os_dep.c as of 2011.06.15
        # This is an error in the package.
        configure.compiler gcc-4.2

and this may be the same problem as this is os_dep.c that fails (though gcc from Xcode is used). So, either the configure.cflags-append line should be dropped (this works) or a recent compiler should be used (not tried).

The configure.cflags-append line comes from r79504, but I saw no build problems without it.

comment:2 Changed 13 years ago by vinc17@…

Summary: Build fails on Tiger/PowerPC (error: 'MAP_ANON' undeclared) due to the configure.cppflags-append lineboehmgc build fails on Tiger/PowerPC (error: 'MAP_ANON' undeclared) due to the configure.cppflags-append line

comment:3 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

  • I moved it from cflags to cppflags for correctness.
  • -D_XOPEN_SOURCE is not a valid #define. You must specify a value for _XOPEN_SOURCE.
  • -D_DARWIN_C_SOURCE is wanted to pull in darwin extensions to POSIX (which is what was intended).

_XOPEN_SOURCE is only provided to deal with boehmgc's use of very-deprecated functionality from ucontext.h

MAP_ANON is defined in sys/mman.h, it is not POSIX and is thus pulled in with -D_DARWIN_C_SOURCE

How is MAP_ANON conditionally declared on Tiger? Maybe it really does need the -D_NONSTD_SOURCE on Tiger ... ?

comment:4 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

ugg, Tiger has it only if !_POSIX_C_SOURCE, and _POSIX_C_SOURCE is defined with _XOPEN_SOURCE ... lucky for us, we don't need _XOPEN_SOURCE on Tiger for its ucontext.h

r80260

Note: See TracTickets for help on using tickets.