[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble compiling GRUB
From: |
Farid Hajji |
Subject: |
Re: Trouble compiling GRUB |
Date: |
Sun, 26 Nov 2000 04:16:44 +0100 |
> > What's going on? I was able to compile an earlier version of grub
> > (grub-0.5.96 from CVS) without problems.
>
> Perhaps that is due to a bug in your gcc. In gcc-2.7.x, the option
> "-B" (and also "-v") worked just fine, but gcc-2.95.x seems not to
> work. A workaround could be to install gcc as well as binutils into a
> private directory. *sigh*
Hmmm... I doubt that this is the case. I compiled grub-0.5.96 with
gcc-2.95.2 (and -B -> binutils-2.10) and that worked fine.
Trying gcc27 (gcc-2.7.2.3) instead of gcc-2.95.2 returned the same error
message about 'too many input files'.
CC=gcc27 ./configure --with-binutils=/usr/local/bin
> > # O_SYNC in grub/asmstub.c not recognized on my system.
> > # removed O_SYNC flag in line 1032 of grub/asmstub.c.
> > # this worked with grub 0.5.96
>
> Please report any bug! I haven't ever heard this. Doesn't FreeBSD
> support O_SYNC? I thought it should have, because O_SYNC is defined in
> POSIX. In FreeBSD, how to ensure that I/O operations are synchronous?
O_SYNC is not defined in FreeBSD. Use O_FSYNC instead.
from /usr/include/fcntl.h:
#ifndef _POSIX_SOURCE
#define FREAD 0x0001
#define FWRITE 0x0002
#endif
#define O_NONBLOCK 0x0004 /* no delay */
#define O_APPEND 0x0008 /* set append mode */
#ifndef _POSIX_SOURCE
#define O_SHLOCK 0x0010 /* open with shared file lock */
#define O_EXLOCK 0x0020 /* open with exclusive file lock */
#define O_ASYNC 0x0040 /* signal pgrp when data ready */
#define O_FSYNC 0x0080 /* synchronous writes */
#define O_NOFOLLOW 0x0100 /* don't follow symlinks */
#endif
#define O_CREAT 0x0200 /* create if nonexistent */
#define O_TRUNC 0x0400 /* truncate to zero length */
#define O_EXCL 0x0800 /* error if already exists */
#ifdef _KERNEL
#define FMARK 0x1000 /* mark during gc() */
#define FDEFER 0x2000 /* defer for next gc pass */
#define FHASLOCK 0x4000 /* descriptor holds advisory lock */
#endif
Beware that O_FSYNC is not defined if _POSIX_SOURCE is defined!
I've just checked that open() with O_FSYNC really syncs every write()
to disk. If O_FSYNC is omitted, no immediate synchronization is performed
(as expected).
> Thanks,
> Okuji
-Farid.
--
Farid Hajji -- Unix Systems and Network Admin | Phone: +49-2131-67-555
Broicherdorfstr. 83, D-41564 Kaarst, Germany | address@hidden
- - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
Murphy's Law fails only when you try to demonstrate it, and thus succeeds.