URL:
  <http://savannah.gnu.org/bugs/?28325>

                 Summary: Build failure: undefined reference to
`grub_assert_fail'
                 Project: GNU GRUB
            Submitted by: gsutre
            Submitted on: Thu 17 Dec 2009 10:59:19 PM GMT
                Category: Compilation
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: Bazaar - trunk
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

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



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 17 Dec 2009 10:59:19 PM GMT  Name: log  Size: 28kB   By: gsutre

<http://savannah.gnu.org/bugs/download.php?file_id=19287>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?28325>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-grub mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to