All of lore.kernel.org
 help / color / mirror / Atom feed
* Grub2 on Mac OS X
@ 2005-03-21 18:55 Antoine Terrienne
  2005-03-22 20:20 ` Yoshinori K. Okuji
  0 siblings, 1 reply; 16+ messages in thread
From: Antoine Terrienne @ 2005-03-21 18:55 UTC (permalink / raw)
  To: grub-devel

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


Hello,

I'm trying to compile Grub2 on Mac OS X and I get somme truble. To be more
precise I try to compile from powerpc-apple-darwinX.Y.Z to powerpc-elf. The gcc
provided with XCode cannot link at arbitrary address so I had to rebuild a
complete compilation environment (binutils/gcc) with --target=powerpc-elf. So
far so good, I was able to build the L4 kernel and libs for Pistachio L4 for
powerpc. Now I try to get Grub2 to boot it.

So I manage to compile Grub with --host=powerpc-elf. I fond manny errors I
corrected : configure fails at detecting both gcc (from the system) and
powerpc-elf-gcc (for xcompil). The were somme problems with the differences
between linux and Mac OS like malloc.h located in malloc/malloc.h for Mac.
There were truble also with the argp functions provided by glibc. This is not
present in Mac OS X so I replaced it by getopt like for grub-mkimage. There
were somme other problems with the mix-up of i386 code used by the ppc part.
Somme of the types defined in include/gruc/i386/pc/init.h were not present il
powerpc/ieee1275/init.h.
Grub2 still fails at compiling (somewere in the linux module) now but I'll try
to find a way to make it work. Most problem I get it from the use of somme
linux specific types that are not present on Mac OS.

Here is a patch with the modifications I made. Please tell me if some of them
are wrong. I hope I would help.

Thank's
bye

--
--
  ____
 /    \  / antoine.terrienne@free.fr
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/

[-- Attachment #2: grub2_on_macosx_20050321.patch --]
[-- Type: application/octet-stream, Size: 34406 bytes --]

diff -cNr ../grub2/Makefile.in grub2/Makefile.in
*** ../grub2/Makefile.in	Mon Mar 21 17:42:55 2005
--- grub2/Makefile.in	Mon Mar 21 18:07:51 2005
***************
*** 60,66 ****
  BUILD_CC = @BUILD_CC@
  BUILD_CFLAGS = -g -O2
  BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \
! 	-DGRUB_DATADIR=\"$(pkgdatadir)\"
  OBJCOPY = @OBJCOPY@
  STRIP = @STRIP@
  NM = @NM@
--- 60,66 ----
  BUILD_CC = @BUILD_CC@
  BUILD_CFLAGS = -g -O2
  BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \
! 	-DGRUB_DATADIR=\"$(pkgdatadir)\" @BUILD_CPPFLAGS@
  OBJCOPY = @OBJCOPY@
  STRIP = @STRIP@
  NM = @NM@
diff -cNr ../grub2/aclocal.m4 grub2/aclocal.m4
*** ../grub2/aclocal.m4	Sun Apr  4 15:45:59 2004
--- grub2/aclocal.m4	Mon Mar 21 17:55:39 2005
***************
*** 329,331 ****
--- 329,338 ----
    AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
  fi
  ])
+ 
+ AC_DEFINE([HAVE_MEMALIGN], 1, [Define to 1 if you vare the memalign function])
+ AH_VERBATIM([HAVE_MEMALIGN], [#ifndef HAVE_MEMALIGN
+ #define memalign(a, b)	malloc(b)
+ #endif])
+ 
+ AC_DEFINE([HAVE_INTPTR_T], 1, [Define to 1 if you vare the memalign function])
diff -cNr ../grub2/autom4te.cache/output.0 grub2/autom4te.cache/output.0
*** ../grub2/autom4te.cache/output.0	Tue Mar  1 15:23:38 2005
--- grub2/autom4te.cache/output.0	Mon Mar 21 17:55:51 2005
***************
*** 310,316 ****
  # include <unistd.h>
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIB@&t@OBJS LTLIBOBJS'
  ac_subst_files=''
  
  # Initialize some variables set by options.
--- 310,316 ----
  # include <unistd.h>
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP BUILD_CPPFLAGS LIB@&t@OBJS LTLIBOBJS'
  ac_subst_files=''
  
  # Initialize some variables set by options.
***************
*** 3881,3886 ****
--- 3881,3889 ----
  
  # For cross-compiling.
  if test "x$build" = "x$host"; then
+   BUILD_CC="$CC"
+   
+ else
    for ac_prog in gcc egcs cc
  do
    # Extract the first word of "$ac_prog", so it can be a program name with args.
***************
*** 3924,3932 ****
  echo "$as_me: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&2;}
     { (exit 1); exit 1; }; }"
  
- else
-   BUILD_CC="$CC"
-   
  fi
  
  # Test the C compiler for the build environment.
--- 3927,3932 ----
***************
*** 5337,5342 ****
--- 5337,5462 ----
  _ACEOF
  
  
+ echo "$as_me:$LINENO: checking for memalign in -lc" >&5
+ echo $ECHO_N "checking for memalign in -lc... $ECHO_C" >&6
+ if test "${ac_cv_lib_c_memalign+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lc  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ 
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ /* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+ char memalign ();
+ int
+ main ()
+ {
+ memalign ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+   (eval $ac_link) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+          { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_lib_c_memalign=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_cv_lib_c_memalign=no
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_c_memalign" >&5
+ echo "${ECHO_T}$ac_cv_lib_c_memalign" >&6
+ if test $ac_cv_lib_c_memalign = yes; then
+   cat >>confdefs.h <<\_ACEOF
+ @%:@define HAVE_MEMALIGN 1
+ _ACEOF
+ 
+ fi
+ 
+ echo "$as_me:$LINENO: checking for intptr_t" >&5
+ echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6
+ if test "${ac_cv_type_intptr_t+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ if ((intptr_t *) 0)
+   return 0;
+ if (sizeof (intptr_t))
+   return 0;
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+          { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_type_intptr_t=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_cv_type_intptr_t=no
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5
+ echo "${ECHO_T}$ac_cv_type_intptr_t" >&6
+ if test $ac_cv_type_intptr_t = yes; then
+   
+ cat >>confdefs.h <<_ACEOF
+ @%:@define HAVE_INTPTR_T 1
+ _ACEOF
+ 
+ cat >>confdefs.h <<\_ACEOF
+ @%:@define HAVE_INTPTR_T 1
+ _ACEOF
+ 
+ fi
+ 
  
  # Check LZO when compiling for the i386.
  if test "x$host_cpu" = xi386; then
***************
*** 5494,5499 ****
--- 5614,5624 ----
  CFLAGS="$tmp_CFLAGS"
  CPPFLAGS="$tmp_CPPFLAGS"
  
+ case "$build_vendor"-"$build_os" in
+ 	apple-darwin*) BUILD_CPPFLAGS="$BUILD_CPPFLAGS -D_MACOSX_" ;;
+ esac
+ 
+ 
  # Output files.
                      ac_config_links="$ac_config_links include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor"
  
***************
*** 6149,6154 ****
--- 6274,6280 ----
  s,@BUILD_CC@,$BUILD_CC,;t t
  s,@CPP@,$CPP,;t t
  s,@EGREP@,$EGREP,;t t
+ s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
  s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
  s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  CEOF
diff -cNr ../grub2/autom4te.cache/requests grub2/autom4te.cache/requests
*** ../grub2/autom4te.cache/requests	Tue Mar  1 15:26:30 2005
--- grub2/autom4te.cache/requests	Mon Mar 21 18:05:52 2005
***************
*** 15,110 ****
                          'configure.ac'
                        ],
                        {
-                         'AC_HEADER_DIRENT' => 1,
-                         'm4_pattern_forbid' => 1,
-                         'AC_CHECK_MEMBERS' => 1,
-                         'AC_PROG_CXX' => 1,
-                         'AC_TYPE_UID_T' => 1,
-                         'AC_CANONICAL_HOST' => 1,
-                         'AC_FUNC_LSTAT' => 1,
-                         'AC_FUNC_FORK' => 1,
-                         'AC_FUNC_FSEEKO' => 1,
-                         'AC_FUNC_MKTIME' => 1,
-                         'AC_SUBST' => 1,
-                         'm4_include' => 1,
-                         'AC_FUNC_ALLOCA' => 1,
-                         'AH_OUTPUT' => 1,
                          'AC_CHECK_LIB' => 1,
!                         'AC_FUNC_STRTOD' => 1,
!                         'AC_DEFINE_TRACE_LITERAL' => 1,
!                         'AC_FUNC_ERROR_AT_LINE' => 1,
!                         'AC_PROG_LIBTOOL' => 1,
!                         'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
!                         'AC_STRUCT_ST_BLOCKS' => 1,
!                         'AC_FUNC_SETPGRP' => 1,
!                         'AC_FUNC_UTIME_NULL' => 1,
                          'AM_PROG_CC_C_O' => 1,
!                         'AC_FUNC_STRNLEN' => 1,
!                         'AC_PATH_X' => 1,
!                         'include' => 1,
                          'AC_FUNC_MEMCMP' => 1,
                          'AC_C_VOLATILE' => 1,
!                         'AC_FUNC_REALLOC' => 1,
!                         'AC_PROG_RANLIB' => 1,
!                         'AC_FUNC_GETPGRP' => 1,
!                         'AC_FUNC_GETLOADAVG' => 1,
!                         'AM_AUTOMAKE_VERSION' => 1,
!                         'AC_STRUCT_TM' => 1,
!                         'AC_CHECK_FUNCS' => 1,
!                         'AC_REPLACE_FNMATCH' => 1,
!                         'AC_FUNC_MALLOC' => 1,
                          'AC_FUNC_OBSTACK' => 1,
!                         'AC_PROG_YACC' => 1,
!                         'AC_TYPE_MODE_T' => 1,
!                         'AC_FUNC_STAT' => 1,
                          'AC_TYPE_SIZE_T' => 1,
                          'AC_FUNC_STRERROR_R' => 1,
                          'AC_STRUCT_TIMEZONE' => 1,
                          'AM_INIT_AUTOMAKE' => 1,
!                         'AC_FUNC_MBRTOWC' => 1,
!                         'AC_FUNC_STRCOLL' => 1,
!                         'AC_HEADER_TIME' => 1,
!                         'AC_CHECK_HEADERS' => 1,
!                         'AC_INIT' => 1,
!                         'AC_FUNC_CHOWN' => 1,
                          'AC_FUNC_VPRINTF' => 1,
!                         'AC_FUNC_STRFTIME' => 1,
                          'AC_CONFIG_HEADERS' => 1,
!                         'AC_PROG_MAKE_SET' => 1,
                          'AC_FUNC_CLOSEDIR_VOID' => 1,
!                         'AC_LIBSOURCE' => 1,
!                         'AC_DECL_SYS_SIGLIST' => 1,
                          'AC_PROG_GCC_TRADITIONAL' => 1,
!                         'AC_PROG_AWK' => 1,
!                         'AC_TYPE_OFF_T' => 1,
!                         'AC_HEADER_MAJOR' => 1,
!                         'AC_PROG_CC' => 1,
!                         'AC_FUNC_GETMNTENT' => 1,
!                         'AC_PROG_INSTALL' => 1,
!                         'AC_CHECK_TYPES' => 1,
!                         'AM_GNU_GETTEXT' => 1,
!                         'm4_pattern_allow' => 1,
!                         'AC_FUNC_WAIT3' => 1,
!                         'AC_CANONICAL_SYSTEM' => 1,
!                         'AC_HEADER_STDC' => 1,
                          'AC_PROG_CPP' => 1,
!                         'AC_TYPE_SIGNAL' => 1,
!                         'AC_FUNC_MMAP' => 1,
!                         'AC_C_CONST' => 1,
                          'AC_PROG_LN_S' => 1,
!                         'AC_HEADER_STAT' => 1,
!                         'AC_HEADER_SYS_WAIT' => 1,
!                         'AC_CONFIG_SUBDIRS' => 1,
!                         'AC_TYPE_PID_T' => 1,
!                         'AC_CONFIG_AUX_DIR' => 1,
!                         'AC_FUNC_SELECT_ARGTYPES' => 1,
!                         'AM_CONDITIONAL' => 1,
!                         'AC_FUNC_SETVBUF_REVERSED' => 1,
!                         'AC_PROG_LEX' => 1,
!                         'AC_CONFIG_FILES' => 1,
!                         'AC_C_INLINE' => 1,
!                         'AM_MAINTAINER_MODE' => 1,
!                         'AC_FUNC_GETGROUPS' => 1
                        }
                      ], 'Request' )
             );
--- 15,110 ----
                          'configure.ac'
                        ],
                        {
                          'AC_CHECK_LIB' => 1,
!                         'AC_FUNC_GETLOADAVG' => 1,
!                         'AC_FUNC_STRFTIME' => 1,
!                         'AC_PROG_CC' => 1,
!                         'AC_FUNC_STAT' => 1,
                          'AM_PROG_CC_C_O' => 1,
!                         'AC_C_CONST' => 1,
!                         'AC_FUNC_STRCOLL' => 1,
                          'AC_FUNC_MEMCMP' => 1,
+                         'AC_SUBST' => 1,
+                         'AC_FUNC_STRTOD' => 1,
+                         'AC_FUNC_STRNLEN' => 1,
+                         'AM_CONDITIONAL' => 1,
                          'AC_C_VOLATILE' => 1,
!                         'AC_PROG_MAKE_SET' => 1,
!                         'AC_DECL_SYS_SIGLIST' => 1,
                          'AC_FUNC_OBSTACK' => 1,
!                         'AC_PROG_LEX' => 1,
!                         'AC_PROG_RANLIB' => 1,
!                         'AC_FUNC_SELECT_ARGTYPES' => 1,
!                         'AC_FUNC_FSEEKO' => 1,
!                         'AC_PROG_LIBTOOL' => 1,
!                         'AC_PROG_AWK' => 1,
!                         'AC_FUNC_SETVBUF_REVERSED' => 1,
                          'AC_TYPE_SIZE_T' => 1,
+                         'AC_FUNC_MMAP' => 1,
+                         'AC_PROG_CXX' => 1,
+                         'AC_HEADER_STDC' => 1,
+                         'AH_OUTPUT' => 1,
+                         'include' => 1,
+                         'AC_TYPE_PID_T' => 1,
+                         'AC_FUNC_MALLOC' => 1,
+                         'AM_GNU_GETTEXT' => 1,
                          'AC_FUNC_STRERROR_R' => 1,
+                         'AC_FUNC_SETPGRP' => 1,
                          'AC_STRUCT_TIMEZONE' => 1,
+                         'AC_CONFIG_SUBDIRS' => 1,
+                         'AC_PROG_INSTALL' => 1,
+                         'AC_FUNC_REALLOC' => 1,
+                         'AC_LIBSOURCE' => 1,
+                         'AC_REPLACE_FNMATCH' => 1,
+                         'AC_PATH_X' => 1,
+                         'AC_CHECK_FUNCS' => 1,
+                         'AC_CONFIG_FILES' => 1,
+                         'AC_CONFIG_AUX_DIR' => 1,
+                         'AC_FUNC_ALLOCA' => 1,
+                         'AC_CANONICAL_HOST' => 1,
+                         'AC_CANONICAL_SYSTEM' => 1,
                          'AM_INIT_AUTOMAKE' => 1,
!                         'AC_TYPE_UID_T' => 1,
!                         'AC_FUNC_ERROR_AT_LINE' => 1,
!                         'AC_FUNC_GETPGRP' => 1,
!                         'AC_DEFINE_TRACE_LITERAL' => 1,
!                         'AM_MAINTAINER_MODE' => 1,
                          'AC_FUNC_VPRINTF' => 1,
!                         'AC_C_INLINE' => 1,
!                         'AM_AUTOMAKE_VERSION' => 1,
!                         'AC_FUNC_GETGROUPS' => 1,
!                         'm4_pattern_allow' => 1,
!                         'AC_HEADER_MAJOR' => 1,
!                         'AC_HEADER_SYS_WAIT' => 1,
!                         'AC_FUNC_CHOWN' => 1,
!                         'AC_FUNC_WAIT3' => 1,
!                         'AC_STRUCT_TM' => 1,
!                         'AC_TYPE_MODE_T' => 1,
!                         'AC_FUNC_MBRTOWC' => 1,
!                         'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
!                         'AC_STRUCT_ST_BLOCKS' => 1,
!                         'AC_FUNC_FORK' => 1,
!                         'm4_include' => 1,
                          'AC_CONFIG_HEADERS' => 1,
!                         'AC_CHECK_MEMBERS' => 1,
                          'AC_FUNC_CLOSEDIR_VOID' => 1,
!                         'AC_CHECK_HEADERS' => 1,
                          'AC_PROG_GCC_TRADITIONAL' => 1,
!                         'AC_FUNC_LSTAT' => 1,
                          'AC_PROG_CPP' => 1,
!                         'AC_CHECK_TYPES' => 1,
!                         'AC_FUNC_GETMNTENT' => 1,
!                         'AC_PROG_YACC' => 1,
!                         'AC_FUNC_UTIME_NULL' => 1,
!                         'AC_INIT' => 1,
!                         'm4_pattern_forbid' => 1,
                          'AC_PROG_LN_S' => 1,
!                         'AC_FUNC_MKTIME' => 1,
!                         'AC_TYPE_SIGNAL' => 1,
!                         'AC_HEADER_DIRENT' => 1,
!                         'AC_TYPE_OFF_T' => 1,
!                         'AC_HEADER_TIME' => 1,
!                         'AC_HEADER_STAT' => 1
                        }
                      ], 'Request' )
             );
diff -cNr ../grub2/autom4te.cache/traces.0 grub2/autom4te.cache/traces.0
*** ../grub2/autom4te.cache/traces.0	Tue Mar  1 15:23:38 2005
--- grub2/autom4te.cache/traces.0	Mon Mar 21 17:55:51 2005
***************
*** 1,3 ****
--- 1,12 ----
+ m4trace:aclocal.m4:333: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MEMALIGN])
+ m4trace:aclocal.m4:333: -1- AH_OUTPUT([HAVE_MEMALIGN], [/* Define to 1 if you vare the memalign function */
+ #undef HAVE_MEMALIGN])
+ m4trace:aclocal.m4:336: -1- AH_OUTPUT([HAVE_MEMALIGN], [#ifndef HAVE_MEMALIGN
+ #define memalign(a, b)	malloc(b)
+ #endif])
+ m4trace:aclocal.m4:338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTPTR_T])
+ m4trace:aclocal.m4:338: -1- AH_OUTPUT([HAVE_INTPTR_T], [/* Define to 1 if you vare the memalign function */
+ #undef HAVE_INTPTR_T])
  m4trace:configure.ac:14: -1- AC_INIT([GRUB], [1.90], [bug-grub@gnu.org])
  m4trace:configure.ac:14: -1- m4_pattern_forbid([^_?A[CHUM]_])
  m4trace:configure.ac:14: -1- m4_pattern_forbid([_AC_])
***************
*** 175,187 ****
  m4trace:configure.ac:131: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
  m4trace:configure.ac:131: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
  #undef SIZEOF_LONG])
! m4trace:configure.ac:136: -1- AC_CHECK_LIB([lzo], [__lzo_init2], [], [{ { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
  echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
     { (exit 1); exit 1; }; }])
! m4trace:configure.ac:136: -1- AH_OUTPUT([HAVE_LIBLZO], [/* Define to 1 if you have the `lzo\' library (-llzo). */
  #undef HAVE_LIBLZO])
