bugGNU GRUB - Bugs: bug #28325, Build failure: undefined reference...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28325: Build failure: undefined reference to `grub_assert_fail'

Submitted by:  Grégoire Sutre <gsutre>
Submitted on:  Thu 17 Dec 2009 10:59:19 PM UTC  
 
Category: CompilationSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: Every Time
Planned Release: None

Sat 23 Jan 2010 01:33:21 PM UTC, comment #1:

Fixed in trunk by commits 2004 and 2019.

Grégoire

Grégoire Sutre <gsutre>
Project Member
Thu 17 Dec 2009 10:59:19 PM UTC, original submission:

Hi,

When building grub from trunk, compilation works well until the linking of grub-fstest where I get the error:

undefined reference to `grub_assert_fail'

I'm compiling with gcc 4.1.3 (on NetBSD 5.0). The log of (./autogen.sh && ./configure && gmake grub-fstest LDFLAGS=-lintl) is attached.

However, this error does not occur with the 1.97.1 tarball. I believe that the reason is:

- in version 1.97.1, configure sets CFLAGS to '-g -O2', this is actually done by the call to AC_PROG_CC, which sets CFLAGS unless it is already set.
- in trunk, configure sets CFLAGS (with no `-O2') before the call to AC_PROG_CC, and hence this call does not change CFLAGS (as it is already set).

This is confirmed by compiling manually the file kern/command.c:

$
gcc [...] -c -o grub_fstest-kern_command.o kern/command.c
$ nm grub_fstest-kern_command.o | grep assert
U grub_assert_fail
$
gcc [...] -O2 -c -o grub_fstest-kern_command.o kern/command.c
$ nm grub_fstest-kern_command.o | grep assert
$

Note that if use gcc 4.4 (which is not the default on NetBSD), the problem disappears, i.e. it seems that by default (without optimizations) gcc 4.4 does not include ``dead'' symbols (?).

Grégoire

Grégoire Sutre <gsutre>
Project Member

 

Attached Files
file #19287:  log added by gsutre (28KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gsutre (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 23 Jan 2010 01:33:21 PM UTCgsutreStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 17 Dec 2009 10:59:19 PM UTCgsutreAttached File-=>Added log, #19287

    Back to the top


    Powered by Savane 3.1-cleanup1