grub-mkrelpath
Here's a patch which implements grub-mkrelpath based on my make_system_path_relative_to_its_root patch to fix the problem with grub-setup and blocklists, if the path to core.img given to grub-setup isn't already relative to the root.
I wasn't sure if I should place the function now in util/grub-mkrelpath.c or some other file. That depends if we're going to use it now in grub-setup or not.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer
2009-08-28 Felix Zielcke <[email protected]>
* conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath. (grub_mkrelpath_SOURCES): New variable.
* configure.ac (AC_CHECK_FUNCS): Add realpath.
* util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root):
Use grub-mkrelpath.
* util/grub-mkrelpath.c: New file.
conf/common.rmk +4 -0
@@ -55,6 +55,10 @@ grub_mkfont_CFLAGS = $(freetype_cflags) grub_mkfont_LDFLAGS = $(freetype_libs) endif +# For grub-mkrelpath. +bin_UTILITIES += grub-mkrelpath +grub_mkrelpath_SOURCES = util/grub-mkrelpath.c util/misc.c + # For the parser. grub_script.tab.c grub_script.tab.h: script/sh/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y
configure.ac +1 -1
@@ -172,7 +172,7 @@ if test x$grub_cv_apple_cc = xyes ; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign asprintf) +AC_CHECK_FUNCS(posix_memalign memalign asprintf realpath) # # Check for target programs.
util/grub-mkconfig_lib.in +1 -43
50 lines not on this page · raw message
util/grub-mkrelpath.c +194 -0
194 lines not on this page · raw message
Review
Quoted 2 lines · Felix Zielcke
(quoted diff) +2
-0+ if (stat (buf, &st) < 0) + grub_util_error ("can not stat %s", buf);
We should give a reason. E.g:
grub_util_error ("can not stat %s: %s", p, strerror (errno));
Also, I believe some of the comments in the old shell function (e.g. the one about trailing slash) would still make sense in the new one.
If you can fix these two things, it looks ok for commit. Thanks.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Am Freitag, den 28.08.2009, 18:28 +0200 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Review
Quoted 2 lines
(quoted diff) +2
-0+ if (stat (buf, &st) < 0) + grub_util_error ("can not stat %s", buf);We should give a reason. E.g:
grub_util_error("can not stat %s: %s", p, strerror (errno));
Ok done.
Quoted 3 lines
Also, I believe some of the comments in the old shell function (e.g. the one about trailing slash) would still make sense in the new one.
I added now a few comments.
Good catch with the trailing slashes. If realpath isn't used, it did output ones. Fixed now.
Quoted 1 line
If you can fix these two things, it looks ok for commit. Thanks.
You're welcome.
I also fixed now the handling of relative paths, that was broken. Oh and I changed some `x = xmalloc () ; strcpy (x,y)' to strdup. I think that's easier to read.
Would be nice if you could have another quick lock, especially if the comments are now okay.
Nice that you didn't had a problem with my 4 char pointers. I don't like that much but I haven't a better idea for them.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer
2009-08-28 Felix Zielcke <[email protected]>
* conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath. (grub_mkrelpath_SOURCES): New variable.
* configure.ac (AC_CHECK_FUNCS): Add realpath.
* util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root):
Use grub-mkrelpath.
* util/grub-mkrelpath.c: New file.
conf/common.rmk +4 -0
@@ -55,6 +55,10 @@ grub_mkfont_CFLAGS = $(freetype_cflags) grub_mkfont_LDFLAGS = $(freetype_libs) endif +# For grub-mkrelpath. +bin_UTILITIES += grub-mkrelpath +grub_mkrelpath_SOURCES = util/grub-mkrelpath.c util/misc.c + # For the parser. grub_script.tab.c grub_script.tab.h: script/sh/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y
configure.ac +1 -1
@@ -172,7 +172,7 @@ if test x$grub_cv_apple_cc = xyes ; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign asprintf) +AC_CHECK_FUNCS(posix_memalign memalign asprintf realpath) # # Check for target programs.
util/grub-mkconfig_lib.in +1 -43
50 lines not on this page · raw message
util/grub-mkrelpath.c +214 -0
214 lines not on this page · raw message
Quoted 17 lines · Felix Zielcke
util/grub-mkrelpath.c +17
-0+#else /* ! HAVE_REALPATH */ +grub_util_warn ("grub-mkrelpath might not work on your OS correctly." ); +/* make relative path absolute. */ +if (*path !='/' ) + { + len =1024 ; + buf2 =xmalloc (len); + do + { + buf2 = getcwd (buf2, len); + if (buf2 == NULL) + { + if (errno != ERANGE) + grub_util_error ("can not get current working directory"); + else + len *= 2; + buf2 = xrealloc (buf2, len);
util/grub-mkrelpath.c line 89
Quoted 10 lines
util/grub-mkrelpath.c +10
-0+ } + }while (buf2 ==NULL ); + buf =xmalloc (strlen (path) +strlen (buf2) +1 ); +strcpy (buf, buf2); +strcat (buf,"/" ); +strcat (buf, path); + } +else + buf =strdup (path); +#endif /* ! HAVE_REALPATH */
Please can you leave this part out? realpath() is POSIX, so it should be present in all systems we support, and if it isn't, we should be using a complete implementation from Gnulib instead, but we don't need to worry about this untill/unless someone reports it as a problem.
util/grub-mkrelpath.c line 103
Quoted 3 lines
util/grub-mkrelpath.c +3
-0+ p =strrchr (buf,'/' ); +if (p ==NULL ) +grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)" );
Does this ever happen?
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 34 lines · Robert Millan
Quoted 17 lines · Felix Zielcke
util/grub-mkrelpath.c +17
-0+#else /* ! HAVE_REALPATH */ + grub_util_warn ("grub-mkrelpath might not work on your OS correctly."); + /* make relative path absolute. */ + if (*path != '/') + { + len = 1024; + buf2 = xmalloc (len); + do + { + buf2 = getcwd (buf2, len); + if (buf2 == NULL) + { + if (errno != ERANGE) + grub_util_error ("can not get current working directory"); + else + len *= 2; + buf2 = xrealloc (buf2, len);util/grub-mkrelpath.c line 89
Quoted 10 lines
util/grub-mkrelpath.c +10
-0+ } + } while (buf2 == NULL); + buf = xmalloc (strlen (path) + strlen (buf2) + 1); + strcpy (buf, buf2); + strcat (buf, "/"); + strcat (buf, path); + } + else + buf = strdup (path); +#endif /* ! HAVE_REALPATH */ Please can you leave this part out? realpath() is POSIX, so it should be present in all systems we support, and if it isn't, we should be using a complete implementation from Gnulib instead, but we don't need to worry about this untill/unless someone reports it as a problem.
Quoted 5 lines
Quoted 3 lines
+ p = strrchr (buf, '/');
+ if (p == NULL)
+grub_util_error("FIXME: no / in buf. (make_system_path_relative_to_its_root)");Does this ever happen?
Difficult to say but this check makes grub give a useful error message instead of silent crash. IMO former is preferable for long-term maintainance.
I'll test the patch on FreeBSD as soon as I get it back online.
Quoted 14 lines
--
Robert MillanThe DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Am Samstag, den 29.08.2009, 01:55 +0200 schrieb Robert Millan:
Quoted 25 lines · Felix Zielcke
Quoted 24 lines
util/grub-mkrelpath.c +24
-0+#else /* ! HAVE_REALPATH */ +grub_util_warn ("grub-mkrelpath might not work on your OS correctly." ); +/* make relative path absolute. */ +if (*path !='/' ) + { + len =1024 ; + buf2 =xmalloc (len); +do + { + buf2 =getcwd (buf2, len); +if (buf2 ==NULL ) + { +if (errno !=ERANGE ) +grub_util_error ("can not get current working directory" ); +else + len *=2 ; + buf2 =xrealloc (buf2, len); + } + }while (buf2 ==NULL ); + buf =xmalloc (strlen (path) +strlen (buf2) +1 ); +strcpy (buf, buf2); +strcat (buf,"/" ); +strcat (buf, path); + }
Quoted 8 lines
util/grub-mkrelpath.c line 89
Quoted 3 lines
util/grub-mkrelpath.c +3
-0+ else + buf =strdup (path); +#endif /* ! HAVE_REALPATH */ Please can you leave this part out?
realpath()is POSIX, so it should be present in all systems we support, and if it isn't, we should be using a complete implementation from Gnulib instead, but we don't need to worry about this untill/unless someone reports it as a problem.
Ok, but should I then check in configure.ac that realpath is required or something else?
Or should I just assume that realpath is always avaible?
Quoted 5 lines
util/grub-mkrelpath.c line 103
Quoted 3 lines
util/grub-mkrelpath.c +3
-0+ p =strrchr (buf,'/' ); +if (p ==NULL ) +grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)" );Does this ever happen?
As Vladimir said, it shouldn't ever happen, but I thought it would be better to check for this explicitly instead of core dumping in that case.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer
Am Samstag, den 29.08.2009, 09:51 +0200 schrieb Felix Zielcke:
Quoted 35 lines
Am Samstag, den 29.08.2009, 01:55 +0200 schrieb Robert Millan:
Quoted 25 lines · Felix Zielcke
Quoted 24 lines
util/grub-mkrelpath.c +24
-0+#else /* ! HAVE_REALPATH */ +grub_util_warn ("grub-mkrelpath might not work on your OS correctly." ); +/* make relative path absolute. */ +if (*path !='/' ) + { + len =1024 ; + buf2 =xmalloc (len); +do + { + buf2 =getcwd (buf2, len); +if (buf2 ==NULL ) + { +if (errno !=ERANGE ) +grub_util_error ("can not get current working directory" ); +else + len *=2 ; + buf2 =xrealloc (buf2, len); + } + }while (buf2 ==NULL ); + buf =xmalloc (strlen (path) +strlen (buf2) +1 ); +strcpy (buf, buf2); +strcat (buf,"/" ); +strcat (buf, path); + }Quoted 8 lines
util/grub-mkrelpath.c line 89
Quoted 3 lines
util/grub-mkrelpath.c +3
-0+ else + buf =strdup (path); +#endif /* ! HAVE_REALPATH */ Please can you leave this part out?
realpath()is POSIX, so it should be present in all systems we support, and if it isn't, we should be using a complete implementation from Gnulib instead, but we don't need to worry about this untill/unless someone reports it as a problem.
Quoted 3 lines
Ok, but should I then check in configure.ac that realpath is required or something else?
Or should I just assume that realpath is always avaible?
For now I assume that realpath is avaible.
Quoted 9 lines
Quoted 5 lines
util/grub-mkrelpath.c line 103
Quoted 3 lines
util/grub-mkrelpath.c +3
-0+ p =strrchr (buf,'/' ); +if (p ==NULL ) +grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)" );Does this ever happen?
As Vladimir said, it shouldn't ever happen, but I thought it would be better to check for this explicitly instead of core dumping in that case.
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Quoted 5 lines · Felix Zielcke
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
Vladimir, could you review and consider for inclusion in experimental? Or if you're busy, let me know and I'll do it.
Btw, with this the "#if 0" in util/grub-probe.c can be removed. Felix, if you like you can adjust that in the same patchset, or otherwise we can just do it later.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
Quoted 6 lines
Vladimir, could you review and consider for inclusion in experimental? Or if you're busy, let me know and I'll do it.
Btw, with this the "#if 0" in
util/grub-probe.ccan be removed. Felix, if you like you can adjust that in the same patchset, or otherwise we can just do it later.
I wasn't sure if I should do it at the same time or not.
The just grub-mkrelpath way has the advantage that if something in the function is still broken (which I don't think) then just grub-mkrelpath is broken not also grub-probe.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Quoted 11 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 10 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
Vladimir, could you review and consider for inclusion in experimental? Or if you're busy, let me know and I'll do it.
Quoted 8 lines
Quoted 3 lines
Btw, with this the "#if 0" in
util/grub-probe.ccan be removed. Felix, if you like you can adjust that in the same patchset, or otherwise we can just do it later.I wasn't sure if I should do it at the same time or not.
The just grub-mkrelpath way has the advantage that if something in the function is still broken (which I don't think) then just grub-mkrelpath is broken not also grub-probe.
Don't worry, if something is broken it's better to know early about it. We have experimental branch for safety.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Am Montag, den 02.11.2009, 14:45 +0100 schrieb Robert Millan:
Quoted 10 lines
Quoted 2 lines
I wasn't sure if I should do it at the same time or not. The just grub-mkrelpath way has the advantage that if something in
the
Quoted 1 line
function is still broken (which I don't think) then just
grub-mkrelpath
Quoted 1 line
is broken not also grub-probe.
Don't worry, if something is broken it's better to know early about it. We
have experimental branch for safety.
I just pushed the grub-probe change.
Works also for me.
and I also changed the `reading %s via GRUB facilities' info message to use the grub_path instead of the OS path.
IMO it's more useful then showing twice the same path.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Hello Felix,
Quoted 8 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
[snip]
I am trying to build your mkrelpath branch on my ppc with debian gcc-4.4 latest unstable release 4.4.2-1 and failed to build as far as I understand because isystem syntax is not correct; following diff help me to complete the build:
Makefile.in 2009-11-03 09:22:12.000000000 +0000 renamed from Makefile.in.orig 2009-11-03 09:21:53.000000000 +0000 +1 -3
@@ -75,7 +75,7 @@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem=$(srcdir)/include -I$(builddir) -I$(builddir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem $(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W
TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
=== <> ===
(i.e. I have to rm '=' between isystem and its arg)
I don't know if it's specific to ppc arch, sorry.
Tx,
J.
Am Dienstag, den 03.11.2009, 11:21 +0100 schrieb rubisher:
Quoted 12 lines
Hello Felix,
Quoted 8 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
Quoted 6 lines
[snip]
I am trying to build your mkrelpath branch on my ppc with debian gcc-4.4 latest unstable release 4.4.2-1 and failed to build as far as I understand because isystem syntax is not correct; following diff help me to complete the build:
Which is the same as in trunk.
Quoted 5 lines
=== <> ===
(i.e. I have to rm '=' between isystem and its arg)I don't know if it's specific to ppc arch, sorry.
Seems so, because on amd64 it works fine.
The docs say:
-isystem dir
Search dir for header files, after all directories specified by -I but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot.
So it should be valid.
Maybe with a space between -isystem and = it works for you too. But now that I read that I'm not so sure we actually should use =
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Quoted 16 lines · Felix Zielcke
Am Dienstag, den 03.11.2009, 11:21 +0100 schrieb rubisher:
Quoted 15 lines
Hello Felix,
Quoted 8 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
[snip]
I am trying to build your mkrelpath branch on my ppc with debian
gcc-4.4
Quoted 3 lines
Quoted 3 lines
latest unstable release 4.4.2-1 and failed to build as far as I understand
because isystem syntax is not correct; following diff help me to
complete
Quoted 3 lines
Quoted 1 line
the build:
Which is the same as in trunk.
right no issue to compile trunk 2676 but as following way (svn 2676):
[snip]
gcc-4.4 -Icommands -I/SrcTree/grub2-svn2676/commands -isystem=/SrcTree/grub2-svn2676/include -I/SrcTree/grub2-svn2676/include -I. -I./include -Wall -W -O0 -m32 -fno-stack-protector -Werror -ffreestanding -MD -c -o halt_mod-commands_halt.o /SrcTree/grub2-svn2676/commands/halt.c
[snip]
Quoted 18 lines
Quoted 6 lines
=== <> ===
(i.e. I have to rm '=' between isystem and its arg)I don't know if it's specific to ppc arch, sorry.
Seems so, because on amd64 it works fine.
The docs say:-isystem dir
Search dir for header files, after all directories specified by -I but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot.
Quoted 2 lines
So it should be valid.
Maybe with a space between -isystem and = it works for you too.
Unfortunately not but to give more details, here is how it failed (mkrelpath tree 1802)
[snip]
gcc-4.4 -Icommands -I/SrcTree/grub2-fzibzr1802/commands -isystem=/SrcTree/grub2-fzibzr1802/include -I.
-I./include -Wall -W -O0 -m32 -fno-stack-protector -Werror -ffreestanding
-MD -c -o halt_mod-commands_halt.o /SrcTree/grub2-fzibzr1802/commands/halt.c /Sources/jso/Grub2.deb/grub2-fzibzr1802/commands/halt.c:20:21: error:grub/dl.h: No such file or directory /Sources/jso/Grub2.deb/grub2-fzibzr1802/commands/halt.c:22:26: error:grub/command.h: No such file or directory
In file included from /Sources/jso/Grub2.deb/grub2-fzibzr1802/commands/halt.c:25:./include/grub/machine/kernel.h:22:25: error: grub/symbol.h: No such file or directory
In file included from /Sources/jso/Grub2.deb/grub2-fzibzr1802/commands/halt.c:25:./include/grub/machine/kernel.h:26: error: 'EXPORT_FUNC' declared as function returning a function
cc1: warnings being treated as errors
[snip]
so here no more "-I/SrcTree/grub2-svn2676/include" as in svn trunk, though.
Quoted 1 line
But now that I read that I'm not so sure we actually should use =
I will check first how it boot, then check a bit further.
Tx,
J.
Am Dienstag, den 03.11.2009, 14:51 +0100 schrieb rubisher:
Quoted 19 lines
Quoted 16 lines · Felix Zielcke
Am Dienstag, den 03.11.2009, 11:21 +0100 schrieb rubisher:
Quoted 15 lines
Hello Felix,
Quoted 8 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
[snip]
I am trying to build your mkrelpath branch on my ppc with debian
gcc-4.4
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
latest unstable release 4.4.2-1 and failed to build as far as I understand
because isystem syntax is not correct; following diff help me tocomplete
Quoted 3 lines
Quoted 1 line
the build:
Which is the same as in trunk.
right no issue to compile trunk 2676 but as following way (svn 2676):
Right trunk contains my -I($srcdir)/include fix.
merged now.
But I still have the feeling using -isystem is wrong at all or at least the =.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Felix,
Quoted 23 lines · Felix Zielcke
Am Dienstag, den 03.11.2009, 14:51 +0100 schrieb rubisher:
Quoted 22 lines
Quoted 16 lines · Felix Zielcke
Am Dienstag, den 03.11.2009, 11:21 +0100 schrieb rubisher:
Quoted 15 lines
Hello Felix,
Quoted 8 lines · Felix Zielcke
Am Sonntag, den 01.11.2009, 23:04 +0100 schrieb Robert Millan:
Quoted 7 lines · Felix Zielcke
Quoted 5 lines
I added now a comment that this shouldn't ever happen.
New version avaible at bzr+ssh://bzr.savannah.gnu.org/grub/people/fzielcke/mkrelpath
[snip]
I am trying to build your mkrelpath branch on my ppc with debian
gcc-4.4
Quoted 3 lines
Quoted 3 lines
latest unstable release 4.4.2-1 and failed to build as far as I understand
because isystem syntax is not correct; following diff help me to
Quoted 8 lines
Quoted 5 lines
complete
Quoted 3 lines
Quoted 1 line
the build:
Which is the same as in trunk.
right no issue to compile trunk 2676 but as following way (svn 2676):
Right trunk contains my -I($srcdir)/include fix.
merged now.
Sorry I don't agree with your fix:
here is what I grab from gcc-4.4 manual online:
-isysroot dir
This option is like the --sysroot option, but applies only to header files. See the --sysroot option for more information.
--sysroot=dir
Use dir as the logical root directory for headers and libraries. For example, if the compiler would normally search for headers in /usr/include and
libraries in /usr/lib, it will instead search dir/usr/include and dir/usr/lib.
If you use both this option and the ?-isysroot? option, then the --sysroot option will apply to libraries, but the ?-isysroot? option will apply to header files.
The GNU linker (beginning with version 2.16) has the necessary support for this option. If your linker does not support this option, the header file aspect of --sysroot will still work, but the library aspect will not.
as far as I understand, this spec doesn't says that 'dir' has some default value so may be the precompiler issue here is that without --sysroot or --isysroot cpp collect garbage as 'dir' and failed to work (sorry I don't remember how to trace in detail gcc to proof my hypothesis) but following patch actually works to me on your branches 1802 and latest 1803:
Makefile.in 2009-11-04 07:57:44.000000000 +0000 renamed from Makefile.in.orig 2009-11-04 07:20:46.000000000 +0000 +1 -3
@@ -75,7 +75,7 @@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem=$(srcdir)/include -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isysroot$(srcdir) -isystem=/include -I$(builddir) -I$(builddir)/include \ -Wall -W
TARGET_LDFLAGS = @TARGET_LDFLAGS@
TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
=== <> ===
Quoted 2 lines
But I still have the feeling using -isystem is wrong at all or at least the =.
Well as far as I understand, yes for cross-compiling that would make stuff easier?
A quick look at linux kernel build, it shows that also use -isystem but not yet with '=' option so may be my previous patch would be more relevant.
I let you appreciate.
Tx,
J.
PS: any idea where (in which part of this proj) should I have a look to learn why ofs doesn't reach to find disks and their structures?)
Am Mittwoch, den 04.11.2009, 10:55 +0100 schrieb rubisher:
Quoted 3 lines
Quoted 2 lines
Right trunk contains my -I($srcdir)/include fix.
merged now.Sorry I don't agree with your fix:
As you might have thought already from the following sentence, I already suspected that it's not the proper way.
By the way this topic really belongs to the -nostdinc Thread from Robert.
This is not at all specific to my grub-mkrelpath.
At least this fixed building with a seperate build directory.
Quoted 11 lines
Quoted 4 lines
But I still have the feeling using -isystem is wrong at all or at least the =.
Well as far as I understand, yes for cross-compiling that would make stuff easier?
A quick look at linux kernel build, it shows that also use -isystem but not yet with '=' option so may be my previous patch would be more relevant.
I let you appreciate.
IMO we should use the same approach as Linux kernel does. Using -isystem just for the gcc include headers.
I don't think gcc should treat our own headers as system headers.
Quoted 6 lines
Tx,
J.PS: any idea where (in which part of this proj) should I have a look to learn why ofs doesn't reach to find disks and their structures?)
No clue.
Better ask such questions in a seperate mail, not hidden in a thread which has nothing to do with this. The chances are much higer that then who can answer the qestion will read it.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Quoted 9 lines · Felix Zielcke
Am Mittwoch, den 04.11.2009, 10:55 +0100 schrieb rubisher:
Quoted 3 lines
Quoted 2 lines
Right trunk contains my -I($srcdir)/include fix.
merged now.Sorry I don't agree with your fix:
As you might have thought already from the following sentence, I already suspected that it's not the proper way.
Yes ;<)
Quoted 5 lines
By the way this topic really belongs to the -nostdinc Thread from Robert.
This is not at all specific to my grub-mkrelpath.
At least this fixed building with a seperate build directory.
Ok.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
But I still have the feeling using -isystem is wrong at all or at
least
Quoted 9 lines
Quoted 9 lines
Quoted 1 line
the =.
Well as far as I understand, yes for cross-compiling that would make stuff
easier?A quick look at linux kernel build, it shows that also use -isystem but not yet with '=' option so may be my previous patch would be more relevant.
Quoted 6 lines
Quoted 1 line
I let you appreciate.
IMO we should use the same approach as Linux kernel does. Using -isystem just for the gcc include headers.
I don't think gcc should treat our own headers as system headers.
I would love to make many test to better understand all aspect of those options, ...
may be latter ;<)
Quoted 11 lines
Quoted 6 lines
Tx,
J.PS: any idea where (in which part of this proj) should I have a look to learn why ofs doesn't reach to find disks and their structures?)
No clue.
Better ask such questions in a seperate mail, not hidden in a thread which has nothing to do with this. The chances are much higer that then who can answer the qestion will read it.
I will try to do so, tx.
btw I just find a small typo in your branch:
--- ./util/grub-mkconfig_lib.in.orig 2009-11-04 10:34:27.000000000
+0000
+++ ./util/grub-mkconfig_lib.in 2009-11-04 10:42:01.000000000 +0000 @@ -32,7 +32,7 @@
make_system_path_relative_to_its_root ()
{
- path = "grub-mkrelpath $1"
+ path="grub-mkrelpath $1"
case "uname 2>/dev/null" in
CYGWIN*)
=== <> ===
Tx again,
J.
Am Mittwoch, den 04.11.2009, 15:59 +0100 schrieb rubisher:
Quoted 1 line
btw I just find a small typo in your branch:
Thanks fixed. I should have taken another look at that part when I imported in bzr.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Am Sonntag, den 01.11.2009, 16:39 +0100 schrieb Felix Zielcke:
Quoted 2 lines
New version avaible at sftp://bzr.savannah.gnu.org/srv/bzr/grub/people/fzielcke/mkrelpath
Ah Vladimir you aren't anymore on IRC.
So that I don't forget to ask you, I pushed this now:
2009-11-11 Felix Zielcke <[email protected]>
* util/grub-probe.c (probe): Abort with an error if file can't be opened via GRUB facilities.
2009-11-11 Felix Zielcke <[email protected]>
* util/i386/pc/grub-setup.c (setup): Make core.img path relative to its root.
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer