soc/integration/cpu_interface: fix clang detection
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 19 Apr 2016 06:06:56 +0000 (08:06 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 19 Apr 2016 06:06:56 +0000 (08:06 +0200)
litex/soc/integration/cpu_interface.py

index 506f95d9e89f12e4bccd41792a41111663bfbb88..2f25e1523cc6c8e6f257a2f8044067baaac91842 100644 (file)
@@ -16,16 +16,14 @@ def get_cpu_mak(cpu):
         clang = bool(int(clang))
     else:
         clang = None
-
     if cpu == "lm32":
         assert not clang, "lm32 not supported with clang."
         triple = "lm32-elf"
         cpuflags = "-mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled"
     elif cpu == "or1k":
-        # Default to CLANG unless told otherwise
+        # default to CLANG unless told otherwise
         if clang is None:
            clang = True
-
         triple = "or1k-elf"
         cpuflags = "-mhard-mul -mhard-div -mror"
         if clang:
@@ -42,7 +40,7 @@ def get_cpu_mak(cpu):
         ("CPU", cpu),
         ("CPUFLAGS", cpuflags),
         ("CPUENDIANNESS", cpu_endianness[cpu]),
-        ("CLANG", str(int(clang)))
+        ("CLANG", str(0 if clang is None else int(clang)))
     ]