Hi Eric,

>> I haven't tried to readd the boehm-gc objc support that has also been
>> disabled, don't know about anybody using that.
>
> I always configure with --enable-objc-gc. The only reason Apple
> deprecated garbage collection for Objective C is because they replaced
> it with Automated Reference Counting in clang, which GCC doesn't
> support yet. So, until GCC supports Automated Reference Counting,
> please keep boehm-gc support for objc.

me too, though mostly to have maximum test coverage (primarily on
Solaris).  As expected, a x86_64-apple-darwin16 bootstrap with
--enable-objc-gc just failed for me.  I'm testing the following patch
(on top of Jakub's).

        Rainer


2016-10-01  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        * configure.ac (target_libraries): Readd target-boehm-gc.
        Restore --enable-objc-gc handling.
        * configure: Regenerate.

--- configure.ac.pre-bgc	2016-09-30 23:20:44.000000000 +0200
+++ configure.ac	2016-09-30 23:28:35.952184178 +0200
@@ -161,6 +161,7 @@ target_libraries="target-libgcc \
 		target-libssp \
 		target-libquadmath \
 		target-libgfortran \
+		target-boehm-gc \
 		target-libffi \
 		target-libobjc \
 		target-libada \
@@ -2054,6 +2055,28 @@ for dir in $configdirs $build_configdirs
   fi
 done
 
+# Check for Boehm's garbage collector
+AC_ARG_ENABLE(objc-gc,
+[AS_HELP_STRING([--enable-objc-gc],
+		[enable use of Boehm's garbage collector with the
+		 GNU Objective-C runtime])],
+[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
+  *,objc,*:*:yes:*target-boehm-gc*)
+    AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
+    ;;
+esac])
+
+# Make sure we only build Boehm's garbage collector if required.
+case ,${enable_languages},:${enable_objc_gc} in
+  *,objc,*:yes)
+    # Keep target-boehm-gc if requested for Objective-C.
+    ;;
+  *)
+    # Otherwise remove target-boehm-gc.
+    noconfigdirs="$noconfigdirs target-boehm-gc"
+    ;;
+esac
+
 # Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
 case ,${enable_languages}, in
   *,c++,*)
-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to