All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: leif.lindholm@arm.com
Subject: Re: Trunk fails to build with -O<anything other than 0>
Date: Wed, 30 Jan 2013 23:41:21 +0400	[thread overview]
Message-ID: <20130130234121.69db8dbb@opensuse.site> (raw)
In-Reply-To: <51096747.8080100@arm.com>

В Wed, 30 Jan 2013 18:32:39 +0000
Leif Lindholm <leif.lindholm@arm.com> пишет:

> Our Ubuntu (12.04/12.10) build environment defaults configuring with 
> CFLAGS containing -O2. Trunk currently does not build successfully with 
> this on either my ARM platform or my x86_64 desktop.
> 
> This isn't causing any serious problems, but I thought I would report 
> what I've found.
> 
> Commit #4635 included source code changes that ended up causing build
> failures in several of the libcrypt cipher files with
> ---
> libgrubgcry_a-arcfour.o `test -f 
> 'grub-core/lib/libgcrypt-grub/cipher/arcfour.c' || echo 
> './'`grub-core/lib/libgcrypt-grub/cipher/arcfour.c
> In file included from ./include/grub/misc.h:27:0,
>                   from ./grub-core/lib/libgcrypt_wrap/cipher_wrap.h:24,
>                   from grub-core/lib/libgcrypt-grub/cipher/types.h:2,
>                   from grub-core/lib/libgcrypt-grub/cipher/arcfour.c:30:
> ./include/grub/i18n.h: In function '_':
> ./include/grub/i18n.h:56:10: error: 'LC_MESSAGES' undeclared (first use 
> in this function)
> ./include/grub/i18n.h:56:10: note: each undeclared identifier is 
> reported only once for each function it appears in
> make[3]: *** 
> [grub-core/lib/libgcrypt-grub/cipher/libgrubgcry_a-arcfour.o] Error 1
> ---
> when building the utils.
> 
> This occurs with any -O level other than -O0.
> 
> I traced the culprit down to the (system) libintl.h, which has a cute
> little section which checks if __OPTIMIZE__ is set, and if so redefines
> gettext() as a macro for dcgettext (domainname, msgid, LC_MESSAGES).
> Since this is all preprocessor driven in the C library headers, 
> -fno-builtin has no effect.
> 
> Also, when building on my x86_64 workstation only, I get a failure when
> compiling grub-core/lib/crypto.c - due to (system) fgets() ending up 
> with a warn-unused-result prototype when building with optimizations.
> 
> And, also on my workstation only, util/ieee1275/ofpath.c (system) read() 
> fails due to warn-unused-results, just like fgets() above.
> 
> All but one of these issues "go away" with -U__OPTIMIZE__ :
> grub-core/lib/libgcrypt-grub/cipher/rijndael.c gives a few screenfuls
> of warnings anyway, and only builds successfully when -O2 is removed 
> from the build command line (or -O0 is appended).
> 

I wonder why it did not happen before. Apparently, empty locale.h is
present since 2010-04-10 (rev 2311). Removing it fixes the problem, but
I presume it should not be empty in the first place.


From: Andrey Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] remove stray locale.h

Empty locale.h caused compilation errors.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 po/POTFILES.in |    1 -
 1 file changed, 1 deletion(-)

diff --git a/grub-core/lib/posix_wrap/locale.h b/grub-core/lib/posix_wrap/locale.h
deleted file mode 100644
index e69de29..0000000
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 01cc53c..358de99 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -443,7 +443,6 @@
 ./grub-core/lib/posix_wrap/langinfo.h
 ./grub-core/lib/posix_wrap/limits.h
 ./grub-core/lib/posix_wrap/localcharset.h
-./grub-core/lib/posix_wrap/locale.h
 ./grub-core/lib/posix_wrap/stdint.h
 ./grub-core/lib/posix_wrap/stdio.h
 ./grub-core/lib/posix_wrap/stdlib.h
-- 
tg: (4b9ea2e..) u/locale.h (depends on: master)



  reply	other threads:[~2013-01-30 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 18:32 Trunk fails to build with -O<anything other than 0> Leif Lindholm
2013-01-30 19:41 ` Andrey Borzenkov [this message]
2013-01-31 14:04   ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130130234121.69db8dbb@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=leif.lindholm@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.