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:  Compilation Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release: 
Release:  Bazaar - trunk Reproducibility:  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 Sutre <gsutre>
Project Member
Thu 17 Dec 2009 10:59:19 PM UTC, original submission:  


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 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
  • -email is unavailable- added by gsutre (Submitted the item)

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

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-01-23 gsutre StatusNone => Fixed
        Open/ClosedOpen => Closed
    2009-12-17 gsutre Attached File- => Added log, #19287

    Back to the top

    Powered by Savane 3.5