grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64


From: Seth Goldberg
Subject: Re: Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64
Date: Sun, 5 Dec 2010 23:18:27 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

Hi,

Quoting Colin Watson, who wrote the following on Sat, 4 Dec 2010:

On Fri, Dec 03, 2010 at 01:20:13PM -0800, Seth Goldberg wrote:
  In testing grub-emu after a merge, I was getting weird behavior whereby
a zfs volume could not be properly read.  It was failing because, after a
lot of painful debugging, I discovered that the offsets issued to the
underlying host disk device were wrong, because the grub-emu was not
build largefile-aware on platform on which I was testing.  grub-emu
should be built with -DLARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 so that
off_t will be defined as a 64-bit type and calls like lseek will work
with large files (and devices).  So, I think a configure test for this
for the emu target is essential.

We actually have AC_SYS_LARGEFILE in configure.ac already, which is
supposed to append appropriate options to (slightly oddly) CC.  Now,
hostdisk.c is built with TARGET_CC instead; but TARGET_CC should be set
to CC when building the emu target, if I'm reading this right, because
it doesn't count as cross-compilation.

Are you setting CC by hand?  Could I see the output of configure?

Sorry about that -- I did a bit more digging and now I think I've found the true culprit. When building hostdisk.c for use in grub-emu, GRUB_UTIL is not defined AND GRUB_MACHINE *is* defined (to I386_EMU). This causes the config.h test (below) to fail, and, consequently config-util.h is not #included when building the actual emulator (this explains why grub-fstest continued to work properly, even when built while configured for an emulator build).

#if defined (GRUB_UTIL) || !defined (GRUB_MACHINE) <-- But unsatisfied
#include <config-util.h>
#define NESTED_FUNC_ATTR
#else
...

 --S



reply via email to

[Prev in Thread] Current Thread [Next in Thread]