# Building for boehm-gc+threaded+redirect-7.1 Error



## enderli (Dec 15, 2009)

```
Options for boehm-gc+threaded+redirect 7.1
[X] REDIRECT       Define malloc(3)-family replacements
[ ] FULLDEBUG      Debugging support (see documentation)
[X] THREADING      POSIX thread support
[X] PARALLEL_MARK  Parallel-thread marking (faster for SMP)
```


```
In file included from ./include/private/gc_priv.h:68,
                 from allchblk.c:19:
./include/private/gcconfig.h:2329:5: error: #error "REDIRECT_MALLOC with THREADS works at most on Linux."
*** Error code 1

Stop in /usr/ports/devel/boehm-gc/work/gc-7.1.
*** Error code 1
```


----------



## enderli (Dec 17, 2009)

```
===>Configuring for boehm-gc+threaded+redirect-7.1
checking build system type... i386-portbld-freebsd8.0
checking host system type... i386-portbld-freebsd8.0
checking target system type... i386-portbld-freebsd8.0
checking GC version numbers... major=7 minor=1 
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking dependency style of cc... gcc3
checking whether cc understands -c and -o together... yes
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking for ar... ar
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
configure: WARNING: "FreeBSD does not yet fully support threads with Boehm GC."
checking for xlc... no
checking for dlopen in -ldl... no
checking whether to build shared libraries... yes
checking which machine-dependent code should be used... 
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... c++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... (cached) 262144
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... (cached) ar
checking for ranlib... (cached) ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd8.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by c++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking for c++ option to produce PIC... -fPIC
checking if c++ PIC flag -fPIC works... yes
checking if c++ static flag -static works... yes
checking if c++ supports -c -o file.o... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd8.0 ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking sys/dg_sys_info.h usability... no
checking sys/dg_sys_info.h presence... no
checking for sys/dg_sys_info.h... no
checking whether Solaris gcc optimization fix is necessary... no
checking atomic_ops.h usability... no
checking atomic_ops.h presence... no
checking for atomic_ops.h... no
configure: Using internal version of libatomic_ops
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bdw-gc.pc
config.status: executing depfiles commands
config.status: executing default commands
=== configuring in libatomic_ops (/usr/ports/devel/boehm-gc/work/gc-7.1/libatomic_ops)
configure: running /bin/sh ./configure '--prefix=/usr/local'  '--enable-cplusplus' '--disable-static' '--enable-threads=posix' '--enable-thread-local-alloc' '--enable-parallel-mark' '--enable-redirect-malloc' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd8.0' 'build_alias=i386-portbld-freebsd8.0' 'CC=cc' 'CFLAGS=-O2 -pipe -fno-strict-aliasing' 'LIBS= -lpthread' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -fno-strict-aliasing' --cache-file=/dev/null --srcdir=.
checking build system type... i386-portbld-freebsd8.0
checking host system type... i386-portbld-freebsd8.0
checking target system type... i386-portbld-freebsd8.0
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking how to run the C preprocessor... cc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for ANSI C header files... (cached) yes
checking Determining PIC compiler flag... -fPIC
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/atomic_ops/Makefile
config.status: creating src/atomic_ops/sysdeps/Makefile
config.status: creating doc/Makefile
config.status: creating tests/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing default commands
===>Building for boehm-gc+threaded+redirect-7.1
depbase=`echo allchblk.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;  if /bin/sh ./libtool --tag=CC --mode=compile cc -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_FREEBSD_THREADS=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 -DREDIRECT_MALLOC=GC_malloc -DGC_USE_DLOPEN_WRAP=1   -I./include -pthread    -fexceptions -I libatomic_ops/src -O2 -pipe -fno-strict-aliasing -MT allchblk.lo -MD -MP -MF "$depbase.Tpo" -c -o allchblk.lo allchblk.c;  then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
mkdir .libs
 cc -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_FREEBSD_THREADS=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 -DREDIRECT_MALLOC=GC_malloc -DGC_USE_DLOPEN_WRAP=1 -I./include -pthread -fexceptions -I libatomic_ops/src -O2 -pipe -fno-strict-aliasing -MT allchblk.lo -MD -MP -MF .deps/allchblk.Tpo -c allchblk.c  -fPIC -DPIC -o .libs/allchblk.o
In file included from ./include/private/gc_priv.h:68,
                from allchblk.c:19:
./include/private/gcconfig.h:2329:5: error: #error "REDIRECT_MALLOC with THREADS works at most on Linux."
```


----------



## enderli (Dec 17, 2009)

I solved this problem follow these steps:

```
cd /usr/ports/devel/boehm-gc
make install
```
Got error messages. And contiune next step.

```
cd /usr/ports/devel/boehm-gc/work/gc-7.1
./configure
make install
cd /usr/ports/devel/boehm-gc
make install FORCE_PKG_REGISTER=1
```
(with "FORCE_PKG_REGISTER=1" to overwrite the old port)


----------



## enderli (Dec 17, 2009)

After FORCE_PKG_REGISTER=1, remember run "pkgdb -F" to check the package registry database.

```
pkgdb -F
--->  Checking the package registry database
Duplicated origin: devel/boehm-gc - boehm-gc+threaded+redirect-6.8 boehm-gc+threaded+redirect-7.1
Unregister any of them? [no] yes
  Unregister boehm-gc+threaded+redirect-6.8 keeping the installed files intact? [no] yes
  -> boehm-gc+threaded+redirect-7.1 is kept.
  --> Saving the boehm-gc+threaded+redirect-6.8's +CONTENTS file as /var/db/pkg/boehm-gc+threaded+redirect-7.1/+CONTENTS.boehm-gc+threaded+redirect-6.8
  --> Unregistering boehm-gc+threaded+redirect-6.8
  --> Done.
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 1001 packages found (-1 +0) (...) done]
```


----------