! m4trace:configure.ac:136: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBLZO])
! m4trace:configure.ac:148: -1- AC_CONFIG_FILES([Makefile])
! m4trace:configure.ac:149: -1- AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
! m4trace:configure.ac:150: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
! m4trace:configure.ac:150: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
--- 184,210 ----
  m4trace:configure.ac:131: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
  m4trace:configure.ac:131: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
  #undef SIZEOF_LONG])
! m4trace:configure.ac:132: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MEMALIGN])
! m4trace:configure.ac:132: -1- AC_CHECK_LIB([c], [memalign], [cat >>confdefs.h <<\_ACEOF
! @%:@define HAVE_MEMALIGN 1
! _ACEOF
! ])
! m4trace:configure.ac:133: -2- AC_DEFINE_TRACE_LITERAL([HAVE_INTPTR_T])
! m4trace:configure.ac:133: -1- AC_CHECK_TYPES([intptr_t], [cat >>confdefs.h <<\_ACEOF
! @%:@define HAVE_INTPTR_T 1
! _ACEOF
! ])
! m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTPTR_T])
! m4trace:configure.ac:133: -1- AH_OUTPUT([HAVE_INTPTR_T], [/* Define to 1 if the system has the type `intptr_t\'. */
! #undef HAVE_INTPTR_T])
! m4trace:configure.ac:138: -1- AC_CHECK_LIB([lzo], [__lzo_init2], [], [{ { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
  echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
     { (exit 1); exit 1; }; }])
! m4trace:configure.ac:138: -1- AH_OUTPUT([HAVE_LIBLZO], [/* Define to 1 if you have the `lzo\' library (-llzo). */
  #undef HAVE_LIBLZO])
! m4trace:configure.ac:138: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBLZO])
! m4trace:configure.ac:150: -1- AC_SUBST([BUILD_CPPFLAGS])
! m4trace:configure.ac:155: -1- AC_CONFIG_FILES([Makefile])
! m4trace:configure.ac:156: -1- AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
! m4trace:configure.ac:157: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
! m4trace:configure.ac:157: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
diff -cNr ../grub2/config.h.in grub2/config.h.in
*** ../grub2/config.h.in	Wed Dec  3 20:17:24 2003
--- grub2/config.h.in	Mon Mar 21 17:55:52 2005
***************
*** 19,29 ****
--- 19,36 ----
  /* Define if C symbols get an underscore after compilation */
  #undef HAVE_ASM_USCORE
  
+ /* Define to 1 if the system has the type `intptr_t'. */
+ #undef HAVE_INTPTR_T
+ 
  /* Define to 1 if you have the <inttypes.h> header file. */
  #undef HAVE_INTTYPES_H
  
  /* Define to 1 if you have the `lzo' library (-llzo). */
  #undef HAVE_LIBLZO
+ 
+ #ifndef HAVE_MEMALIGN
+ #define memalign(a, b)	malloc(b)
+ #endif
  
  /* Define to 1 if you have the <memory.h> header file. */
  #undef HAVE_MEMORY_H
diff -cNr ../grub2/configure grub2/configure
*** ../grub2/configure	Tue Mar  1 15:23:39 2005
--- grub2/configure	Mon Mar 21 17:55:55 2005
***************
*** 310,316 ****
  # include <unistd.h>
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIBOBJS LTLIBOBJS'
  ac_subst_files=''
  
  # Initialize some variables set by options.
--- 310,316 ----
  # include <unistd.h>
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP BUILD_CPPFLAGS LIBOBJS LTLIBOBJS'
  ac_subst_files=''
  
  # Initialize some variables set by options.
***************
*** 3881,3886 ****
--- 3881,3889 ----
  
  # For cross-compiling.
  if test "x$build" = "x$host"; then
+   BUILD_CC="$CC"
+ 
+ else
    for ac_prog in gcc egcs cc
  do
    # Extract the first word of "$ac_prog", so it can be a program name with args.
***************
*** 3924,3932 ****
  echo "$as_me: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&2;}
     { (exit 1); exit 1; }; }"
  
- else
-   BUILD_CC="$CC"
- 
  fi
  
  # Test the C compiler for the build environment.
--- 3927,3932 ----
***************
*** 5337,5342 ****
--- 5337,5462 ----
  _ACEOF
  
  
+ echo "$as_me:$LINENO: checking for memalign in -lc" >&5
+ echo $ECHO_N "checking for memalign in -lc... $ECHO_C" >&6
+ if test "${ac_cv_lib_c_memalign+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lc  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ 
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ /* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+ char memalign ();
+ int
+ main ()
+ {
+ memalign ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+   (eval $ac_link) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+          { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_lib_c_memalign=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_cv_lib_c_memalign=no
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_c_memalign" >&5
+ echo "${ECHO_T}$ac_cv_lib_c_memalign" >&6
+ if test $ac_cv_lib_c_memalign = yes; then
+   cat >>confdefs.h <<\_ACEOF
+ #define HAVE_MEMALIGN 1
+ _ACEOF
+ 
+ fi
+ 
+ echo "$as_me:$LINENO: checking for intptr_t" >&5
+ echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6
+ if test "${ac_cv_type_intptr_t+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ if ((intptr_t *) 0)
+   return 0;
+ if (sizeof (intptr_t))
+   return 0;
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+          { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_type_intptr_t=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_cv_type_intptr_t=no
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5
+ echo "${ECHO_T}$ac_cv_type_intptr_t" >&6
+ if test $ac_cv_type_intptr_t = yes; then
+ 
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_INTPTR_T 1
+ _ACEOF
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_INTPTR_T 1
+ _ACEOF
+ 
+ fi
+ 
  
  # Check LZO when compiling for the i386.
  if test "x$host_cpu" = xi386; then
***************
*** 5494,5499 ****
--- 5614,5624 ----
  CFLAGS="$tmp_CFLAGS"
  CPPFLAGS="$tmp_CPPFLAGS"
  
+ case "$build_vendor"-"$build_os" in
+ 	apple-darwin*) BUILD_CPPFLAGS="$BUILD_CPPFLAGS -D_MACOSX_" ;;
+ esac
+ 
+ 
  # Output files.
                      ac_config_links="$ac_config_links include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor"
  
***************
*** 6149,6154 ****
--- 6274,6280 ----
  s,@BUILD_CC@,$BUILD_CC,;t t
  s,@CPP@,$CPP,;t t
  s,@EGREP@,$EGREP,;t t
+ s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
  s,@LIBOBJS@,$LIBOBJS,;t t
  s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  CEOF
diff -cNr ../grub2/configure.ac grub2/configure.ac
*** ../grub2/configure.ac	Sun Apr  4 15:45:59 2004
--- grub2/configure.ac	Mon Mar 21 17:51:42 2005
***************
*** 110,120 ****
  
  # For cross-compiling.
  if test "x$build" = "x$host"; then
-   AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
- 		 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
- else
    BUILD_CC="$CC"
    AC_SUBST(BUILD_CC)
  fi
  
  # Test the C compiler for the build environment.
--- 110,120 ----
  
  # For cross-compiling.
  if test "x$build" = "x$host"; then
    BUILD_CC="$CC"
    AC_SUBST(BUILD_CC)
+ else
+   AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
+ 		 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
  fi
  
  # Test the C compiler for the build environment.
***************
*** 129,134 ****
--- 129,136 ----
  AC_C_BIGENDIAN
  AC_CHECK_SIZEOF(void *)
  AC_CHECK_SIZEOF(long)
+ AC_CHECK_LIB(c,memalign, AC_DEFINE(HAVE_MEMALIGN))
+ AC_CHECK_TYPES(intptr_t, AC_DEFINE(HAVE_INTPTR_T))
  
  # Check LZO when compiling for the i386.
  if test "x$host_cpu" = xi386; then
***************
*** 141,146 ****
--- 143,153 ----
  CC="$tmp_CC"
  CFLAGS="$tmp_CFLAGS"
  CPPFLAGS="$tmp_CPPFLAGS"
+ 
+ case "$build_vendor"-"$build_os" in
+ 	apple-darwin*) BUILD_CPPFLAGS="$BUILD_CPPFLAGS -D_MACOSX_" ;;
+ esac
+ AC_SUBST(BUILD_CPPFLAGS)
  
  # Output files.
  AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu
diff -cNr ../grub2/include/grub/powerpc/ieee1275/init.h grub2/include/grub/powerpc/ieee1275/init.h
*** ../grub2/include/grub/powerpc/ieee1275/init.h	Mon Dec 27 14:46:20 2004
--- grub2/include/grub/powerpc/ieee1275/init.h	Mon Mar 21 18:00:35 2005
***************
*** 21,28 ****
  #ifndef GRUB_INIT_MACHINE_HEADER
  #define GRUB_INIT_MACHINE_HEADER	1
  
! void cmain (uint32_t r3, uint32_t r4 __attribute__((unused)), uint32_t r5);
  void grub_ofdisk_init (void);
  void grub_console_init (void);
  
  #endif /* ! GRUB_INIT_MACHINE_HEADER */
--- 21,35 ----
  #ifndef GRUB_INIT_MACHINE_HEADER
  #define GRUB_INIT_MACHINE_HEADER	1
  
! #include <grub/types.h>
! #include <grub/symbol.h>
! 
! void cmain (grub_uint32_t r3, grub_uint32_t r4 __attribute__((unused)), grub_uint32_t r5);
  void grub_ofdisk_init (void);
  void grub_console_init (void);
+ 
+ /* Halt the system, using APM if possible. If NO_APM is true, don't
+  * use APM even if it is available.  (from grub/i386/pc/init.h)*/
+ void EXPORT_FUNC (grub_halt) (int no_apm);
  
  #endif /* ! GRUB_INIT_MACHINE_HEADER */
diff -cNr ../grub2/util/grub-emu.c grub2/util/grub-emu.c
*** ../grub2/util/grub-emu.c	Thu Mar 10 17:47:05 2005
--- grub2/util/grub-emu.c	Mon Mar 21 18:03:49 2005
***************
*** 18,28 ****
   */
  
  #include <stdlib.h>
  #include <malloc.h>
  #include <sys/stat.h>
- #include <argp.h>
  #include <string.h>
  #include <signal.h>
  
  #include <grub/mm.h>
  #include <grub/setjmp.h>
--- 18,32 ----
   */
  
  #include <stdlib.h>
+ #ifdef _MACOSX_
+ #include <malloc/malloc.h>
+ #else
  #include <malloc.h>
+ #endif
  #include <sys/stat.h>
  #include <string.h>
  #include <signal.h>
+ #include <getopt.h>
  
  #include <grub/mm.h>
  #include <grub/setjmp.h>
***************
*** 86,103 ****
  }
  \f
  
- const char *argp_program_version = PACKAGE_STRING;
- const char *argp_program_bug_address = PACKAGE_BUGREPORT;
- static char doc[] = "GRUB emulator";
- 
- static struct argp_option options[] = {
-   {"root-device", 'r', "DEV",  0, "use DEV as the root device [default=guessed]", 0},
-   {"device-map",  'm', "FILE", 0, "use FILE as the device map", 0},
-   {"directory",   'd', "DIR",  0, "use GRUB files in the directory DIR", 0},
-   {"verbose",     'v', 0     , 0, "print verbose messages", 0},
-   { 0, 0, 0, 0, 0, 0 }
- };
- 
  struct arguments
  {
    char *root_dev;
--- 90,95 ----
***************
*** 105,138 ****
    char *dir;
  };
  
! static error_t
! parse_opt (int key, char *arg, struct argp_state *state)
  {
!   struct arguments *args = state->input;
    
!   switch (key)
      {
!     case 'r':
!       args->root_dev = arg;
!       break;
!     case 'd':
!       args->dir = arg;
!       break;
!     case 'm':
!       args->dev_map = arg;
!       break;
!     case 'v':
!       verbosity++;
!       break;
!     case ARGP_KEY_END:
!       break;
!     default:
!       return ARGP_ERR_UNKNOWN;
      }
-   return 0;
  }
- 
- static struct argp argp = {options, parse_opt, 0, doc, 0, 0, 0};
  \f
  
  int
--- 97,169 ----
    char *dir;
  };
  
