seabios version 0.6.1.2-0ubuntu1 failed to build on i386

Bug #756044 reported by Matthias Klose
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
binutils
Fix Released
Medium
binutils (Ubuntu)
Fix Released
Medium
Unassigned
Oneiric
Fix Released
Medium
Unassigned
seabios (Ubuntu)
Invalid
High
Unassigned
Oneiric
Invalid
High
Unassigned

Bug Description

seabios version 0.6.1.2-0ubuntu1 failed to build on i386
Link to failed build: https://launchpad.net/ubuntu/+archive/test-rebuild-20110329/+buildjob/2410113

Direct link to the build log: https://launchpad.net/ubuntu/+archive/test-rebuild-20110329/+buildjob/2410113/+files/buildlog_ubuntu-natty-i386.seabios_0.6.1.2-0ubuntu1_FAILEDTOBUILD.txt.gz

This log snippet might be of interest, since it triggered the matcher 'Purging chroot-autobuild'.
Excerpt 795 lines into the build log:

  Generating offset file out/asm-offsets.h
  Compiling (16bit) out/code16.o
  Compiling whole program out/ccode32flat.o
  Compiling whole program out/code32seg.o
  Building ld scripts (version "0.6.1.2-20110408_190953-actinium")
Fixed space: 0xe05b-0x10000 total: 8101 slack: 3 Percent slack: 0.0%
16bit size: 38896
32bit segmented size: 1636
32bit flat size: 64828
  Linking out/rom16.o
