Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MGW9d-0003YC-Ff for mharc-grub-devel@gnu.org; Tue, 16 Jun 2009 06:44:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGW9c-0003Y7-6D for grub-devel@gnu.org; Tue, 16 Jun 2009 06:44:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGW9W-0003Xv-Q3 for grub-devel@gnu.org; Tue, 16 Jun 2009 06:44:35 -0400 Received: from [199.232.76.173] (port=50147 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGW9W-0003Xs-Jy for grub-devel@gnu.org; Tue, 16 Jun 2009 06:44:30 -0400 Received: from mail-fx0-f216.google.com ([209.85.220.216]:40381) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGW9W-0007A0-0M for grub-devel@gnu.org; Tue, 16 Jun 2009 06:44:30 -0400 Received: by fxm12 with SMTP id 12so2418868fxm.42 for ; Tue, 16 Jun 2009 03:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0SGizleveoTxpPpR8t49A8TVm973wUK6Wu2HQza+jTY=; b=SpVnUs7CGsLnX9Hah/TsYbuxxstcbrJ1LbzAxw2rynfQQ9CooGj1jDd0ASKl72Ydce saZTOM1qnSM6oBv1iO7bMbzUSFtVELtN9wYLg0xa3TXQyyDIKuPjGIwO2mOJz4viRGeE hdmB/LsJjBpV66AcoY1Lf2W3pibAnOP4aa2XE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dUWL8czt+R0huIkZjqWlihEbF3RX0keA+whND5goGqaOBjWD2hpYLfBJnKTblRSqA7 2NV0TdkuRYnRRHzTCrrGxneTcriE45R/ppk+UJze2hW++EzRmm4LVtSSeIJiRe2Y4Mzq WhDmtnBsfydMexoX/b53IAmdQY9Q+Z1qg3ZhE= MIME-Version: 1.0 Received: by 10.204.62.68 with SMTP id w4mr8103991bkh.93.1245149065563; Tue, 16 Jun 2009 03:44:25 -0700 (PDT) In-Reply-To: <1245115240.27324.26.camel@mj> References: <1245115240.27324.26.camel@mj> Date: Tue, 16 Jun 2009 12:44:25 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: multipart/alternative; boundary=001636c92477becdd3046c74dbcb X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH 5/18] Check if cc is from apple toolchain X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2009 10:44:36 -0000 --001636c92477becdd3046c74dbcb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Tue, Jun 16, 2009 at 3:20 AM, Pavel Roskin wrote: > 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. > Thanks you for your comments. Although I usually understand configure scripts I'm not used to write them. Actually I used another test as a template. I'll check which exactly and so we can fix both of them > > > -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. > Otherwise we would have to make separate variables for every link address. Would you prefer it with separate variables? > > > +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. > Thanks > > > +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. > Thanks > > > +if test "x$TARGET_APPLE_CC" != x1 ; then > > grub_PROG_OBJCOPY_ABSOLUTE > > +fi > > What's wrong with it? There is no objcopy in Apple's toolchain > > > +AC_SUBST(ASFLAGS) > > Maybe there is a way to detect Apple by the macros i > I will look into it > > > +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? > The modification is actually to remove --defined-only argument and the grep command is here to simulate this --defined-only argument. Perhaps you're right but imo it's better to use --defined-only rather than grep'ing through the output and I don't see why because of secondary compiling platform we should abandon a useful compiling feature on primary platform > > I thought somebody would review the patches and object, but in this > case, nobody looked :-( > > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'phcoder' Serbinenko --001636c92477becdd3046c74dbcb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Jun 16, 2009 at 3:20 AM, Pavel R= oskin <proski@gnu.or= g> wrote:
On Sat, 2009-05-30 at 16:47 +0200, Vladimir 'phcoder' Serbinenko wr= ote:

> +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. =A0They could conflict with variable names.
Thanks you for your comments. Although I usually understa= nd configure scripts I'm not used to write them.=A0 Actually I used ano= ther test as a template. I'll check which exactly and so we can fix bot= h of them

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

This looks like a hack.
Otherwise we would have to make separate variables for ev= ery link address. Would you prefer it with separate variables?

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

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

> +else
> + =A0TARGET_APPLE_CC=3D0
> +# 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.
Thanks

> +if test "x$TARGET_APPLE_CC" !=3D x1 ; then
> =A0grub_PROG_OBJCOPY_ABSOLUTE
> +fi

What's wrong with it?
There is no objcopy in Apple= 9;s toolchain

> +AC_SUBST(ASFLAGS)

Maybe there is a way to detect Apple by the macros i
I will look into it

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

This goes beyond the "Check if cc is from apple toolchain". =A0It= 's a
separate fix that is not explained. =A0sed can generally do the same
things as grep. =A0Is it possible to have an expression that would work
for GNU and Apple nm?
The modification is actually to remove --defined-only arg= ument and the grep command is here to simulate this --defined-only argument= . Perhaps you're right but imo it's better to use --defined-only ra= ther than grep'ing through the output and I don't see why because o= f secondary compiling platform we should abandon a useful compiling feature= on primary platform

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

--
Regards,
Pavel Roskin


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel



--
Regards
Vladimir = 9;phcoder' Serbinenko
--001636c92477becdd3046c74dbcb--