[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GRUB2 on OpenBSD 5.3-amd64: linking problem
From: |
Ilya Bakulin |
Subject: |
Re: GRUB2 on OpenBSD 5.3-amd64: linking problem |
Date: |
Wed, 14 Aug 2013 17:16:44 +0200 |
User-agent: |
KMail/1.9.10 (enterprise35 20120322.0d8ab49a133482885a7a6ae00ec4472b1859206f) |
Hi,
On Wednesday 14 August 2013 15:49:03 Grégoire Sutre wrote:
> On 08/14/2013 03:31 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > You need to modify following:
> > #ifndef __APPLE__
> > typedef grub_size_t size_t;
> > #else
> > #include <stddef.h>
> > #endif
> > to
> > #if !defined (__APPLE__) && !defined (__OPENBSD__)
Yes, this works!
>
> For the record, this is also needed for NetBSD (when building
> within the pkgsrc framework -- see pkgsrc's sysutils/grub2 package).
>
> A similar patch (for NetBSD, but maybe also for OpenBSD?) is:
>
> --- grub-core/lib/posix_wrap/wchar.h.orig 2012-02-08 20:34:24.000000000
> +0000
> +++ grub-core/lib/posix_wrap/wchar.h
> @@ -29,7 +29,11 @@ enum
> };
>
> /* UCS-4. */
> +#if !defined(__NetBSD__)
> typedef grub_int32_t wchar_t;
> +#else
> +#include <stddef.h>
> +#endif
>
> typedef struct mbstate {
> grub_uint32_t code;
Unfortunately, this doesn't seem to be enough, because stddef.h on OpenBSD
already has the definition for mbstate_t. So if I let wchar.h define its own
version, there is a definition conflict. And omitting stddef.h inclusion also
doesn't work, because stddef.h seems to be already included from elsewhere.
If I move the "typedef mbstate .. mbstate_t" into '#if !defined(__OpenBSD__)',
then the code uses the version from stddef.h, which lacks "code" and "count"
fields. It is defined as follows:
/*
* mbstate_t is an opaque object to keep conversion state, during multibyte
* stream conversions. The content must not be referenced by user programs.
*/
typedef union {
char __mbstate8[128];
__int64_t __mbstateL; /* for alignment */
} __mbstate_t;
Anyway, I'm going to try the version from Bazaar. Will report the results
tomorrow.
Thank you all for your help!
--
Ilya
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Ilya Bakulin, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem,
Ilya Bakulin <=
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Ilya Bakulin, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/15
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/15