fix crt0 includes ordering
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@996 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
9a0989b941
commit
634a99110c
|
@ -197,6 +197,7 @@ class romimage:
|
||||||
self.ldscripts = []
|
self.ldscripts = []
|
||||||
self.userdefines = []
|
self.userdefines = []
|
||||||
self.initincludes = {}
|
self.initincludes = {}
|
||||||
|
self.initincludesorder = [] # need to preserve order
|
||||||
self.useinitincludes = 0 # transitional
|
self.useinitincludes = 0 # transitional
|
||||||
self.partinstance = 0
|
self.partinstance = 0
|
||||||
self.root = 0
|
self.root = 0
|
||||||
|
@ -333,9 +334,10 @@ class romimage:
|
||||||
print "Warning, init include for %s previously defined" % path
|
print "Warning, init include for %s previously defined" % path
|
||||||
o = initinclude(str, path)
|
o = initinclude(str, path)
|
||||||
setdict(self.initincludes, path, o)
|
setdict(self.initincludes, path, o)
|
||||||
|
self.initincludesorder.append(path)
|
||||||
|
|
||||||
def getinitincludes(self):
|
def getinitincludes(self):
|
||||||
return self.initincludes
|
return self.initincludesorder
|
||||||
|
|
||||||
def getinitinclude(self, path):
|
def getinitinclude(self, path):
|
||||||
o = getdict(self.initincludes, path)
|
o = getdict(self.initincludes, path)
|
||||||
|
@ -1474,7 +1476,7 @@ def writeimagemakefile(image):
|
||||||
# Print out the dependencies for crt0_includes.h
|
# Print out the dependencies for crt0_includes.h
|
||||||
file.write("\n# Dependencies for crt0_includes.h\n")
|
file.write("\n# Dependencies for crt0_includes.h\n")
|
||||||
file.write("CRT0_INCLUDES:=\n")
|
file.write("CRT0_INCLUDES:=\n")
|
||||||
for inc in image.getinitincludes().keys():
|
for inc in image.getinitincludes():
|
||||||
if (local_path.match(inc)):
|
if (local_path.match(inc)):
|
||||||
file.write("CRT0_INCLUDES += %s\n" % inc)
|
file.write("CRT0_INCLUDES += %s\n" % inc)
|
||||||
else:
|
else:
|
||||||
|
@ -1587,7 +1589,8 @@ def writeinitincludes(image):
|
||||||
while (line):
|
while (line):
|
||||||
p = include_pattern.match(line)
|
p = include_pattern.match(line)
|
||||||
if (p):
|
if (p):
|
||||||
for i, inc in image.getinitincludes().items():
|
for i in image.getinitincludes():
|
||||||
|
inc = image.getinitinclude(i)
|
||||||
if (inc.getstring() == p.group(1)):
|
if (inc.getstring() == p.group(1)):
|
||||||
outfile.write("#include \"%s\"\n" % inc.getpath())
|
outfile.write("#include \"%s\"\n" % inc.getpath())
|
||||||
else:
|
else:
|
||||||
|
@ -1596,7 +1599,7 @@ def writeinitincludes(image):
|
||||||
|
|
||||||
infile.close()
|
infile.close()
|
||||||
else:
|
else:
|
||||||
for i in image.getinitincludes().keys():
|
for i in image.getinitincludes():
|
||||||
outfile.write("#include <%s>\n" % i)
|
outfile.write("#include <%s>\n" % i)
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
||||||
|
@ -1713,7 +1716,7 @@ if __name__=='__main__':
|
||||||
|
|
||||||
# crt0 includes
|
# crt0 includes
|
||||||
if (debug.level(debug.dump)):
|
if (debug.level(debug.dump)):
|
||||||
for i in image.getinitincludes().keys():
|
for i in image.getinitincludes():
|
||||||
debug.info(debug.dump, "crt0include file %s" % i)
|
debug.info(debug.dump, "crt0include file %s" % i)
|
||||||
for i in image.getdriverrules().keys():
|
for i in image.getdriverrules().keys():
|
||||||
debug.info(debug.dump, "driver file %s" % i)
|
debug.info(debug.dump, "driver file %s" % i)
|
||||||
|
|
Loading…
Reference in New Issue