Hi,

I found a bug in the build configuration script.
To reproduce:
$ make distclean
$ make config
select profile for mips32 (GXemul)
hit done
$ make config
now select msim from machine type
hit done

After these steps are done, the option for 'Lazy FPU switching' is enabled, 
but it should not. Running make in this case leads to compile error.

Now, there are two solutions to this problem, which one is correct depends on 
how tools/config.py and HelenOS.config are meant to be used.

The first solution is to delete any variables for which there is no matching 
rule (which would define the variable), the other is to change HelenOS config 
to 
define a default value for the variables in any case and raise an error if 
there is a variable value, but no rule defined the variable.

Attached is a patch for the former solution, could someone please review it?

Thanks.

Regards,
Martin Sucha
=== modified file 'tools/config.py'
--- tools/config.py	2011-12-02 17:29:43 +0000
+++ tools/config.py	2012-03-25 18:21:16 +0000
@@ -227,6 +227,8 @@
 def infer_verify_choices(config, rules):
 	"Infer and verify configuration values."
 	
+	valid_var_names = set()
+	
 	for rule in rules:
 		varname, vartype, name, choices, cond = rule
 		
@@ -253,6 +255,13 @@
 		
 		if not varname in config:
 			return False
+		
+		valid_var_names.add(varname)
+	
+	# Remove any variable for which there is no matching rule
+	for varname in config.keys():
+		if varname not in valid_var_names:
+			del config[varname]
 	
 	return True
 

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to