All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/18] Check if cc is from apple toolchain
@ 2009-05-30 14:45 Vladimir 'phcoder' Serbinenko
  2009-05-30 14:47 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-05-30 14:45 UTC (permalink / raw)
  To: The development of GRUB 2

This patch checks if cc is Apple's version and enables additional
command line arguments if it is

-- 
Regards
Vladimir 'phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/18] Check if cc is from apple toolchain
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-05-30 14:47 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

On Sat, May 30, 2009 at 4:45 PM, Vladimir 'phcoder' Serbinenko
<phcoder@gmail.com> wrote:
> This patch checks if cc is Apple's version and enables additional
> command line arguments if it is
>
> --
> Regards
> Vladimir 'phcoder' Serbinenko
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: 05_cccheck.diff --]
[-- Type: text/x-patch, Size: 10737 bytes --]

diff --git a/Makefile.in b/Makefile.in
index e00f9c3..da2ec48 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -64,16 +64,22 @@ mkinstalldirs = $(srcdir)/mkinstalldirs
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+ASFLAGS = @ASFLAGS@
 LDFLAGS = @LDFLAGS@
 CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include -Wall -W \
 	 -DGRUB_LIBDIR=\"$(pkglibdir)\"
 TARGET_CC = @TARGET_CC@
 TARGET_CFLAGS = @TARGET_CFLAGS@
+TARGET_ASFLAGS = @TARGET_ASFLAGS@
+TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@
+TARGET_APPLE_CC = @TARGET_APPLE_CC@
+OBJCONV = @OBJCONV@
 TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \
 	-Wall -W
 TARGET_LDFLAGS = @TARGET_LDFLAGS@
 TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
 TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@
+TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
 TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
 EXEEXT = @EXEEXT@
 OBJCOPY = @OBJCOPY@
@@ -186,8 +192,12 @@ build_env.mk: Makefile
 	(\
 	echo "TARGET_CC=$(TARGET_CC)" ; \
 	echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
-	echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \
+	echo "TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \
+	echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \
 	echo "STRIP=$(STRIP)" ; \
+	echo "OBJCONV=$(OBJCONV)" ; \
+	echo "TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \
+	echo "TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \
 	echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
 	echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
 	echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
diff --git a/aclocal.m4 b/aclocal.m4
index 38a9a4a..10e0ca5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -156,6 +156,36 @@ rm -f conftest*])
 
 AC_MSG_RESULT([$grub_cv_i386_asm_addr32])])
 
+dnl check if our compiler is apple cc
+dnl because it requires numerous workarounds
+AC_DEFUN(grub_apple_cc,
+[AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING([whether our compiler is apple cc])
+AC_CACHE_VAL(grub_cv_apple_cc,
+[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then
+  grub_cv_apple_cc=yes
+else
+  grub_cv_apple_cc=no
+fi
+])
+
+AC_MSG_RESULT([$grub_cv_apple_cc])])
+
+dnl check if our target compiler is apple cc
+dnl because it requires numerous workarounds
+AC_DEFUN(grub_apple_target_cc,
+[AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING([whether our target compiler is apple cc])
+AC_CACHE_VAL(grub_cv_apple_target_cc,
+[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then
+  grub_cv_apple_target_cc=yes
+else
+  grub_cv_apple_target_cc=no
+fi
+])
+
+AC_MSG_RESULT([$grub_cv_apple_target_cc])])
+
 
 dnl Later versions of GAS requires that addr32 and data32 prefixes
 dnl appear in the same lines as the instructions they modify, while
diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk
index a72d2d2..8385767 100644
--- a/conf/i386-pc.rmk
+++ b/conf/i386-pc.rmk
@@ -16,31 +16,31 @@ pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \
 # For boot.img.
 boot_img_SOURCES = boot/i386/pc/boot.S
 boot_img_ASFLAGS = $(COMMON_ASFLAGS)
-boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00
 boot_img_FORMAT = binary
 
 # For pxeboot.img
 pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S
 pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS)
-pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00
 pxeboot_img_FORMAT = binary
 
 # For diskboot.img.
 diskboot_img_SOURCES = boot/i386/pc/diskboot.S
 diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
-diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000
+diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)8000
 diskboot_img_FORMAT = binary
 
 # For lnxboot.img.
 lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S
 lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS)
-lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000
+lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)6000
 lnxboot_img_FORMAT = binary
 
 # For cdboot.img.
 cdboot_img_SOURCES = boot/i386/pc/cdboot.S
 cdboot_img_ASFLAGS = $(COMMON_ASFLAGS)
-cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00
 cdboot_img_FORMAT = binary
 
 # For kernel.img.
@@ -63,9 +63,9 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
 	machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
 	machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \
 	machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h
-kernel_img_CFLAGS = $(COMMON_CFLAGS)
+kernel_img_CFLAGS = $(COMMON_CFLAGS)  $(TARGET_IMG_CFLAGS)
 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
-kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
+kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
 kernel_img_FORMAT = binary
 
 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
diff --git a/configure.ac b/configure.ac
index 98cd841..6649cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,6 +167,11 @@ AC_C_BIGENDIAN
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(long)
 
+grub_apple_cc
+if test x$grub_cv_apple_cc == xyes ; then
+  CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
+  ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
+fi
 if test "x$host_m32" = x1; then
   # Force 32-bit mode.
   CFLAGS="$CFLAGS -m32"
@@ -206,31 +211,6 @@ AC_CHECK_FUNCS(posix_memalign memalign asprintf)
 # Check for target programs.
 #
 
-
-# Use linker script if present, otherwise use builtin -N script.
-AC_MSG_CHECKING([for option to link raw image])
-if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
-  TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
-  TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
-  TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
-else
-  TARGET_IMG_LDSCRIPT=
-  TARGET_IMG_LDFLAGS='-Wl,-N'
-  TARGET_IMG_LDFLAGS_AC='-Wl,-N'
-fi
-AC_SUBST(TARGET_IMG_LDSCRIPT)
-AC_SUBST(TARGET_IMG_LDFLAGS)
-AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC])
-
-# For platforms where ELF is not the default link format.
-AC_MSG_CHECKING([for command to convert module to ELF format])
-case "${host_os}" in
-  cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
-  *) ;;
-esac
-AC_SUBST(TARGET_OBJ2ELF)
-AC_MSG_RESULT([$TARGET_OBJ2ELF])
-
 # Find tools for the target.
 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
   tmp_ac_tool_prefix="$ac_tool_prefix"
@@ -287,7 +267,7 @@ if test "x$TARGET_CFLAGS" = x; then
   # Force no alignment to save space on i386.
   if test "x$target_cpu" = xi386; then
     AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-      CFLAGS="-falign-loops=1"
+      CFLAGS="$CFLAGS -falign-loops=1"
       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
 		        [grub_cv_cc_falign_loop=yes],
 			[grub_cv_cc_falign_loop=no])
@@ -301,16 +281,59 @@ if test "x$TARGET_CFLAGS" = x; then
   fi
 fi
 
+grub_apple_target_cc
+if test x$grub_cv_apple_target_cc == xyes ; then
+  TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
+  CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
+  TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
+  TARGET_APPLE_CC=1
+  TARGET_IMG_LDSCRIPT=
+  TARGET_IMG_CFLAGS="-static"
+  TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
+  TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
+else
+  TARGET_APPLE_CC=0
+# Use linker script if present, otherwise use builtin -N script.
+AC_MSG_CHECKING([for option to link raw image])
+if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
+  TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
+  TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}  -Wl,-Ttext,"
+  TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
+else
+  TARGET_IMG_LDSCRIPT=
+  TARGET_IMG_LDFLAGS='-Wl,-N  -Wl,-Ttext,'
+  TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
+fi
+TARGET_IMG_CFLAGS=
+fi
+
+AC_SUBST(TARGET_IMG_LDSCRIPT)
+AC_SUBST(TARGET_IMG_LDFLAGS)
+AC_SUBST(TARGET_IMG_CFLAGS)
+AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC])
+
+# For platforms where ELF is not the default link format.
+AC_MSG_CHECKING([for command to convert module to ELF format])
+case "${host_os}" in
+  cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
+  *) ;;
+esac
+AC_SUBST(TARGET_OBJ2ELF)
+AC_MSG_RESULT([$TARGET_OBJ2ELF])
+
+
 if test "x$target_m32" = x1; then
   # Force 32-bit mode.
   TARGET_CFLAGS="$TARGET_CFLAGS -m32"
   TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