! static struct option options[] =
!   {
!     {"root-device", required_argument, 0, 'r'},
!     {"device-map", required_argument, 0, 'm'},
!     {"directory", required_argument, 0, 'd'},
!     {"help", no_argument, 0, 'h'},
!     {"version", no_argument, 0, 'V'},
!     {"verbose", no_argument, 0, 'v'},
!     { 0, 0, 0, 0 },
!   };
! 
! static void
! usage (int status)
! {
!   if (status)
!     fprintf (stderr, "Try ``grub-emu --help'' for more information.\n");
!   else
!     printf ("\
! Usage: grub-emu ???\n\
! \n\
! Make something of GRUB... I guess...\n\
! \n\
! -r, --root-device=DEV   use DEV as the root device [default=guessed]\n\
! -m, --device-map=FILE   use FILE as the device map\n\
! -d, --directory=DIR     use GRUB files in the directory DIR\n\
! -h, --help              display this message and exit\n\
! -n, --note              add NOTE segment for CHRP Open Firmware\n\
! -V, --version           print version information and exit\n\
! -v, --verbose           print verbose messages\n\
! \n\
! Report bugs to " PACKAGE_BUGREPORT ".\n");
! 
!   exit (status);
! }
! 
! void	parse_args(struct arguments *args, int argc, char **argv)
  {
!   char c;
    
!   while ((c = getopt_long (argc, argv, "r:m:d:hVv", options, 0)) != -1)
      {
!       switch (c)
! 	{
! 	case 'r':
! 	  args->root_dev = optarg;
! 	  break;
! 	case 'm':
! 	  args->dev_map = optarg;
! 	  break;
! 	case 'd':
! 	  args->dir = optarg;
! 	  break;
! 	case 'h':
! 	  usage(0);
! 	  break;
! 	case 'V':
! 	  printf ("grub-emu (" PACKAGE_NAME ") " PACKAGE_VERSION "\n");
! 	  break;
! 	case 'v':
! 	  verbosity++;
! 	  break;
! 	default:
! 	  usage(1);
! 	  break;
! 	}
      }
  }
  \f
  
  int
