Skip to contentSkip to conversation

seabios build failure in xen tree

DISCUSSION Christoph Egger 2 participants 5 messages Feb 7, 2012 – Feb 9, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

Adding seabios ML.

Quoted 31 lines · Ian Campbell
Quoted 23 lines · Christoph Egger
Quoted 22 lines · Ian Campbell
Quoted 8 lines · Christoph Egger

gmake[6]: Entering directory tools/firmware/seabios-dir-remote

     Building ld scripts (version "1.6.3.1-20120126_152501")

env: python: No such file or directory
gmake[6]: *** [out/romlayout16.lds] Error 127

The python scripts must be invoked with $(PYTHON) as done throughout the build system.

SeaBIOS uses:

$ rgrep -i python tools/firmware/seabios-dir
tools/firmware/seabios-dir/tools/transdump.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/buildrom.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/checkstack.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/encodeint.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/layoutrom.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/checkrom.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/readserial.py:#!/usr/bin/env python
tools/firmware/seabios-dir/tools/readserial.py:Or: apt-get install python-serial
tools/firmware/seabios-dir/tools/checksum.py:#!/usr/bin/env python
Quoted 6 lines
Quoted 1 line

Does this not work? Should python be on your $PATH?

It is. But the python binary on NetBSD's pkgsrc
is called python<version> to allow concurrent installations of different python versions.
So I can have: python2.5, python2.6, python2.7, python3.1, etc.

Quoted 20 lines

There is no current "python" referring to the default version?

I think this is something you will need to work out with the SeaBIOS upstream.

Ian.

Quoted 13 lines

Christoph

Quoted 10 lines

Since SeaBIOS is third party code we are not so much at liberty to make the same sorts of policy decisions as we would for our own code.