+  TARGET_MODULE_FORMAT="elf32"
 fi
 
 if test "x$target_m64" = x1; then
   # Force 64-bit mode.
   TARGET_CFLAGS="$TARGET_CFLAGS -m64"
   TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+  TARGET_MODULE_FORMAT="elf64"
 fi
 
 if test "$target_cpu"-"$platform" = x86_64-efi; then
@@ -361,6 +384,9 @@ if test x"$sap_possible" = xyes; then
 fi
 
 AC_SUBST(TARGET_CFLAGS)
+AC_SUBST(TARGET_MODULE_FORMAT)
+AC_SUBST(TARGET_APPLE_CC)
+AC_SUBST(TARGET_ASFLAGS)
 AC_SUBST(TARGET_CPPFLAGS)
 AC_SUBST(TARGET_LDFLAGS)
 
@@ -375,7 +401,9 @@ AC_CHECK_FUNCS(__bswapsi2 __bswapdi2)
 
 # Defined in aclocal.m4.
 grub_PROG_TARGET_CC
+if test "x$TARGET_APPLE_CC" != x1 ; then
 grub_PROG_OBJCOPY_ABSOLUTE
+fi
 grub_PROG_LD_BUILD_ID_NONE
 grub_ASM_USCORE
 if test "x$target_cpu" = xi386; then
@@ -383,7 +411,7 @@ if test "x$target_cpu" = xi386; then
     # Check symbols provided by linker script.
     CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100"
   fi
-  if test "x$platform" = xpc; then
+  if test "x$platform" = xpc && test "x$TARGET_APPLE_CC" != x1 ; then
     grub_CHECK_BSS_START_SYMBOL
     grub_CHECK_END_SYMBOL
   fi
@@ -482,6 +510,7 @@ AC_ARG_ENABLE([efiemu],
 	      [AS_HELP_STRING([--enable-efiemu],
                              [build and install the efiemu runtimes])])
 AC_SUBST([enable_efiemu])
+AC_SUBST(ASFLAGS)
 
 # Output files.
 grub_CHECK_LINK_DIR
diff --git a/genmk.rb b/genmk.rb
index abdb8ca..cfe120a 100644
--- a/genmk.rb
+++ b/genmk.rb
@@ -129,8 +129,13 @@ UNDSYMFILES += #{undsym}
 	sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1)
 
 ifneq ($(#{prefix}_EXPORTS),no)
+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
 endif
 
 #{undsym}: #{pre_obj}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/18] Check if cc is from apple toolchain
  2009-05-30 14:47 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-16  1:20   ` Pavel Roskin
  2009-06-16 10:44     ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2009-06-16  1:20 UTC (permalink / raw)
  To: The development of GRUB 2

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/18] Check if cc is from apple toolchain
  2009-06-16  1:20   ` Pavel Roskin
@ 2009-06-16 10:44     ` Vladimir 'phcoder' Serbinenko
  0 siblings, 0 replies; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-16 10:44 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 2793 bytes --]

On Tue, Jun 16, 2009 at 3:20 AM, Pavel Roskin <proski@gnu.org> 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

[-- Attachment #2: Type: text/html, Size: 4687 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-16 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2009-06-16 10:44     ` Vladimir 'phcoder' Serbinenko

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.