https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88431
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject dot org> --- (In reply to David Binderman from comment #1) > This config line works fine: > > ../trunk/configure --prefix=/home/dcb/gcc/results.266950 \ > --disable-multilib \ > --disable-werror \ > --enable-checking=df,extra,fold,rtl,yes \ > --enable-languages=d > > so it looks like using -O3 in the top level Makefile causes trouble. I see the following in the config.cache for libphobos: lt_cv_prog_compiler_pic_works=${lt_cv_prog_compiler_pic_works=yes} lt_cv_prog_compiler_pic_works_D=${lt_cv_prog_compiler_pic_works_D=no} config.log: configure:12414: checking if ./gcc/gdc -B./gcc/ PIC flag -fPIC works configure:12432: ./gcc/gdc -B./gcc/ -c -nophoboslib -fno-moduleinfo -nostdinc -g -O3 -march=native -Wlogical-op -fPIC conftest.d >&5 d21: warning: command line option '-Wlogical-op' is valid for C/C++/ObjC/ObjC++ but not for D configure:12436: $? = 0 configure:12449: result: no It looks like -Wlogical-op is the culprit, not -O3. This is the condition in configure: --- if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_D=yes fi fi