***************
*** 148,155 ****
    
    progname = "grub-emu";
    
!   argp_parse (&argp, argc, argv, 0, 0, &args);
! 
    /* Make sure that there is a root device.  */
    if (! args.root_dev)
      {
--- 179,186 ----
    
    progname = "grub-emu";
    
!   parse_args(&args, argc, argv);
!   
    /* Make sure that there is a root device.  */
    if (! args.root_dev)
      {
diff -cNr ../grub2/util/misc.c grub2/util/misc.c
*** ../grub2/util/misc.c	Tue Mar  1 15:19:42 2005
--- grub2/util/misc.c	Mon Mar 21 18:10:56 2005
***************
*** 24,30 ****
--- 24,34 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <sys/time.h>
+ #ifdef _MACOSX_
+ #include <malloc/malloc.h>
+ #else
  #include <malloc.h>
+ #endif
  #include <unistd.h>
  
  #include <grub/util/misc.h>

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

* Re: Grub2 on Mac OS X
  2005-03-21 18:55 Antoine Terrienne
@ 2005-03-22 20:20 ` Yoshinori K. Okuji
  2005-03-23 20:42   ` Brian Sammon
  0 siblings, 1 reply; 16+ messages in thread
From: Yoshinori K. Okuji @ 2005-03-22 20:20 UTC (permalink / raw)
  To: The development of GRUB 2

On Monday 21 March 2005 07:55 pm, Antoine Terrienne wrote:
> Here is a patch with the modifications I made. Please tell me if some of
> them are wrong. I hope I would help.

Could you make a patch with -u? The standard diff format is too difficult for 
me.

I describe what I think are not appropriate in your patch:

- memalign should not be just a macro. memalign is not the same as malloc.

- The macro _MACOSX_ should not be defined. OS-specific code should be enabled 
in a more generic way. Take a look at the autoconf manual and the autobook 
<http://sources.redhat.com/autobook/>.

- Rather than replacing argp with getopt, please include the standalone 
version of argp <http://gd.tuwien.ac.at/utils/shells/lsh/>.

- ChangeLog, please.

Okuji



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

* Re: Grub2 on Mac OS X
@ 2005-03-23 13:20 antoine terrienne
  2005-03-23 20:45 ` Yoshinori K. Okuji
  0 siblings, 1 reply; 16+ messages in thread
From: antoine terrienne @ 2005-03-23 13:20 UTC (permalink / raw)
  To: grub-devel

Selon "Yoshinori K. Okuji" <okuji@enbug.org>:

 > On Monday 21 March 2005 07:55 pm, Antoine Terrienne wrote:
 > > Here is a patch with the modifications I made. Please tell me if 
some of
 > > them are wrong. I hope I would help.
 >
 > Could you make a patch with -u? The standard diff format is too 
difficult for
 > me.
 >
 > I describe what I think are not appropriate in your patch:
 >
 > - memalign should not be just a macro. memalign is not the same as 
malloc.
 >

memalign doesn't exist on Mac OS. malloc always returns 16 bytes 
aligned memory. This macro is only defined if there is no HAVE_MEMALIGN 
defined by the configure script. If 16 bytes alignment not enouth there 
is valloc that allocates on a page bondary but there is no such 
function as memalign.

 > - The macro _MACOSX_ should not be defined. OS-specific code should be
 > enabled
 > in a more generic way. Take a look at the autoconf manual and the 
autobook
 > <http://sources.redhat.com/autobook/>.
 >
 > - Rather than replacing argp with getopt, please include the 
standalone
 > version of argp <http://gd.tuwien.ac.at/utils/shells/lsh/>.
 >

You mean include it in Grub ?
Where such code should be placed in the source three ? normal/ util/ 
... ?
getopt is already used by grub-mkimage and available everywere so why 
not just using it with grub-emu ? Are there somme specific reasons ?

 > - ChangeLog, please.
 >
 > Okuji
 >

Ok I'll do that and send you a new patch with -u
Thank you for the comments

I have some others questions about the powerpc part of Grub2. It seems 
that many parts are just a copy of the i386. For exemple in the 
conf/powerpc-ieee1275.rmk. grub_emu_sources refer to 
commands/i386/pc/{reboot.c,halt.c,suspend.c}  but there exist somme 
commands/ieee1275/{reboot.c,halt.c,suspend.c}. Is this normal ?

thank you for the answers




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

* Re: Grub2 on Mac OS X
  2005-03-22 20:20 ` Yoshinori K. Okuji
@ 2005-03-23 20:42   ` Brian Sammon
  2005-03-23 21:09     ` Yoshinori K. Okuji
  0 siblings, 1 reply; 16+ messages in thread
From: Brian Sammon @ 2005-03-23 20:42 UTC (permalink / raw)
  To: The development of GRUB 2

> > Here is a patch with the modifications I made. Please tell me if some of
> > them are wrong. I hope I would help.
> 
> Could you make a patch with -u? The standard diff format is too difficult for 
> me.
> 
> I describe what I think are not appropriate in your patch:
> 
> - memalign should not be just a macro. memalign is not the same as malloc.

Antoine's post inspired me to investigate building grub2 on my OpenDarwin 
system.
I have two comments so far:
1)  The memalign issue can be avoided by not building grub-emu (and possibly 
doing something about grub-mkimage and grub-setup, which use util/misc.c but 
probably not memalign)  On darwin-ppc, these programs will not be missed much 
(by the type of geek currently using grub2), since it's relatively easy to 
arrange to call grubof from OpenFirmware, and do the setup from there.  On 
darwin-x86, the lack of these programs still leaves people with the option of 
using a grub floppy.
2)  Perhaps you should switch from memalign to posix_memalign.  There's better 
odds of convincing Apple to add posix_memalign to future releases of Darwin 
than with memalign.  It appears that memalign is glibc-specific.  Does 
{Free|Net|Open}BSD have memalign?  Is anyone building grub2 on any of the BSDs?









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

