Compiling grub2 on OpenBSD
I got grub2 compiled on NetBSD, so now on to OpenBSD:
In file included from ../util/i386/pc/grub-mkimage.c:29:../include/grub/misc.h:43: warning: conflicting types for built-in function `memcpy' In file included from ../util/i386/pc/grub-mkimage.c:33:/usr/include/string.h:60: error: conflicting types for memcpy' ../include/grub/misc.h:43: error: previous declaration of memcpy'
And here is the offending definition from /usr/include/string.h:
void *memcpy(void *, const void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,3)))
__attribute__ ((__bounded__(__buffer__,2,3)));This is only the first of many such weird things I expect to show up. (OpenBSD has blazed its own trail to another planet over the years :o)
Quoted 8 lines · walt
I got grub2 compiled on NetBSD, so now on to OpenBSD:
In file included from
../util/i386/pc/grub-mkimage.c:29:../include/grub/misc.h:43: warning: conflicting types for built-in function `memcpy'
In file included from../util/i386/pc/grub-mkimage.c:33:/usr/include/string.h:60: error: conflicting types formemcpy' ../include/grub/misc.h:43: error: previous declaration ofmemcpy'
Sounds strange. Why do we have memcpy at all? Shouldn't it be grub_memcpy?
Redeclaring system-provided functions this way is asking for trouble...
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call… if you are unable to speak? (as seen on /.)
Quoted 10 lines · Robert Millan
Quoted 8 lines · walt
I got grub2 compiled on NetBSD, so now on to OpenBSD:
In file included from
../util/i386/pc/grub-mkimage.c:29:../include/grub/misc.h:43: warning: conflicting types for built-in function `memcpy'
In file included from../util/i386/pc/grub-mkimage.c:33:/usr/include/string.h:60: error: conflicting types formemcpy' ../include/grub/misc.h:43: error: previous declaration ofmemcpy'
Quoted 2 lines
Sounds strange. Why do we have memcpy at all? Shouldn't it be
grub_memcpy?
IIRC, GCC implicitly generates references to memcpy, thus somebody has added memcpy as an alias to grub_memcpy.
I don't know how to solve it cleanly. If you have an idea, I'd like to know.
Okuji