Error: In file included from ./tm.h:19:0, from ../../gcc-4.8-20121021/gcc/d/d-spec.c:22: ./options.h:3299:36: error: token "." is not valid in preprocessor expressions #define flag_android global_options.x_flag_android ^ ./options.h:4012:26: note: in expansion of macro 'flag_android' #define TARGET_ANDROID ((flag_android & OPTION_MASK_ANDROID) != 0) ^ ../../gcc-4.8-20121021/gcc/d/d-spec.c:59:36: note: in expansion of macro 'TARGET_ANDROID' #if TARGET_WINDOS || TARGET_OSX || TARGET_ANDROID ^ ./options.h:3299:36: error: token "." is not valid in preprocessor expressions #define flag_android global_options.x_flag_android ^ ./options.h:4012:26: note: in expansion of macro 'flag_android' #define TARGET_ANDROID ((flag_android & OPTION_MASK_ANDROID) != 0) ^ ../../gcc-4.8-20121021/gcc/d/d-spec.c:488:22: note: in expansion of macro 'TARGET_ANDROID' #if TARGET_LINUX && !TARGET_ANDROID ^ Workaround for me is to just hack d-spec.c and remove those two macros; but that obviously wouldn't work if you're actually targetting android.
A recent change in gcc broke this. Workaround: Use an older gcc snapshot. The problem: GCC now defines a TARGET_ANDROID itself which clashes with our TARGET_ANDROID: ------------------------------------- * opth-gen.awk (TARGET_* generation): Always generate TARGET_<xxx> for Mask options, whether they use Var(...) or not. ------------------------------------- We can probably use that TARGET_ANDROID macro and throw away our implementation. Can you test if whether it works if you put the calls to TARGET_ANDROID in parens? So in d-spec.c:59: #if TARGET_WINDOS || TARGET_OSX || (TARGET_ANDROID) and d-spec.c:488:22: #if TARGET_LINUX && !(TARGET_ANDROID) If this does not fix it, it's probably a bug in upstream gcc as the error is in the TARGET_ANDROID macro definition which is part of gcc.
Ermm, maybe the gcc TARGET_ANDROID macro expands to a runtime expression. This needs some more work then.
(In reply to comment #2) > Ermm, maybe the gcc TARGET_ANDROID macro expands to a runtime expression. This > needs some more work then. That it does. Best thing to do is just give it another name...
FIXED: https://github.com/D-Programming-GDC/GDC/commit/102ab270fdf9d01fce5dd2c2c30ab308e6be9f37