* Re: Grub2 on Mac OS X
  2005-03-23 13:20 Grub2 on Mac OS X antoine terrienne
@ 2005-03-23 20:45 ` Yoshinori K. Okuji
  2005-03-23 22:28   ` Antoine Terrienne
  0 siblings, 1 reply; 16+ messages in thread
From: Yoshinori K. Okuji @ 2005-03-23 20:45 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 23 March 2005 02:20 pm, antoine terrienne wrote:
> memalign doesn't exist on Mac OS. malloc always returns 16 bytes
> aligned memory. This macro is only defined if there is no HAVE_MEMALIGN
> defined by the configure script. If 16 bytes alignment not enouth there
> is valloc that allocates on a page bondary but there is no such
> function as memalign.

Is it hard to implement memalign using valloc? I don't know how it works on 
MacOSX.

> You mean include it in Grub ?

Sure.

> Where such code should be placed in the source three ? normal/ util/
> ... ?

Create a directory "lib" at the top source directory and link it if your 
system library does not have it.

> getopt is already used by grub-mkimage and available everywere so why
> not just using it with grub-emu ? Are there somme specific reasons ?

Technically speaking, argp is superior. So, I prefer keeping it to throwing it 
away.

> I have some others questions about the powerpc part of Grub2. It seems
> that many parts are just a copy of the i386. For exemple in the
> conf/powerpc-ieee1275.rmk. grub_emu_sources refer to
> commands/i386/pc/{reboot.c,halt.c,suspend.c}  but there exist somme
> commands/ieee1275/{reboot.c,halt.c,suspend.c}. Is this normal ?

