All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH 5/18] Check if cc is from apple toolchain
Date: Mon, 15 Jun 2009 21:20:40 -0400	[thread overview]
Message-ID: <1245115240.27324.26.camel@mj> (raw)
In-Reply-To: <d7ead6de0905300747q63d8ea96o39ebd301a45e1738@mail.gmail.com>

On Sat, 2009-05-30 at 16:47 +0200, Vladimir 'phcoder' Serbinenko wrote:

> +dnl check if our compiler is apple cc
> +dnl because it requires numerous workarounds
> +AC_DEFUN(grub_apple_cc,

We don't use lowercase names for macros.  They could conflict with
variable names.

> -boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)
> -Wl,-Ttext,7C00
> +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00

This looks like a hack.

> +if test x$grub_cv_apple_target_cc == xyes ; then

Autoconf uses single "=" in test.  I believe old versions of bash would
not accept "==".  I have applied the fix for that.

> +else
> +  TARGET_APPLE_CC=0
> +# Use linker script if present, otherwise use builtin -N script.
> +AC_MSG_CHECKING([for option to link raw image])

The formatting is messed up here.

> +AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC])

That's out of place.

> +if test "x$TARGET_APPLE_CC" != x1 ; then
>  grub_PROG_OBJCOPY_ABSOLUTE
> +fi

What's wrong with it?  I actually think that we could drop that test
entirely and use strip instead of objcopy in i386-pc.

> +AC_SUBST(ASFLAGS)

Maybe there is a way to detect Apple by the macros i

> +ifneq ($(TARGET_APPLE_CC),1)
>  #{defsym}: #{pre_obj}
>         $(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1
> #{mod_name}/' > $@
> +else
> +#{defsym}: #{pre_obj}
> +       $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]'  | sed 's/^
> \\([^ ]*\\).*/\\1 #{mod_name}/' > $@
> +endif

This goes beyond the "Check if cc is from apple toolchain".  It's a
separate fix that is not explained.  sed can generally do the same
things as grep.  Is it possible to have an expression that would work
for GNU and Apple nm?

I thought somebody would review the patches and object, but in this
case, nobody looked :-(

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2009-06-16  1:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-30 14:45 [PATCH 5/18] Check if cc is from apple toolchain Vladimir 'phcoder' Serbinenko
2009-05-30 14:47 ` Vladimir 'phcoder' Serbinenko
2009-06-16  1:20   ` Pavel Roskin [this message]
2009-06-16 10:44     ` Vladimir 'phcoder' Serbinenko

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=1245115240.27324.26.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /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.