]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Fix build for openrisc with uClibc
authorBaruch Siach <baruch@tkos.co.il>
Tue, 3 Apr 2018 17:10:14 +0000 (20:10 +0300)
committerGuillem Jover <guillem@hadrons.org>
Wed, 4 Apr 2018 00:29:15 +0000 (02:29 +0200)
uClibc defines EM_OR1K instead of EM_OPENRISC for the OpenRISC ELF
e_machine ID. Use EM_OR1K when EM_OPENRISC is not defined.

This fixes the following build failure:

In file included from nlist.c:44:0:
nlist.c: In function ‘__elf_is_okay__’:
local-elf.h:224:23: error: ‘EM_OPENRISC’ undeclared (first use in this function)
 #define ELF_TARG_MACH EM_OPENRISC
                       ^
nlist.c:77:26: note: in expansion of macro ‘ELF_TARG_MACH’
   if (ehdr->e_machine == ELF_TARG_MACH &&
                          ^

Signed-off-by: Guillem Jover <guillem@hadrons.org>
src/local-elf.h

index c11bf6ef7de03ea73e6c41f38c34f6e7d336c7c9..83ca2537b85f25b1564330f33a4aff723017ec59 100644 (file)
 
 #elif defined(__or1k__)
 
+#if defined(EM_OPENRISC)
 #define ELF_TARG_MACH  EM_OPENRISC
+#else
+#define ELF_TARG_MACH  EM_OR1K
+#endif
 #define ELF_TARG_CLASS ELFCLASS32
 #define ELF_TARG_DATA  ELFDATA2MSB