Yes. There are good reasons. Take a look at the archive of this list.

Okuji



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

* Re: Grub2 on Mac OS X
  2005-03-23 20:42   ` Brian Sammon
@ 2005-03-23 21:09     ` Yoshinori K. Okuji
  2005-03-26 13:37       ` Marco Gerards
  0 siblings, 1 reply; 16+ messages in thread
From: Yoshinori K. Okuji @ 2005-03-23 21:09 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 23 March 2005 09:42 pm, Brian Sammon wrote:
> 2)  Perhaps you should switch from memalign to posix_memalign.  There's
> better odds of convincing Apple to add posix_memalign to future releases of
> Darwin than with memalign.  It appears that memalign is glibc-specific. 
> Does {Free|Net|Open}BSD have memalign?  Is anyone building grub2 on any of
> the BSDs?

memalign is used only because the utilities do not use GRUB's own memory 
management but operating system's. I think it would be better to change them 
to use GRUB's.

Okuji



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

* Re: Grub2 on Mac OS X
  2005-03-23 20:45 ` Yoshinori K. Okuji
@ 2005-03-23 22:28   ` Antoine Terrienne
  2005-03-26  0:22     ` Yoshinori K. Okuji
  0 siblings, 1 reply; 16+ messages in thread
From: Antoine Terrienne @ 2005-03-23 22:28 UTC (permalink / raw)
  To: The development of GRUB 2, Yoshinori K. Okuji; +Cc: The development of GRUB 2

Selon "Yoshinori K. Okuji" <okuji@enbug.org>:

>
> Is it hard to implement memalign using valloc? I don't know how it works on
> MacOSX.
>

Should be possible I'll take a look. But in most cases i found on the web malloc
is a good subtitute to memalign.

> Technically speaking, argp is superior. So, I prefer keeping it to throwing
> it
> away.
>

I agree argp is techically superior but adding a library in Grub2 mean keeping
it up-to-date with the mainstream distribution. This add a little anoyng work
just to add some functionalities that aren't used. If you really want to add it
I can do it but I'm not sure it is necessary.

> > I have some others questions about the powerpc part of Grub2. It seems
> > that many parts are just a copy of the i386. For exemple in the
> > conf/powerpc-ieee1275.rmk. grub_emu_sources refer to
> > commands/i386/pc/{reboot.c,halt.c,suspend.c}  but there exist somme
> > commands/ieee1275/{reboot.c,halt.c,suspend.c}. Is this normal ?
>
> Yes. There are good reasons. Take a look at the archive of this list.
>

Ok promise next time I will look before asking stupid question ;)

> Okuji
>
>

I found another glibc specific function : alloca. Used in cmain in
boot/powerpc/ieee1275/cmain.c. I repace it by declaring argv as an array of 64
elements : char *arg[64] (should be enouth ?). As the variables are allocated
in the stack just like alloca do it should work just the same.

I have another question about -DGRUB_UTIL. Can it be used to distinguish the
host compiled part and the build compiled part of grub ?
I have to handle types differenty in host and build as the build part doesn't
have stdlib.h. But this method fails on boot/powerpc/ieee1275/cmain.c that is
compiled with powerpc-elf-gcc (build) and the -DGRUB_UTIL flag.

Thanks for your answers


--
--
  ____
 /    \  / antoine.terrienne@free.fr
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/



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

* Re: Grub2 on Mac OS X
  2005-03-23 22:28   ` Antoine Terrienne
@ 2005-03-26  0:22     ` Yoshinori K. Okuji
  2005-03-26 12:09       ` Antoine Terrienne
  2005-03-26 13:40       ` Marco Gerards
  0 siblings, 2 replies; 16+ messages in thread
From: Yoshinori K. Okuji @ 2005-03-26  0:22 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 23 March 2005 11:28 pm, Antoine Terrienne wrote:
> Should be possible I'll take a look. But in most cases i found on the web
> malloc is a good subtitute to memalign.

But you must still check if a pointer returned by malloc is aligned correctly.

> I agree argp is techically superior but adding a library in Grub2 mean
> keeping it up-to-date with the mainstream distribution. This add a little
> anoyng work just to add some functionalities that aren't used. If you
> really want to add it I can do it but I'm not sure it is necessary.

Necessary. It is not a big burden anyway.

> I found another glibc specific function : alloca. Used in cmain in
> boot/powerpc/ieee1275/cmain.c. I repace it by declaring argv as an array of
> 64 elements : char *arg[64] (should be enouth ?). As the variables are
> allocated in the stack just like alloca do it should work just the same.

This kind of functions should be complemented by a library. Look at Gnulib:

http://www.gnu.org/software/gnulib/

I think Gnulib contains argp as well.

> I have another question about -DGRUB_UTIL. Can it be used to distinguish
> the host compiled part and the build compiled part of grub ?
> I have to handle types differenty in host and build as the build part
> doesn't have stdlib.h. But this method fails on
> boot/powerpc/ieee1275/cmain.c that is compiled with powerpc-elf-gcc (build)
> and the -DGRUB_UTIL flag.

I don't understand. Why is stdlib.h related to types?

Okuji



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

* Re: Grub2 on Mac OS X
  2005-03-26  0:22     ` Yoshinori K. Okuji
@ 2005-03-26 12:09       ` Antoine Terrienne
  2005-03-26 13:52         ` Marco Gerards
  2005-03-26 13:40       ` Marco Gerards
  1 sibling, 1 reply; 16+ messages in thread
From: Antoine Terrienne @ 2005-03-26 12:09 UTC (permalink / raw)
  To: The development of GRUB 2

Selon "Yoshinori K. Okuji" <okuji@enbug.org>:

> But you must still check if a pointer returned by malloc is aligned
> correctly.
>

Ok i'll make some checks to make it cleaner

>
> Necessary. It is not a big burden anyway.
>

Ok so I guess we should change the getopt method used by grub-mkimage to argp
too.

> > I found another glibc specific function : alloca. Used in cmain in
> > boot/powerpc/ieee1275/cmain.c. I repace it by declaring argv as an array of
> > 64 elements : char *arg[64] (should be enouth ?). As the variables are
> > allocated in the stack just like alloca do it should work just the same.
>
> This kind of functions should be complemented by a library. Look at Gnulib:
>
> http://www.gnu.org/software/gnulib/
>
> I think Gnulib contains argp as well.
>

Ok I'll look at this too

>
> I don't understand. Why is stdlib.h related to types?
>

Oop sory I mean stdint.h
Types like int32_t, uint32_t and intprt_t are defined from stdint.h


I try to send a new patch several times but it is too big for the mailing list
size limit (100Kb) so I put it here :
http://antoine.terrienne.free.fr/grub2/grub2_on_macosx_20050326.patch

And the mail I sent with it :

Here is a new patch much cleaner (with -u).
Everything compiles now but I didn't test It yet. In fact I don't know how to
use and install grub2 on a drive. If you have and docs or info about installing
a binary to be open firmware bootable that could help me, thanks ;-)

The compilation is OK but this patch is still ugly : I left the getopt. I add a
flag -DGRUB_HOST to make a distinction between the host and build parts. The
GRUB_HOST flag is only used in some specific powerpc include directories so it
shouldn't affect the i386 part. I also add a grub_machine_fini in
kern/powerpc/ieee1275/init.c needed by kern/loader.c. Right now
grub_machine_fini is empty but it should call for someting like
grub_console_fini (not present in powerpc part) and grub_ofdisk_fini (not
implemented). I left malloc as an alternative to memalign. As far as I look in
the code memalign is used to align memory segment from elf files and every
usual cases in elf segments fits in the 16 byte alignment. So it should work
well for now waiting for a better implementation to support exotic segment
alignments.

