Am 21.04.2009 13:30, schrieb Joseph Smith:
It does make it kind of hard to sift through to find out what is really an
error and what is just missing gcc extensions...
Stefan and I found a solution: scan-build happily prefers -include over --includes=, so I changed romcc to parse that, and the makefile to emit it (gcc knows -include, too)
See patch.


Patrick
Signed-off-by: Patrick Georgi <[email protected]>

Index: util/newconfig/config.g
===================================================================
--- util/newconfig/config.g     (Revision 4150)
+++ util/newconfig/config.g     (Arbeitskopie)
@@ -2098,7 +2098,7 @@
        file.write("# Function to create an item like -Di586 or 
-DCONFIG_MAX_CPUS='1' or -Ui686\n")
        file.write("D_item = $(shell echo '$(if $(subst undefined,,$(origin 
$1)),\\#define $1$(if $($1), $($1),),\\#undef $1)' >> settings.h)\n\n")
        file.write("# Compute the value of CPUFLAGS here during make's first 
pass.\n")
-       file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > 
settings.h)$(foreach _var_,$(VARIABLES),$(call 
D_item,$(_var_)))--include=settings.h)\n\n")
+       file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > 
settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))-include 
$(PWD)/settings.h)\n\n")
 
        for i in image.getuserdefines():
                file.write("%s\n" %i)
Index: util/romcc/romcc.c
===================================================================
--- util/romcc/romcc.c  (Revision 4150)
+++ util/romcc/romcc.c  (Arbeitskopie)
@@ -25118,11 +25118,13 @@
                        else if (strncmp(argv[1], "-m", 2) == 0) {
                                result = arch_encode_flag(&arch, argv[1]+2);
                        }
-                       else if (strncmp(argv[1], "--include=", 10) == 0) {
+                       else if (strncmp(argv[1], "-include", 10) == 0) {
                                if (includefile) {
-                                       arg_error("Only one --include option 
may be specified.\n");
+                                       arg_error("Only one -include option may 
be specified.\n");
                                } else {
-                                       includefile = argv[1] + 10;
+                                       argv++;
+                                       argc--;
+                                       includefile = argv[1];
                                        result = 0;
                                }
                        }
-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to