* Patch to compile grub2 with Apple compiler @ 2014-04-07 11:21 Yves Blusseau 2014-04-07 15:04 ` SevenBits 2014-04-07 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 2 replies; 20+ messages in thread From: Yves Blusseau @ 2014-04-07 11:21 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1.1: Type: text/plain, Size: 72 bytes --] Hi, this is a patch to allow compilation of grub2 with Apple Compiler [-- Attachment #1.2: apple__bzero-declaration.patch --] [-- Type: application/octet-stream, Size: 1218 bytes --] From 7b8124e3a38c270c1cbe32ee0f231395f71c44a6 Mon Sep 17 00:00:00 2001 From: Yves Blusseau <blusseau@zetam.org> Date: Mon, 7 Apr 2014 13:13:00 +0200 Subject: [PATCH] * include/grub/misc.h: add __bzero declaration for compilation on Apple compiler --- include/grub/misc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/grub/misc.h b/include/grub/misc.h index c6cd456..f52ff28 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -91,13 +91,12 @@ int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_ void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); +#endif #ifdef __APPLE__ void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n); #endif -#endif - int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); -- 1.8.5.3 [-- Attachment #1.3: Type: text/plain, Size: 24 bytes --] Regards, Yves Blusseau [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 2980 bytes --] ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 11:21 Patch to compile grub2 with Apple compiler Yves Blusseau @ 2014-04-07 15:04 ` SevenBits 2014-04-07 19:52 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-07 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko 1 sibling, 1 reply; 20+ messages in thread From: SevenBits @ 2014-04-07 15:04 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 339 bytes --] On Monday, April 7, 2014, Yves Blusseau <blusseau@zetam.org> wrote: > Hi, > > this is a patch to allow compilation of grub2 with Apple Compiler Haven't looked at it yet, but if it works, I'd be major. Currently I have to build GRUB on Linux when my current development machine is a Mac. This will be a big development, at least for me. [-- Attachment #2: Type: text/html, Size: 542 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 15:04 ` SevenBits @ 2014-04-07 19:52 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-07 20:34 ` SevenBits 0 siblings, 1 reply; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-07 19:52 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 828 bytes --] On 07.04.2014 17:04, SevenBits wrote: > On Monday, April 7, 2014, Yves Blusseau <blusseau@zetam.org > <mailto:blusseau@zetam.org>> wrote: > > Hi, > > this is a patch to allow compilation of grub2 with Apple Compiler > > > Haven't looked at it yet, but if it works, I'd be major. GRUB was compileable under Apple compiler since quite a long time. But nobody cared about it and nobody reported problems so it broke again. If you care about Apple, then report problems, prefereably with patch > Currently I > have to build GRUB on Linux when my current development machine is a > Mac. This will be a big development, at least for me. > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 19:52 ` Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-07 20:34 ` SevenBits 2014-04-07 21:13 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 1 reply; 20+ messages in thread From: SevenBits @ 2014-04-07 20:34 UTC (permalink / raw) To: The development of GNU GRUB -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/07/2014 03:52 PM, Vladimir '?-coder/phcoder' Serbinenko wrote: > On 07.04.2014 17:04, SevenBits wrote: >> On Monday, April 7, 2014, Yves Blusseau <blusseau@zetam.org >> <mailto:blusseau@zetam.org>> wrote: >> >> Hi, >> >> this is a patch to allow compilation of grub2 with Apple >> Compiler >> >> >> Haven't looked at it yet, but if it works, I'd be major. > GRUB was compilable under Apple compiler since quite a long time. > But nobody cared about it and nobody reported problems so it broke > again. If you care about Apple, then report problems, preferably > with patch Well... the issue is that Apple's compiler cannot build executables in anything except OS X's native Mach-O format. This obviously rules out one of GRUB's supported platforms (EFI) which requires PE binaries, unless we're going to ship (or require as a build dependency) a tool that can convert between the various object formats. I'm not very knowledgeable about GRUB for non-EFI platforms, as EFI is my main focus for when I use GRUB. But Apple's compiler is finicky in general so I expect there might be some issues in building e.g GRUB-PC. That's AFAIK, though. Perhaps someone with more knowledge about GRUB's internals in this area than I can elaborate further. But I'd expect any Apple solution to suffer from neglect. GRUB isn't used much on Apple hardware, and when it is, it is used to boot Linux and is compiled on that platform. And even when GRUB *is* built on OS X, it is typically done so with a cross compiler. Using Apple's toolchain just isn't a big need unfortunately. >> Currently I have to build GRUB on Linux when my current >> development machine is a Mac. This will be a big development, at >> least for me. >> >> >> _______________________________________________ Grub-devel >> mailing list Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >> > > > > > _______________________________________________ Grub-devel mailing > list Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTQwvwAAoJEFbRvtGxmFPETZwH/jDXwpbGWK1XVsPOJe8PE5jz 9AH+EixFVIcukFLGyHlYSPzq27RVYtPuEDEp0XIybs6VNVloUefYv5Rb9tPkwNtd iQAMR93u2X8pjJAjjd315b9167LubAQ4a/Eu8hnhGl+HLWprX+XY3ru1l3Ktc7e1 5N8KVYRRb9itmSM7wh+WJFK5Xu7rjG5DRXV0trO+zTIcpCouUMX69ZC1BLk8Lf5H eVMMRi8kOmTdfgC7O/bdFNar5FgWRpc3Uv+ge/5QelpeZxPsGUOR2DVsVh9CiI7Z XUi4hYCo/eZyilIXdIsvQRAtnD5nB5hQfhEA1wD5+vs6QmyV9hbT3cALWvwWNds= =v80o -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 20:34 ` SevenBits @ 2014-04-07 21:13 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 0 replies; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-07 21:13 UTC (permalink / raw) To: grub-devel [-- Attachment #1: Type: text/plain, Size: 1210 bytes --] On 07.04.2014 22:34, SevenBits wrote: > On 04/07/2014 03:52 PM, Vladimir '?-coder/phcoder' Serbinenko wrote: >> On 07.04.2014 17:04, SevenBits wrote: >>> On Monday, April 7, 2014, Yves Blusseau <blusseau@zetam.org >>> <mailto:blusseau@zetam.org>> wrote: >>> >>> Hi, >>> >>> this is a patch to allow compilation of grub2 with Apple >>> Compiler >>> >>> >>> Haven't looked at it yet, but if it works, I'd be major. >> GRUB was compilable under Apple compiler since quite a long time. >> But nobody cared about it and nobody reported problems so it broke >> again. If you care about Apple, then report problems, preferably >> with patch > > Well... the issue is that Apple's compiler cannot build executables in > anything except OS X's native Mach-O format. This obviously rules out > one of GRUB's supported platforms (EFI) which requires PE binaries, > unless we're going to ship (or require as a build dependency) a tool > that can convert between the various object formats. > We use objconv. > I'm not very knowledgeable about GRUB for non-EFI platforms, as EFI is > my main focus for when I use GRUB. But Apple's compiler is finicky in > general This is not a GRUB problem [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 11:21 Patch to compile grub2 with Apple compiler Yves Blusseau 2014-04-07 15:04 ` SevenBits @ 2014-04-07 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-08 8:54 ` Yves Blusseau 1 sibling, 1 reply; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-07 19:51 UTC (permalink / raw) To: grub-devel [-- Attachment #1: Type: text/plain, Size: 439 bytes --] On 07.04.2014 13:21, Yves Blusseau wrote: > Hi, > > this is a patch to allow compilation of grub2 with Apple Compiler > > Why do you need this patch? __bzero shouldn't need any special tratement in GRUB_UTIL case. > > > > Regards, > Yves Blusseau > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-07 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-08 8:54 ` Yves Blusseau 2014-04-08 9:00 ` Vladimir 'phcoder' Serbinenko 0 siblings, 1 reply; 20+ messages in thread From: Yves Blusseau @ 2014-04-08 8:54 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 1066 bytes --] Hi Vladimir, this patch is needed because the declaration of __bzero must made also for non util AND util compilation: __bzero is used in compilation of grub-core/kern/misc.c (line 546). Without this patch we have this error: http://pastebin.com/aiPGcte0 So the declaration must be made even if GRUB_UTIL is defined. Regards, Yves Le 7 avr. 2014 à 21:51, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> a écrit : > On 07.04.2014 13:21, Yves Blusseau wrote: >> Hi, >> >> this is a patch to allow compilation of grub2 with Apple Compiler >> >> > Why do you need this patch? __bzero shouldn't need any special tratement > in GRUB_UTIL case. >> >> >> >> Regards, >> Yves Blusseau >> >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >> > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 2980 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 8:54 ` Yves Blusseau @ 2014-04-08 9:00 ` Vladimir 'phcoder' Serbinenko 2014-04-08 12:27 ` Yves Blusseau 2014-04-09 11:11 ` Yves Blusseau 0 siblings, 2 replies; 20+ messages in thread From: Vladimir 'phcoder' Serbinenko @ 2014-04-08 9:00 UTC (permalink / raw) To: The development of GRUB 2 [-- Attachment #1: Type: text/plain, Size: 1416 bytes --] On 8 Apr 2014 10:55, "Yves Blusseau" <blusseau@zetam.org> wrote: > > Hi Vladimir, > > this patch is needed because the declaration of __bzero must made also for non util AND util compilation: __bzero is used in compilation of grub-core/kern/misc.c (line 546). > > Without this patch we have this error: http://pastebin.com/aiPGcte0 > So the declaration must be made even if GRUB_UTIL is defined. > Not true. You just need to guard implementation as well > Regards, > Yves > > Le 7 avr. 2014 à 21:51, Vladimir 'φ-coder/phcoder' Serbinenko < phcoder@gmail.com> a écrit : > > > On 07.04.2014 13:21, Yves Blusseau wrote: > >> Hi, > >> > >> this is a patch to allow compilation of grub2 with Apple Compiler > >> > >> > > Why do you need this patch? __bzero shouldn't need any special tratement > > in GRUB_UTIL case. > >> > >> > >> > >> Regards, > >> Yves Blusseau > >> > >> > >> > >> _______________________________________________ > >> Grub-devel mailing list > >> Grub-devel@gnu.org > >> https://lists.gnu.org/mailman/listinfo/grub-devel > >> > > > > > > _______________________________________________ > > Grub-devel mailing list > > Grub-devel@gnu.org > > https://lists.gnu.org/mailman/listinfo/grub-devel > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > [-- Attachment #2: Type: text/html, Size: 2377 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 9:00 ` Vladimir 'phcoder' Serbinenko @ 2014-04-08 12:27 ` Yves Blusseau 2014-04-08 21:47 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-09 11:11 ` Yves Blusseau 1 sibling, 1 reply; 20+ messages in thread From: Yves Blusseau @ 2014-04-08 12:27 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1.1: Type: text/plain, Size: 679 bytes --] Le 8 avr. 2014 à 11:00, Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> a écrit : > > On 8 Apr 2014 10:55, "Yves Blusseau" <blusseau@zetam.org> wrote: > > > > Hi Vladimir, > > > > this patch is needed because the declaration of __bzero must made also for non util AND util compilation: __bzero is used in compilation of grub-core/kern/misc.c (line 546). > > > > Without this patch we have this error: http://pastebin.com/aiPGcte0 > > So the declaration must be made even if GRUB_UTIL is defined. > > > Not true. You just need to guard implementation as well > Don’t understand. What is the solution to solve the problem of compilation ? Regards, Yves [-- Attachment #1.2: Type: text/html, Size: 1560 bytes --] [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 2980 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 12:27 ` Yves Blusseau @ 2014-04-08 21:47 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-08 21:50 ` SevenBits 0 siblings, 1 reply; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-08 21:47 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 1175 bytes --] On 08.04.2014 14:27, Yves Blusseau wrote: > > Le 8 avr. 2014 à 11:00, Vladimir 'phcoder' Serbinenko <phcoder@gmail.com > <mailto:phcoder@gmail.com>> a écrit : > >> >> On 8 Apr 2014 10:55, "Yves Blusseau" <blusseau@zetam.org >> <mailto:blusseau@zetam.org>> wrote: >> > >> > Hi Vladimir, >> > >> > this patch is needed because the declaration of __bzero must made >> also for non util AND util compilation: __bzero is used in compilation >> of grub-core/kern/misc.c (line 546). >> > >> > Without this patch we have this error: http://pastebin.com/aiPGcte0 >> > So the declaration must be made even if GRUB_UTIL is defined. >> > >> Not true. You just need to guard implementation as well >> > Don’t understand. What is the solution to solve the problem of compilation ? > diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 54db2e1..c5c815d 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -542,6 +542,9 @@ memset (void *s, int c, grub_size_t n) return grub_memset (s, c, n); } +#endif + +#if !defined(GRUB_UTIL) && defined(__APPLE__) void GRUB_BUILTIN_ATTR __bzero (void *s, grub_size_t n) { [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 21:47 ` Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-08 21:50 ` SevenBits 2014-04-08 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 1 reply; 20+ messages in thread From: SevenBits @ 2014-04-08 21:50 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 1723 bytes --] On Apr 8, 2014, at 5:47 PM, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> wrote: > On 08.04.2014 14:27, Yves Blusseau wrote: >> >> Le 8 avr. 2014 à 11:00, Vladimir 'phcoder' Serbinenko <phcoder@gmail.com >> <mailto:phcoder@gmail.com>> a écrit : >> >>> >>> On 8 Apr 2014 10:55, "Yves Blusseau" <blusseau@zetam.org >>> <mailto:blusseau@zetam.org>> wrote: >>>> >>>> Hi Vladimir, >>>> >>>> this patch is needed because the declaration of __bzero must made >>> also for non util AND util compilation: __bzero is used in compilation >>> of grub-core/kern/misc.c (line 546). >>>> >>>> Without this patch we have this error: http://pastebin.com/aiPGcte0 >>>> So the declaration must be made even if GRUB_UTIL is defined. >>>> >>> Not true. You just need to guard implementation as well >>> >> Don’t understand. What is the solution to solve the problem of compilation ? >> > diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c > index 54db2e1..c5c815d 100644 > --- a/grub-core/kern/misc.c > +++ b/grub-core/kern/misc.c > @@ -542,6 +542,9 @@ memset (void *s, int c, grub_size_t n) > return grub_memset (s, c, n); > } > > +#endif > + > +#if !defined(GRUB_UTIL) && defined(__APPLE__) > void GRUB_BUILTIN_ATTR > __bzero (void *s, grub_size_t n) > { Yves: what I presume was meant was that your patch only needs to be applied on Apple machines, and so you should surround certain parts in preprocessor statements so they don’t negatively effect compilation on other platforms and compilers. > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel [-- Attachment #2: Message signed with OpenPGP using GPGMail --] [-- Type: application/pgp-signature, Size: 535 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 21:50 ` SevenBits @ 2014-04-08 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 0 replies; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-08 22:05 UTC (permalink / raw) To: grub-devel [-- Attachment #1: Type: text/plain, Size: 348 bytes --] On 08.04.2014 23:50, SevenBits wrote: > Yves: what I presume was meant was that your patch only needs to be applied on Apple machines, and so you should surround certain parts in preprocessor statements so they don’t negatively effect compilation on other platforms and compilers. You say directly the opposite of what I said and the patch. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-08 9:00 ` Vladimir 'phcoder' Serbinenko 2014-04-08 12:27 ` Yves Blusseau @ 2014-04-09 11:11 ` Yves Blusseau 2014-04-10 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko 1 sibling, 1 reply; 20+ messages in thread From: Yves Blusseau @ 2014-04-09 11:11 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1.1: Type: text/plain, Size: 45 bytes --] Is this patch ok ? Is yes can i commit it ? [-- Attachment #1.2: declare-__bzero-apple-compiler.patch --] [-- Type: application/octet-stream, Size: 1140 bytes --] From 0063794d12a320e2bec4fd65af37d26ebd80c2e0 Mon Sep 17 00:00:00 2001 From: Yves Blusseau <blusseau@zetam.org> Date: Tue, 8 Apr 2014 23:47:12 +0200 Subject: [PATCH] * grub-core/kern/misc.c: Declare __bzero function for GRUB_UTIL and apple compilers. --- ChangeLog | 5 +++++ grub-core/kern/misc.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 11de908..81f3d46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-04-09 Yves Blusseau <blusseau@zetam.org> + + * grub-core/kern/misc.c: Declare __bzero function for GRUB_UTIL and + apple compilers. + 2014-04-06 Vladimir Serbinenko <phcoder@gmail.com> * grub-core/lib/syslinux_parse.c: Fix timeout quoting. diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 54db2e1..c5c815d 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -542,6 +542,9 @@ memset (void *s, int c, grub_size_t n) return grub_memset (s, c, n); } +#endif + +#if !defined(GRUB_UTIL) && defined(__APPLE__) void GRUB_BUILTIN_ATTR __bzero (void *s, grub_size_t n) { -- 1.8.5.3 [-- Attachment #1.3: Type: text/plain, Size: 17 bytes --] Regards, Yves [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 2980 bytes --] ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-09 11:11 ` Yves Blusseau @ 2014-04-10 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-12 9:00 ` Yves Blusseau 2014-04-12 11:27 ` Yves Blusseau 0 siblings, 2 replies; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-10 21:20 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 252 bytes --] On 09.04.2014 13:11, Yves Blusseau wrote: > Is this patch ok ? > Is yes can i commit it ? > Did you test it? And no, patch is not ok. It's my patch with your name stuck on it. Never ever put your name on someone else's patches it's plagiate. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-10 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-12 9:00 ` Yves Blusseau 2014-04-12 11:27 ` Yves Blusseau 1 sibling, 0 replies; 20+ messages in thread From: Yves Blusseau @ 2014-04-12 9:00 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 520 bytes --] Le 10 avr. 2014 à 23:20, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> a écrit : > On 09.04.2014 13:11, Yves Blusseau wrote: >> Is this patch ok ? >> Is yes can i commit it ? >> > Did you test it? Yes i test it. Compile grub (EFI) on OSX 10.8.5 (Mountain Lion) with Xcode 5.1 and it's working. I have needed to copy the boot.efi file manually. I will try to make a patch to correct the problem. Also i need to test the "bios" version of grub. So you can commit the patch. Regards, Yves [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 1869 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-10 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-12 9:00 ` Yves Blusseau @ 2014-04-12 11:27 ` Yves Blusseau 2014-04-12 17:06 ` Andrey Borzenkov 1 sibling, 1 reply; 20+ messages in thread From: Yves Blusseau @ 2014-04-12 11:27 UTC (permalink / raw) To: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 104 bytes --] The "i386-pc" version built from OSX doesn't work. It will only display Grub Loading… Regards, Yves [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 1869 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-12 11:27 ` Yves Blusseau @ 2014-04-12 17:06 ` Andrey Borzenkov 2014-04-12 17:54 ` Yves Blusseau 0 siblings, 1 reply; 20+ messages in thread From: Andrey Borzenkov @ 2014-04-12 17:06 UTC (permalink / raw) To: The development of GNU GRUB В Sat, 12 Apr 2014 13:27:57 +0200 Yves Blusseau <blusseau@zetam.org> пишет: > The "i386-pc" version built from OSX doesn't work. > It will only display Grub Loading… > On which platform? ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-12 17:06 ` Andrey Borzenkov @ 2014-04-12 17:54 ` Yves Blusseau 2014-04-20 14:10 ` Vladimir 'φ-coder/phcoder' Serbinenko 0 siblings, 1 reply; 20+ messages in thread From: Yves Blusseau @ 2014-04-12 17:54 UTC (permalink / raw) To: Andrey Borzenkov; +Cc: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 308 bytes --] Le 12 avr. 2014 à 19:06, Andrey Borzenkov <arvidjaar@gmail.com> a écrit : > В Sat, 12 Apr 2014 13:27:57 +0200 > Yves Blusseau <blusseau@zetam.org> пишет: > >> The "i386-pc" version built from OSX doesn't work. >> It will only display Grub Loading… >> > > On which platform? i386-pc [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 1869 bytes --] ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-12 17:54 ` Yves Blusseau @ 2014-04-20 14:10 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-05-02 10:33 ` Yves Blusseau 0 siblings, 1 reply; 20+ messages in thread From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-04-20 14:10 UTC (permalink / raw) To: grub-devel [-- Attachment #1.1: Type: text/plain, Size: 935 bytes --] On 12.04.2014 19:54, Yves Blusseau wrote: > > Le 12 avr. 2014 à 19:06, Andrey Borzenkov <arvidjaar@gmail.com> a écrit : > >> В Sat, 12 Apr 2014 13:27:57 +0200 >> Yves Blusseau <blusseau@zetam.org> пишет: >> >>> The "i386-pc" version built from OSX doesn't work. >>> It will only display Grub Loading… >>> Not surprising. Apple misassembler generates correct 16-bit code only when stars are right. Every version of Apple misassembler has bugs, every version they are different. You'd need to disassemble the resulting code and compare it with original file to know which instructions are wrong. Just a hunch: it may be ADDR32/DATA32. Attached is my experimental patch for removal of ADDR32/DATA32 >> >> On which platform? > i386-pc > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1.2: data32.diff --] [-- Type: text/x-diff; name="data32.diff", Size: 7104 bytes --] diff --git a/acinclude.m4 b/acinclude.m4 index 32d5477..89b1710 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -210,80 +210,6 @@ fi ]) -dnl Mass confusion! -dnl Older versions of GAS interpret `.code16' to mean ``generate 32-bit -dnl instructions, but implicitly insert addr32 and data32 bytes so -dnl that the code works in real mode''. -dnl -dnl Newer versions of GAS interpret `.code16' to mean ``generate 16-bit -dnl instructions,'' which seems right. This requires the programmer -dnl to explicitly insert addr32 and data32 instructions when they want -dnl them. -dnl -dnl We only support the newer versions, because the old versions cause -dnl major pain, by requiring manual assembly to get 16-bit instructions into -dnl asm files. -AC_DEFUN([grub_I386_ASM_ADDR32], -[AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT]) -AC_MSG_CHECKING([for .code16 addr32 assembler support]) -AC_CACHE_VAL(grub_cv_i386_asm_addr32, -[cat > conftest.s.in <<\EOF - .code16 -l1: @ADDR32@ movb %al, l1 -EOF - -if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then - sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s -else - sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s -fi - -if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then - grub_cv_i386_asm_addr32=yes -else - grub_cv_i386_asm_addr32=no -fi - -rm -f conftest*]) - -AC_MSG_RESULT([$grub_cv_i386_asm_addr32])]) - -dnl Later versions of GAS requires that addr32 and data32 prefixes -dnl appear in the same lines as the instructions they modify, while -dnl earlier versions requires that they appear in separate lines. -AC_DEFUN([grub_I386_ASM_PREFIX_REQUIREMENT], -[AC_REQUIRE([AC_PROG_CC]) -AC_MSG_CHECKING(dnl -[whether addr32 must be in the same line as the instruction]) -AC_CACHE_VAL(grub_cv_i386_asm_prefix_requirement, -[cat > conftest.s <<\EOF - .code16 -l1: addr32 movb %al, l1 -EOF - -if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then - grub_cv_i386_asm_prefix_requirement=yes -else - grub_cv_i386_asm_prefix_requirement=no -fi - -rm -f conftest*]) - -if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then - grub_tmp_addr32="addr32" - grub_tmp_data32="data32" -else - grub_tmp_addr32="addr32;" - grub_tmp_data32="data32;" -fi - -ADDR32=$grub_tmp_addr32 -DATA32=$grub_tmp_data32 - -AC_MSG_RESULT([$grub_cv_i386_asm_prefix_requirement])]) - - dnl Check what symbol is defined as a bss start symbol. dnl Written by Michael Hohmoth and Yoshinori K. Okuji. AC_DEFUN([grub_CHECK_BSS_START_SYMBOL], diff --git a/config.h.in b/config.h.in index 4b63014..d93b687 100644 --- a/config.h.in +++ b/config.h.in @@ -31,10 +31,6 @@ #define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ /* Define if C symbols get an underscore after compilation. */ #define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ -/* Define it to \"addr32\" or \"addr32;\" to make GAS happy. */ -#define ADDR32 @ADDR32@ -/* Define it to \"data32\" or \"data32;\" to make GAS happy. */ -#define DATA32 @DATA32@ /* Define it to one of __bss_start, edata and _edata. */ #define BSS_START_SYMBOL @BSS_START_SYMBOL@ /* Define it to either end or _end. */ diff --git a/configure.ac b/configure.ac index 77c942a..b25304f 100644 --- a/configure.ac +++ b/configure.ac @@ -1046,8 +1046,6 @@ if test "x$target_cpu" = xi386; then grub_CHECK_END_SYMBOL fi CFLAGS="$TARGET_CFLAGS" - grub_I386_ASM_PREFIX_REQUIREMENT - grub_I386_ASM_ADDR32 fi grub_PROG_NM_WORKS @@ -1568,8 +1566,6 @@ AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) AC_SUBST(HAVE_ASM_USCORE) -AC_SUBST(ADDR32) -AC_SUBST(DATA32) AC_SUBST(BSS_START_SYMBOL) AC_SUBST(END_SYMBOL) AC_SUBST(PACKAGE) diff --git a/grub-core/boot/i386/pc/startup_raw.S b/grub-core/boot/i386/pc/startup_raw.S index 2796740..7b1c502 100644 --- a/grub-core/boot/i386/pc/startup_raw.S +++ b/grub-core/boot/i386/pc/startup_raw.S @@ -89,13 +89,13 @@ LOCAL (codestart): sti /* we're safe again */ /* save the boot drive */ - ADDR32 movb %dl, LOCAL(boot_drive) + movb %dl, LOCAL(boot_drive) /* reset disk system (%ah = 0) */ int $0x13 /* transition to protected mode */ - DATA32 call real_to_prot + calll real_to_prot /* The ".code32" directive takes GAS out of 16-bit mode. */ .code32 @@ -149,7 +149,7 @@ gate_a20_try_bios: movw $0x2401, %ax int $0x15 - DATA32 call real_to_prot + calll real_to_prot .code32 popl %ebp diff --git a/grub-core/boot/i386/qemu/boot.S b/grub-core/boot/i386/qemu/boot.S index bdd68c7..8d97fc1 100644 --- a/grub-core/boot/i386/qemu/boot.S +++ b/grub-core/boot/i386/qemu/boot.S @@ -48,7 +48,7 @@ VARIABLE(grub_core_entry_addr) /* Transition to protected mode. We use pushl to force generation of a flat return address. */ pushl $1f - DATA32 jmp real_to_prot + jmpl real_to_prot .code32 /* Ensure A20 is enabled. We're in qemu, so control port A works and there is no need to wait since there is no real logic, it's diff --git a/grub-core/kern/i386/pc/startup.S b/grub-core/kern/i386/pc/startup.S index 6bb36c6..b8a9b33 100644 --- a/grub-core/kern/i386/pc/startup.S +++ b/grub-core/kern/i386/pc/startup.S @@ -135,7 +135,7 @@ LOCAL(prot_to_real_addr): .macro REAL_TO_PROT movl LOCAL(real_to_prot_addr), %eax - DATA32 call *%ax + calll *%eax .endm /* diff --git a/grub-core/kern/i386/realmode.S b/grub-core/kern/i386/realmode.S index 541cedc..1384d52 100644 --- a/grub-core/kern/i386/realmode.S +++ b/grub-core/kern/i386/realmode.S @@ -54,7 +54,7 @@ protstack: .endm .macro REAL_TO_PROT - DATA32 call real_to_prot + calll real_to_prot .endm /* @@ -137,7 +137,7 @@ real_to_prot: /* load the GDT register */ xorw %ax, %ax movw %ax, %ds - DATA32 ADDR32 lgdt gdtdesc + lgdtl gdtdesc /* turn on protected mode */ movl %cr0, %eax @@ -145,7 +145,7 @@ real_to_prot: movl %eax, %cr0 /* jump to relocation, flush prefetch queue, and reload %cs */ - DATA32 ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg + ljmpl $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg .code32 protcseg: @@ -237,7 +237,7 @@ tmpcseg: movl %eax, %cr0 /* flush prefetch queue, reload %cs */ - DATA32 ljmp $0, $realcseg + ljmpl $0, $realcseg realcseg: /* we are in real mode now @@ -258,6 +258,6 @@ realcseg: #endif /* return on new stack! */ - DATA32 ret + retl .code32 diff --git a/grub-core/modinfo.sh.in b/grub-core/modinfo.sh.in index d46b56c..ebe93bb 100644 --- a/grub-core/modinfo.sh.in +++ b/grub-core/modinfo.sh.in @@ -9,8 +9,6 @@ grub_have_font_source=@HAVE_FONT_SOURCE@ # Autodetected config grub_have_asm_uscore=@HAVE_ASM_USCORE@ -grub_i8086_addr32="@ADDR32@" -grub_i8086_data32="@DATA32@" grub_bss_start_symbol="@BSS_START_SYMBOL@" grub_end_symbol="@END_SYMBOL@" [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 274 bytes --] ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: Patch to compile grub2 with Apple compiler 2014-04-20 14:10 ` Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-05-02 10:33 ` Yves Blusseau 0 siblings, 0 replies; 20+ messages in thread From: Yves Blusseau @ 2014-05-02 10:33 UTC (permalink / raw) To: The development of GNU GRUB Le 20 avr. 2014 à 16:10, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> a écrit : > On 12.04.2014 19:54, Yves Blusseau wrote: >> >> Le 12 avr. 2014 à 19:06, Andrey Borzenkov <arvidjaar@gmail.com> a écrit : >> >>> В Sat, 12 Apr 2014 13:27:57 +0200 >>> Yves Blusseau <blusseau@zetam.org> пишет: >>> >>>> The "i386-pc" version built from OSX doesn't work. >>>> It will only display Grub Loading… >>>> > Not surprising. Apple misassembler generates correct 16-bit code only > when stars are right. > Every version of Apple misassembler has bugs, every version they are > different. You'd need to disassemble the resulting code and compare it > with original file to know which instructions are wrong. > Just a hunch: it may be ADDR32/DATA32. Attached is my experimental patch > for removal of ADDR32/DATA32 Same Error with the patch: only Grub Loading… is displayed. Do you want some files to find the differences with grub compiled on linux ? Regards, Yves ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2014-05-02 10:33 UTC | newest] Thread overview: 20+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-04-07 11:21 Patch to compile grub2 with Apple compiler Yves Blusseau 2014-04-07 15:04 ` SevenBits 2014-04-07 19:52 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-07 20:34 ` SevenBits 2014-04-07 21:13 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-07 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-08 8:54 ` Yves Blusseau 2014-04-08 9:00 ` Vladimir 'phcoder' Serbinenko 2014-04-08 12:27 ` Yves Blusseau 2014-04-08 21:47 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-08 21:50 ` SevenBits 2014-04-08 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-09 11:11 ` Yves Blusseau 2014-04-10 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-04-12 9:00 ` Yves Blusseau 2014-04-12 11:27 ` Yves Blusseau 2014-04-12 17:06 ` Andrey Borzenkov 2014-04-12 17:54 ` Yves Blusseau 2014-04-20 14:10 ` Vladimir 'φ-coder/phcoder' Serbinenko 2014-05-02 10:33 ` Yves Blusseau
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.