Compilation and installation are OK. I get grub-emu grub-mkimage and every
modules in the share/grub/ directory and grub-mkimage can produce images. Still
need test and improvements but it seems to work.


--
--
  ____
 /    \  / antoine.terrienne@free.fr
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/



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

* Re: Grub2 on Mac OS X
  2005-03-23 21:09     ` Yoshinori K. Okuji
@ 2005-03-26 13:37       ` Marco Gerards
  0 siblings, 0 replies; 16+ messages in thread
From: Marco Gerards @ 2005-03-26 13:37 UTC (permalink / raw)
  To: The development of GRUB 2

"Yoshinori K. Okuji" <okuji@enbug.org> writes:

> On Wednesday 23 March 2005 09:42 pm, Brian Sammon wrote:
>> 2)  Perhaps you should switch from memalign to posix_memalign.  There's
>> better odds of convincing Apple to add posix_memalign to future releases of
>> Darwin than with memalign.  It appears that memalign is glibc-specific. 
>> Does {Free|Net|Open}BSD have memalign?  Is anyone building grub2 on any of
>> the BSDs?
>
> memalign is used only because the utilities do not use GRUB's own memory 
> management but operating system's. I think it would be better to change them 
> to use GRUB's.

I have some code for that which I used to test and debug module
loading.  It can be integrated into GRUB easily.

--
Marco






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

* Re: Grub2 on Mac OS X
  2005-03-26  0:22     ` Yoshinori K. Okuji
  2005-03-26 12:09       ` Antoine Terrienne
@ 2005-03-26 13:40       ` Marco Gerards
  1 sibling, 0 replies; 16+ messages in thread
From: Marco Gerards @ 2005-03-26 13:40 UTC (permalink / raw)
  To: The development of GRUB 2

"Yoshinori K. Okuji" <okuji@enbug.org> writes:

>> I found another glibc specific function : alloca. Used in cmain in
>> boot/powerpc/ieee1275/cmain.c. I repace it by declaring argv as an array of
>> 64 elements : char *arg[64] (should be enouth ?). As the variables are
>> allocated in the stack just like alloca do it should work just the same.
>
> This kind of functions should be complemented by a library. Look at Gnulib:
>
> http://www.gnu.org/software/gnulib/
>
> I think Gnulib contains argp as well.

It does and I would prefer using argp from gnulib.

Thanks,
Marco




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

* Re: Grub2 on Mac OS X
  2005-03-26 12:09       ` Antoine Terrienne
@ 2005-03-26 13:52         ` Marco Gerards
  2005-03-26 14:55           ` Antoine Terrienne
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Gerards @ 2005-03-26 13:52 UTC (permalink / raw)
  To: The development of GRUB 2

Antoine Terrienne <antoine.terrienne@free.fr> writes:

> Ok so I guess we should change the getopt method used by grub-mkimage to argp
> too.

IMHO it should be changed for every utility in that case.  If no one
knows argp, I could do that when I have some time and some other
issues are solved.  That would be in some months, but it will be done.

> Oop sory I mean stdint.h
> Types like int32_t, uint32_t and intprt_t are defined from stdint.h

If that is used, you could replace int32_t by grub_uint32_t, etc.

> I try to send a new patch several times but it is too big for the mailing list
> size limit (100Kb) so I put it here :
> http://antoine.terrienne.free.fr/grub2/grub2_on_macosx_20050326.patch

Not including generated files will make the patch a lot smaller.  I
personally don't have problems with big patches on the mailinglist.
Having the patch in the email will make it a lot easier for me to
review the patch.

> And the mail I sent with it :
>
> Here is a new patch much cleaner (with -u).

Please use -p as well.  It will make reviewing the patch a *LOT*
easier.

> Everything compiles now but I didn't test It yet. In fact I don't know how to
> use and install grub2 on a drive. If you have and docs or info about installing
> a binary to be open firmware bootable that could help me, thanks ;-)

First you have to compile GRUB 2.  After that you can use grub-mkimage
to create an ELF file that is loadable by open firmware.  Using
grub-mkimage you should specify the name of the output executable and
which modules should be included.  For testing you should at least include
apple.mod, ext2.mod, hfs.mod, ls.mod and normal.mod I think.

After that I just load it using "boot" or tftp.

> The compilation is OK but this patch is still ugly : I left the getopt. I add a
> flag -DGRUB_HOST to make a distinction between the host and build parts. The
> GRUB_HOST flag is only used in some specific powerpc include directories so it
> shouldn't affect the i386 part. I also add a grub_machine_fini in
> kern/powerpc/ieee1275/init.c needed by kern/loader.c. Right now
> grub_machine_fini is empty but it should call for someting like
> grub_console_fini (not present in powerpc part) and grub_ofdisk_fini (not
> implemented). I left malloc as an alternative to memalign. As far as I look in
> the code memalign is used to align memory segment from elf files and every
> usual cases in elf segments fits in the 16 byte alignment. So it should work
> well for now waiting for a better implementation to support exotic segment
> alignments.

I thought GRUBOF was not used anymore, but I see you replaced it.  I
hope I can find some time to have a look at your patch soon, but
please understand if it will take a while.

> Compilation and installation are OK. I get grub-emu grub-mkimage and every
> modules in the share/grub/ directory and grub-mkimage can produce images. Still
> need test and improvements but it seems to work.

Cool!  please check if your modification did not add any warnings or
so, we would like to keep GRUB quite clean.

A complete review has to follow... sorry...

Thanks,
Marco




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

* Re: Grub2 on Mac OS X
  2005-03-26 13:52         ` Marco Gerards
@ 2005-03-26 14:55           ` Antoine Terrienne
  2005-03-26 15:20             ` Marco Gerards
  0 siblings, 1 reply; 16+ messages in thread
From: Antoine Terrienne @ 2005-03-26 14:55 UTC (permalink / raw)
  To: The development of GRUB 2

Selon Marco Gerards <metgerards@student.han.nl>:

>
> If that is used, you could replace int32_t by grub_uint32_t, etc.
>

ok I was wondering if here were a specific reason for using both grub_int32_t
and int32_t types like one for the host part and one for the build part. But if
we can always use grub_xxx types it will make it a lot easier.

>
> Not including generated files will make the patch a lot smaller.  I
> personally don't have problems with big patches on the mailinglist.
> Having the patch in the email will make it a lot easier for me to
> review the patch.
>
> Please use -p as well.  It will make reviewing the patch a *LOT*
> easier.
>

Ok I will do this

> First you have to compile GRUB 2.  After that you can use grub-mkimage
> to create an ELF file that is loadable by open firmware.  Using
> grub-mkimage you should specify the name of the output executable and
> which modules should be included.  For testing you should at least include
> apple.mod, ext2.mod, hfs.mod, ls.mod and normal.mod I think.
>
> After that I just load it using "boot" or tftp.
>

Thank's I will try

>
> I thought GRUBOF was not used anymore, but I see you replaced it.  I
> hope I can find some time to have a look at your patch soon, but
> please understand if it will take a while.
>

Yes GRUBOF have been removed from everywere exept in one .h file in the powerpc
part. Must have been forgotten. In fact many little problems like this one
seems to come from some great improvements made to Grub2-i386 that have not
been ported to the powerpc part.

>
> Cool!  please check if your modification did not add any warnings or
> so, we would like to keep GRUB quite clean.
>

most warnings come from the memcpy function that conflicts with the gcc builtin.

> A complete review has to follow... sorry...
>

No problem there's no rush.
By the way I will probably put a more complete patch in a few days with all your
remarks.

Thank's

--
--
  ____
 /    \  / antoine.terrienne@free.fr
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/



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

* Re: Grub2 on Mac OS X
  2005-03-26 14:55           ` Antoine Terrienne
@ 2005-03-26 15:20             ` Marco Gerards
  2005-03-26 19:49               ` Antoine Terrienne
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Gerards @ 2005-03-26 15:20 UTC (permalink / raw)
  To: The development of GRUB 2

Antoine Terrienne <antoine.terrienne@free.fr> writes:

Hi Antoine,