You could perhaps attempt to work around this by invoking the recursive make into the seabios directory with PATH=$(dir-only $(PYTHON):$PATH or whatever the appropriate runes are.

Or you could try posting a patch to SeaBIOS-devel, I don't know what their thinking on this sort of thing is.

I see.

What python version does SeaBIOS require?
I have python 2.5 installed.

I manually created a python symlink to that version and then I get this failure:

gmake[6]: Entering directory 'tools/firmware/seabios-dir-remote'
Building ld scripts (version "1.6.3.1-20120127_151243")
Fixed space: 0xe05b-0x10000 total: 8101 slack: 5 Percent slack: 0.1%
16bit size: 46336
32bit segmented size: 2005
32bit flat size: 14699
32bit flat init size: 53888
Traceback (most recent call last):
File "./tools/layoutrom.py", line 579, in <module>

    main()

File "./tools/layoutrom.py", line 576, in main
writeLinkerScripts(sections, entrysym, genreloc, out16, out32seg,
out32flag)
File "./tools/layoutrom.py", line 257, in writeLinkerScripts
+ COMMONTRAILER
TypeError: int argument required
gmake[6]: *** [out/romlayout16.lds] Error 1

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#1 lore raw
Quoted 15 lines · Christoph Egger

Adding seabios ML.

Quoted 11 lines · Ian Campbell
Quoted 10 lines · Christoph Egger
Quoted 9 lines · Ian Campbell
Quoted 8 lines · Christoph Egger

gmake[6]: Entering directory tools/firmware/seabios-dir-remote

     Building ld scripts (version "1.6.3.1-20120126_152501")

env: python: No such file or directory
gmake[6]: *** [out/romlayout16.lds] Error 127

The python scripts must be invoked with $(PYTHON) as done throughout the build system.

We can change the seabios makefile to call these scripts with an explicit $(PYTHON). However, it's odd that there isn't a default python on your system.

[...]

Quoted 2 lines

What python version does SeaBIOS require?
I have python 2.5 installed.

It should work with python 2.5 - there's nothing really special going on in the script.

Quoted 12 lines

I manually created a python symlink to that version and then I get this failure:

gmake[6]: Entering directory 'tools/firmware/seabios-dir-remote'
Building ld scripts (version "1.6.3.1-20120127_151243")
Fixed space: 0xe05b-0x10000 total: 8101 slack: 5 Percent slack: 0.1%
16bit size: 46336
32bit segmented size: 2005
32bit flat size: 14699
32bit flat init size: 53888
Traceback (most recent call last):
File "./tools/layoutrom.py", line 579, in <module>

Quoted 7 lines
    main()

File "./tools/layoutrom.py", line 576, in main
writeLinkerScripts(sections, entrysym, genreloc, out16,
out32seg, out32flag)
File "./tools/layoutrom.py", line 257, in writeLinkerScripts
+ COMMONTRAILER
TypeError: int argument required

That's quite odd. This looks data related instead of python related. Try running a "make clean" and then "make" in just the seabios directory. If you still see an issue, tar up the seabios "out/" directory and mail it to me.

-Kevin

#2 lore raw
Quoted 14 lines · Kevin O'Connor
Quoted 13 lines · Christoph Egger

Adding seabios ML.

Quoted 9 lines · Ian Campbell
Quoted 8 lines · Christoph Egger
Quoted 7 lines · Ian Campbell
Quoted 6 lines · Christoph Egger

gmake[6]: Entering directory tools/firmware/seabios-dir-remote

      Building ld scripts (version "1.6.3.1-20120126_152501")

env: python: No such file or directory
gmake[6]: *** [out/romlayout16.lds] Error 127

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The python scripts must be invoked with $(PYTHON) as done throughout the build system.

We can change the seabios makefile to call these scripts with an explicit $(PYTHON).

Awesome!

Quoted 29 lines

However, it's odd that there isn't a default python on your system.

[...]

Quoted 2 lines

What python version does SeaBIOS require?
I have python 2.5 installed.

It should work with python 2.5 - there's nothing really special going on in the script.

Quoted 12 lines

I manually created a python symlink to that version and then I get this failure:

gmake[6]: Entering directory 'tools/firmware/seabios-dir-remote'
Building ld scripts (version "1.6.3.1-20120127_151243")
Fixed space: 0xe05b-0x10000 total: 8101 slack: 5 Percent slack: 0.1%
16bit size: 46336
32bit segmented size: 2005
32bit flat size: 14699
32bit flat init size: 53888
Traceback (most recent call last):
File "./tools/layoutrom.py", line 579, in<module>

Quoted 7 lines
     main()

File "./tools/layoutrom.py", line 576, in main
writeLinkerScripts(sections, entrysym, genreloc, out16,
out32seg, out32flag)
File "./tools/layoutrom.py", line 257, in writeLinkerScripts
+ COMMONTRAILER
TypeError: int argument required

Quoted 4 lines

That's quite odd. This looks data related instead of python related. Try running a "make clean" and then "make" in just the seabios directory. If you still see an issue, tar up the seabios "out/" directory and mail it to me.

It failed the same way.
I sent you the tarball offlist due its size.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#3 lore raw
Quoted 5 lines · Christoph Egger
Quoted 2 lines · Kevin O'Connor

We can change the seabios makefile to call these scripts with an explicit $(PYTHON).

Awesome!

See the attached patch.

Quoted 7 lines
Quoted 4 lines

That's quite odd. This looks data related instead of python related. Try running a "make clean" and then "make" in just the seabios directory. If you still see an issue, tar up the seabios "out/" directory and mail it to me.

It failed the same way.
I sent you the tarball offlist due its size.

Looks like your version of gcc is defining sections with .rodata.__PRETTY_FUNCTION__ - which is odd as that macro isn't used in the code. Does the second attached patch fix it for you?

-Kevin

Quoted 1 line

From 97f1ffcfac4ca382b5008a7aabfc2c300131f978 Mon Sep 17 00:00:00 2001

From: Kevin O'Connor <[email protected]>
Date: Wed, 8 Feb 2012 20:21:29 -0500
Subject: [PATCH 1/2] Add PYTHON definition to Makefile.

Add PYTHON definition to Makefile so users can override it. This allows users to specify an exact python executable name to use during the build.

---
 Makefile |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
Makefile +6 -5
index 0343ce5..513e8f1 100644
@@ -63,6 +63,7 @@ export KCONFIG_CONFIG     := $(CURDIR)/.config
 OBJCOPY=objcopy
 OBJDUMP=objdump
 STRIP=strip
+PYTHON=python
 
 # Default targets
 -include $(KCONFIG_CONFIG)
@@ -152,7 +153,7 @@ $(OUT)romlayout16.lds: $(OUT)ccode32flat.o $(OUT)code32seg.o $(OUT)code16.o tool
 	$(Q)$(OBJDUMP) -thr $(OUT)code32flat.o > $(OUT)code32flat.o.objdump
 	$(Q)$(OBJDUMP) -thr $(OUT)code32seg.o > $(OUT)code32seg.o.objdump
 	$(Q)$(OBJDUMP) -thr $(OUT)code16.o > $(OUT)code16.o.objdump
-	$(Q)./tools/layoutrom.py $(OUT)code16.o.objdump $(OUT)code32seg.o.objdump $(OUT)code32flat.o.objdump $(OUT)romlayout16.lds $(OUT)romlayout32seg.lds $(OUT)romlayout32flat.lds
+	$(Q)$(PYTHON) ./tools/layoutrom.py $(OUT)code16.o.objdump $(OUT)code32seg.o.objdump $(OUT)code32flat.o.objdump $(OUT)romlayout16.lds $(OUT)romlayout32seg.lds $(OUT)romlayout32flat.lds
 
 # These are actually built by tools/layoutrom.py above, but by pulling them
 # into an extra rule we prevent make -j from spawning layoutrom.py 4 times.
@@ -174,7 +175,7 @@ $(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o tools/checkrom.py
 	@echo "  Prepping $@"
 	$(Q)$(OBJDUMP) -thr $< > $<.objdump
 	$(Q)$(OBJCOPY) -O binary $< $(OUT)bios.bin.raw
-	$(Q)./tools/checkrom.py $<.objdump $(OUT)bios.bin.raw $(OUT)bios.bin
+	$(Q)$(PYTHON) ./tools/checkrom.py $<.objdump $(OUT)bios.bin.raw $(OUT)bios.bin
 	$(Q)$(STRIP) -R .comment $< -o $(OUT)bios.bin.elf
 
 
@@ -204,15 +205,15 @@ $(OUT)vgabios.bin.raw: $(OUT)vgarom.o
 
 $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py
 	@echo "  Finalizing rom $@"
-	$(Q)./tools/buildrom.py $< $@
+	$(Q)$(PYTHON) ./tools/buildrom.py $< $@
 
 ####### dsdt build rules
 src/%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.py
 	@echo "Compiling DSDT"
 	$(Q)cpp -P $< > $(OUT)$*.dsl.i.orig
-	$(Q)./tools/acpi_extract_preprocess.py $(OUT)$*.dsl.i.orig > $(OUT)$*.dsl.i
+	$(Q)$(PYTHON) ./tools/acpi_extract_preprocess.py $(OUT)$*.dsl.i.orig > $(OUT)$*.dsl.i
 	$(Q)iasl -l -tc -p $(OUT)$* $(OUT)$*.dsl.i
-	$(Q)./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
+	$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
 $(OUT)ccode32flat.o: src/acpi-dsdt.hex src/ssdt-proc.hex src/ssdt-pcihp.hex
Signature · 1 line
1.7.6.5
Quoted 1 line

From 805ede2bd35243a4298bc64bd81be6db7cf57f58 Mon Sep 17 00:00:00 2001

From: Kevin O'Connor <[email protected]>
Date: Wed, 8 Feb 2012 20:23:36 -0500
Subject: [PATCH 2/2] Permit .rodata.__PRETTY_FUNCTION__. sections in roms.

Some versions of gcc appear to define these sections even though they aren't used in the code.

---
 tools/layoutrom.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
tools/layoutrom.py +8 -4
index 45738a3..86e1f33 100755
@@ -147,8 +147,10 @@ def getSectionsPrefix(sections, category, prefix):
 def doLayout(sections):
     # Determine 16bit positions
     textsections = getSectionsPrefix(sections, '16', '.text.')
-    rodatasections = (getSectionsPrefix(sections, '16', '.rodata.str1.1')
-                      + getSectionsPrefix(sections, '16', '.rodata.__func__.'))
+    rodatasections = (
+        getSectionsPrefix(sections, '16', '.rodata.str1.1')
+        + getSectionsPrefix(sections, '16', '.rodata.__func__.')
+        + getSectionsPrefix(sections, '16', '.rodata.__PRETTY_FUNCTION__.'))
     datasections = getSectionsPrefix(sections, '16', '.data16.')
     fixedsections = getSectionsPrefix(sections, '16', '.fixedaddr.')
 
@@ -159,8 +161,10 @@ def doLayout(sections):
 
     # Determine 32seg positions
     textsections = getSectionsPrefix(sections, '32seg', '.text.')
-    rodatasections = (getSectionsPrefix(sections, '32seg', '.rodata.str1.1')
-                      +getSectionsPrefix(sections, '32seg', '.rodata.__func__.'))
+    rodatasections = (
+        getSectionsPrefix(sections, '32seg', '.rodata.str1.1')
+        + getSectionsPrefix(sections, '32seg', '.rodata.__func__.')
+        + getSectionsPrefix(sections, '32seg', '.rodata.__PRETTY_FUNCTION__.'))
     datasections = getSectionsPrefix(sections, '32seg', '.data32seg.')
 
     code32seg_start = setSectionsStart(
Signature · 1 line
1.7.6.5

_______________________________________________
SeaBIOS mailing list
[email protected]
http://www.seabios.org/mailman/listinfo/seabios

#4 lore raw
Quoted 14 lines · Kevin O'Connor
Quoted 5 lines · Christoph Egger
Quoted 2 lines · Kevin O'Connor

We can change the seabios makefile to call these scripts with an explicit $(PYTHON).

Awesome!

See the attached patch.

Quoted 5 lines
Quoted 4 lines

That's quite odd. This looks data related instead of python related. Try running a "make clean" and then "make" in just the seabios directory. If you still see an issue, tar up the seabios "out/" directory and mail it to me.

Quoted 8 lines
Quoted 2 lines

It failed the same way.
I sent you the tarball offlist due its size.

Looks like your version of gcc is defining sections with .rodata.__PRETTY_FUNCTION__ - which is odd as that macro isn't used in the code. Does the second attached patch fix it for you?

-Kevin

Both patches work for me and there are no follow-up errors. Thank you.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632