Philip Herron <herron.phi...@googlemail.com> writes: > But after i return true in lang_init i get the error: > > gpy1: internal compiler error: in init_excess_precision, at toplev.c:2160 > > Really not sure where i can start to debug this any help would be > great.
You debug this by looking at line 2160 of toplev.c and reading the comment. /* Adjust excess precision handling based on the target options. If the front end cannot handle it, flag_excess_precision_cmdline will already have been set accordingly in the post_options hook. */ gcc_assert (flag_excess_precision_cmdline != EXCESS_PRECISION_DEFAULT); See, e.g., java_post_options or gfc_post_options. > Is it that any option i specify in lang.opt i just need to handle in > lang_handle_option? If all the option does is set a variable, by using Var in lang.opt, then you don't need to handle it explicitly. > And then i notice from: > > static > bool lang_post_options( const char **pfilename ) > { > printf("lang_post_options!\n"); > const char *filename= *pfilename; > > if( filename == 0 || !strcmp(filename, "-") ) > { > printf("stdin\n"); > finput= stdin; > filename= "stdin"; > } > else > { > printf("file %s\n", filename); > } > > return false; > } > > i notice it figures out if i say executed the compiler as: > > ./host-i686-pc-linux-gnu/gcc/gpy1 -v bla.lang > > It will figure out that the filename to compile is bla.lang. But then > how does it work say if i use it to link lots of different .o together? .o files won't be passed to your frontend anyhow. I assume you mean: what if the compiler is invoked with several different .lang files. In that case, it's up to your frontend how to handle it. The filenames will be available in in_fnames/num_in_fnames. Or see Java for a different approach, in which lang_specific_driver gathers up the file names in the driver code. Ian