Browse Source

Advertise obstack only when chosen

This is similar to this patch for GNU glob:
ff6ce3999db93a52d1cd22510f8508b660ddf54e.

The problem is that libiberty/obstack.c file checks for
_GNU_OBSTACK_INTERFACE_VERSION == _OBSTACK_INTERFACE_VERSION and elides
libiberty obstack implementation if there is already a compatible
implementation in libc. Therefore define should be set only when obstack is
actually selected, otherwise it is not possible to build binutils and gdb
with uClibc.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Anton Kolesov 8 years ago
parent
commit
36656f6dc2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      include/gnu-versions.h

+ 2 - 0
include/gnu-versions.h

@@ -43,7 +43,9 @@
    remember, if any of these versions change, the libc.so major version
    number must change too (so avoid it)!  */
 
+#ifdef __UCLIBC_HAS_OBSTACK__
 #define _GNU_OBSTACK_INTERFACE_VERSION	1 /* vs malloc/obstack.c */
+#endif
 #define _GNU_REGEX_INTERFACE_VERSION	1 /* vs posix/regex.c */
 #ifdef __UCLIBC_HAS_GNU_GLOB__
 #define _GNU_GLOB_INTERFACE_VERSION	1 /* vs posix/glob.c */