>> If that is used, you could replace int32_t by grub_uint32_t, etc.
> ok I was wondering if here were a specific reason for using both grub_int32_t
> and int32_t types like one for the host part and one for the build part. But if
> we can always use grub_xxx types it will make it a lot easier.

The reason was that this code was part of another project.  It has
been put into GRUB 2 and I think I missed these int32_t thingies.

>> I thought GRUBOF was not used anymore, but I see you replaced it.  I
>> hope I can find some time to have a look at your patch soon, but
>> please understand if it will take a while.
>>
>
> Yes GRUBOF have been removed from everywere exept in one .h file in the powerpc
> part. Must have been forgotten. In fact many little problems like this one
> seems to come from some great improvements made to Grub2-i386 that have not
> been ported to the powerpc part.

What kind of things do you think there are missing for the PPC port?
It should be quite complete by now.  It does not compile at the
moment, but this will be fixed in CVS really soon.

>>
>> Cool!  please check if your modification did not add any warnings or
>> so, we would like to keep GRUB quite clean.
>>
>
> most warnings come from the memcpy function that conflicts with the gcc builtin.

Can you show us?

>> A complete review has to follow... sorry...
>>
>
> No problem there's no rush.
> By the way I will probably put a more complete patch in a few days with all your
> remarks.

Cool.

Thanks,
Marco




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

* Re: Grub2 on Mac OS X
  2005-03-26 15:20             ` Marco Gerards
@ 2005-03-26 19:49               ` Antoine Terrienne
  2005-03-26 20:09                 ` Marco Gerards
  0 siblings, 1 reply; 16+ messages in thread
From: Antoine Terrienne @ 2005-03-26 19:49 UTC (permalink / raw)
  To: The development of GRUB 2

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

Selon Marco Gerards <metgerards@student.han.nl>:

>
> What kind of things do you think there are missing for the PPC port?
> It should be quite complete by now.  It does not compile at the
> moment, but this will be fixed in CVS really soon.
>

for exemple the gub_loader_boot function in kern/loader.c uses
grub_machine_fini. This function is defined in kern/i386/pc/init.c but not in
kern/powerpc/ieee1275/init.c. Same problem with include/grub/i386/pc/init.h and
include/powerpc/ieee1275/init.h. As powerpc par uses somme i386 parts there are
somme missing declarations in powerpc. It just looks like the powerpc part is
not up to date with the i386 one.
Well I fix must of these litte problems in the patch in a way to comile but I'm
not sure it is fully fonctionnal.

> >
> > most warnings come from the memcpy function that conflicts with the gcc
> builtin.
>
> Can you show us?
>

Yes of course, I join a file with all the warnings I get at compilation.


--
--
  ____
 /    \  / antoine.terrienne@free.fr
|  o o | - http://antoine.terrienne.free.fr
|   o  | \ #153026466
\  V V /
 \_/\_/

[-- Attachment #2: errors.log --]
[-- Type: application/octet-stream, Size: 7648 bytes --]

In file included from ../grub2/commands/boot.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/cat.c:27:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/cmp.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/configfile.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/default.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/help.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/terminal.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/ls.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/commands/timeout.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
../grub2/commands/i386/pc/reboot.c: In function `grub_cmd_reboot':
../grub2/commands/i386/pc/reboot.c:32: warning: implicit declaration of function `grub_reboot'
In file included from ../grub2/disk/loopback.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/ext2.c:45:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/fat.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/fshelp.c:23:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/hfs.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/iso9660.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/jfs.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/minix.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/fs/ufs.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/device.c:26:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/disk.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/dl.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/env.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/err.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/file.c:21:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/fs.c:26:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/loader.c:21:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/main.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/misc.c:21:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
../grub2/kern/misc.c:49: warning: alias definitions not supported in this configuration; ignored
../grub2/kern/misc.c:52: warning: alias definitions not supported in this configuration; ignored
../grub2/kern/misc.c:159: warning: conflicting types for built-in function `memcmp'
../grub2/kern/misc.c:159: warning: alias definitions not supported in this configuration; ignored
../grub2/kern/misc.c:387: warning: conflicting types for built-in function `memset'
../grub2/kern/misc.c:387: warning: alias definitions not supported in this configuration; ignored
In file included from ../grub2/kern/rescue.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/kern/term.c:23:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/arg.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/cmdline.c:21:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/command.c:21:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/main.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/menu.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/normal/menu_entry.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/partmap/amiga.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/partmap/apple.c:22:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/partmap/pc.c:25:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
In file included from ../grub2/partmap/sun.c:24:
../grub2/include/grub/misc.h:41: warning: conflicting types for built-in function `memcpy'
../grub2/util/grub-emu.c: In function `grub_machine_fini':
../grub2/util/grub-emu.c:89: warning: implicit declaration of function `grub_console_fini'
../grub2/util/misc.c: In function `grub_memalign':
../grub2/util/misc.c:232: warning: unused parameter `align'
../grub2/util/i386/pc/biosdisk.c:198:3: warning: #warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal."
../grub2/util/i386/pc/biosdisk.c:675:3: warning: #warning "The function `get_os_disk' might not work on your OS correctly."
../grub2/util/i386/pc/biosdisk.c: In function `get_os_disk':
../grub2/util/i386/pc/biosdisk.c:606: warning: unused variable `path'
../grub2/util/i386/pc/biosdisk.c:606: warning: unused variable `p'
../grub2/util/i386/pc/biosdisk.c:855:3: warning: #warning "The function `grub_util_biosdisk_get_grub_dev' might not work on your OS correctly."
../grub2/util/misc.c: In function `grub_memalign':
../grub2/util/misc.c:232: warning: unused parameter `align'
../grub2/fs/ufs.c: In function `grub_ufs_find_file':
../grub2/fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
../grub2/fs/ufs.c:474: warning: shadowed declaration is here
../grub2/fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
../grub2/fs/ufs.c:474: warning: shadowed declaration is here

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

* Re: Grub2 on Mac OS X
  2005-03-26 19:49               ` Antoine Terrienne
@ 2005-03-26 20:09                 ` Marco Gerards
  0 siblings, 0 replies; 16+ messages in thread
From: Marco Gerards @ 2005-03-26 20:09 UTC (permalink / raw)
  To: The development of GRUB 2

Antoine Terrienne <antoine.terrienne@free.fr> writes:

> Selon Marco Gerards <metgerards@student.han.nl>:
>
>>
>> What kind of things do you think there are missing for the PPC port?
>> It should be quite complete by now.  It does not compile at the
>> moment, but this will be fixed in CVS really soon.
>>
>
> for exemple the gub_loader_boot function in kern/loader.c uses
> grub_machine_fini. This function is defined in kern/i386/pc/init.c but not in
> kern/powerpc/ieee1275/init.c. Same problem with include/grub/i386/pc/init.h and
> include/powerpc/ieee1275/init.h. As powerpc par uses somme i386 parts there are
> somme missing declarations in powerpc. It just looks like the powerpc part is
> not up to date with the i386 one.
> Well I fix must of these litte problems in the patch in a way to comile but I'm
> not sure it is fully fonctionnal.

It is fixed in CVS now, thanks to Hollis.  I thought you meant
functionality instead of brokenness.

Thanks,
Marco




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

end of thread, other threads:[~2005-03-26 20:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-23 13:20 Grub2 on Mac OS X antoine terrienne
2005-03-23 20:45 ` Yoshinori K. Okuji
2005-03-23 22:28   ` Antoine Terrienne
2005-03-26  0:22     ` Yoshinori K. Okuji
2005-03-26 12:09       ` Antoine Terrienne
2005-03-26 13:52         ` Marco Gerards
2005-03-26 14:55           ` Antoine Terrienne
2005-03-26 15:20             ` Marco Gerards
2005-03-26 19:49               ` Antoine Terrienne
2005-03-26 20:09                 ` Marco Gerards
2005-03-26 13:40       ` Marco Gerards
  -- strict thread matches above, loose matches on Subject: below --
2005-03-21 18:55 Antoine Terrienne
2005-03-22 20:20 ` Yoshinori K. Okuji
2005-03-23 20:42   ` Brian Sammon
2005-03-23 21:09     ` Yoshinori K. Okuji
2005-03-26 13:37       ` Marco Gerards

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.