out/romlayout16.lds:695 cannot move location counter backwards (from 000000000000c9fa to 000000000000c9e0)
make[1]: *** [out/rom16.o] Error 1
make[1]: Leaving directory `/build/buildd/seabios-0.6.1.2'
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20110408-1909
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/seabios-0.6.1.2

Matthias Klose (doko)
Changed in seabios (Ubuntu):
importance: Undecided → High
Revision history for this message
Zero (wuwanli) wrote :

Also failed on amd64 platform, the same error.

Revision history for this message
In , Rguenth (rguenth) wrote :

Created attachment 5702
testcase

While the 2.21 release links the attached testcase just fine, the 2.21 branch
taken at Apr 19th fails to link it with

> ld -T romlayout32seg.lds code32seg.o -o rom32seg.o
romlayout32seg.lds:66 cannot move location counter backwards (from 00000000000067b0 to 00000000000067a0)

If one changes the linker script to add 0x4 more room for the sections
(which corresponds to their alignment) like

*(.rodata.__func__.10274)
. = ( 0x6782 - code32seg_start ) ;
*(.rodata.__func__.8035)
. = ( 0x6796 - code32seg_start ) ;
*(.rodata.__func__.8048)
. = ( 0x67aa - code32seg_start ) ;
*(.rodata.__func__.8075)
. = ( 0x67c0 - code32seg_start ) ;
*(.rodata.__func__.8115)

then the link succeeds. This looks like a bogus alignment calculation
as with the size of 0xe for the section 0x10 should be enough space
to properly align the data.

Revision history for this message
In , Rguenth (rguenth) wrote :

Similar issue happens on 64bit.

Revision history for this message
In , Rguenth (rguenth) wrote :

Confirmed also with the current 2.21 branch head and also with

2010-12-04 Alan Modra <email address hidden>

        * ldlang.c (lang_size_sections_1): Align lma using same alignment
        as for vma.

reverted (that just looked maybe related).

Revision history for this message
In , Alan Modra (amodra-gmail) wrote :

Mine. Looks to be caused by the fix for PR12380. That delayed setting expld.phase = lang_final_phase_enum until just before the final lang_do_assignments, breaking the assignments done in lang_relax_sections.

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

CVSROOT: /cvs/src
Module name: src
Changes by: <email address hidden> 2011-05-03 14:56:14

Modified files:
 ld : ChangeLog ldexp.c ldexp.h ldlang.c ldlang.h
                  pe-dll.c

Log message:
 PR ld/12726
 * ldexp.h (lang_phase_type): Add lang_assigning_phase_enum.
 * ldexp.c (exp_fold_tree_1): Correct assign to dot comment. Don't
 assign to dot when lang_assigning_phase_enum.
 * ldlang.h (lang_do_assignments): Update prototype.
 * ldlang.c (lang_do_assignments): Add phase parameter. Update all
 callers.
 * pe-dll.c (pe_dll_fill_sections, pe_exe_fill_sections): Update
 lang_do_assignments calls.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2324&r2=1.2325
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.c.diff?cvsroot=src&r1=1.93&r2=1.94
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.h.diff?cvsroot=src&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&r1=1.366&r2=1.367
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldlang.h.diff?cvsroot=src&r1=1.96&r2=1.97
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/pe-dll.c.diff?cvsroot=src&r1=1.136&r2=1.137

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

CVSROOT: /cvs/src
Module name: src
Branch: binutils-2_21-branch
Changes by: <email address hidden> 2011-05-03 15:16:40

Modified files:
 ld : ChangeLog ldexp.c ldexp.h ldlang.c ldlang.h
                  pe-dll.c

Log message:
 PR ld/12726
 * ldexp.h (lang_phase_type): Add lang_assigning_phase_enum.
 * ldexp.c (exp_fold_tree_1): Correct assign to dot comment. Don't
 assign to dot when lang_assigning_phase_enum.
 * ldlang.h (lang_do_assignments): Update prototype.
 * ldlang.c (lang_do_assignments): Add phase parameter. Update all
 callers.
 * pe-dll.c (pe_dll_fill_sections, pe_exe_fill_sections): Update
 lang_do_assignments calls.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.2222.2.20&r2=1.2222.2.21
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.c.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.87.2.1&r2=1.87.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.h.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.23.2.1&r2=1.23.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.347.2.3&r2=1.347.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldlang.h.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.91.2.2&r2=1.91.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/pe-dll.c.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.133&r2=1.133.2.1

Revision history for this message
In , Alan Modra (amodra-gmail) wrote :

Fixed

Revision history for this message
tolik2525 (tolik2525) wrote :

It seems like this is binutils bug.
I reinstalled binutils from this snapshot ftp://sourceware.org/pub/binutils/snapshots/binutils-2.20.51.tar.bz2 and all went fine.

go@02-utest02:~/seabios-0.6.1.2$ ld -v
GNU ld (GNU Binutils) 2.20.51.20101105

go@02-utest02:~/seabios-0.6.1.2$ make
  Compiling whole program out/ccode.16.s
  Compiling to assembler out/asm-offsets.s
  Generating offset file out/asm-offsets.h
  Compiling (16bit) out/code16.o
  Compiling whole program out/ccode32flat.o
  Compiling whole program out/code32seg.o
  Building ld scripts (version "0.6.1.2-20110510_133622-02-utest02")
Fixed space: 0xe05b-0x10000 total: 8101 slack: 17 Percent slack: 0.2%
16bit size: 38928
32bit segmented size: 1464
32bit flat size: 66904
  Linking out/rom16.o
  Stripping out/rom16.strip.o
  Linking out/rom32seg.o
  Stripping out/rom32seg.strip.o
  Linking out/rom.o
  Prepping out/bios.bin
Total size: 107296 Free space: 23776 Percent used: 81.9% (128KiB rom)
go@02-utest02:~/seabios-0.6.1.2$

Revision history for this message
tolik2525 (tolik2525) wrote :

Forgot to mention I'm using amd64 version of Ubuntu 10.10

Changed in seabios (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Reverting binutils to bzr commit 133 lets seabios compile. 135 does not. Have yet to test revision 134.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Revision 134 is also good. So something in revision 135 stops seabios from compiling.

Revision history for this message
Matthias Klose (doko) wrote :

r135 changes:
* Pass --enable-targets=all to configure in the multiarch pass;
  Debian #610745.

would it be possible to revert this change in a current binutils in natty/oneiric and recheck? I however cannot see any b-d on binutils-multiarch in seabios

Revision history for this message
Loïc Minier (lool) wrote :

Note that --enable-targets=all was later changed to use the list of dpkg linux triplets + a hardcoded list of triplets which was accumulated in binutils over time.

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

There was another amd64-specific FTBFS which I uploaded a fix for (see Debian #625000); then I get the same issue as described here on amd64. We should give back the package when we get a new binutils snapshot with the fix.

Changed in seabios (Ubuntu):
status: Confirmed → Invalid
Changed in binutils (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Loïc Minier (lool) wrote :

Might also be http://sourceware.org/bugzilla/show_bug.cgi?id=12726

this is due to alignment changes which were now reverted

tags: added: oneiric
Changed in binutils (Ubuntu):
milestone: none → oneiric-alpha-1
Revision history for this message
Matthias Klose (doko) wrote :

binutils fixed in oneiric, seabios built sucessfully

Changed in binutils (Ubuntu Oneiric):
status: Triaged → Fix Released
Changed in binutils:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.