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 --- include/gnu-versions.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/gnu-versions.h b/include/gnu-versions.h index 9f53778..6678c9b 100644 --- a/include/gnu-versions.h +++ b/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 */
Obstack was enabled in ARC defconfig to enable builds of native binutils and GDB. This is not needed after earlier patch which removes invalid _GNU_OBSTACK_INTERFACE_VERSION definition in cases when obstack is not selected in uClibc configuration. With this change binutils and GDB would use obstack implementation from their own source trees. In fact with recent binutils it is not possible to build it using obstack implementation in uClibc, because binutils/include/obstack.h started to use _obstack_free function instead of obstack_free, but _obstack_free is not defined in uClibc.
Signed-off-by: Anton Kolesov Anton.Kolesov@synopsys.com Cc: Vineet Gupta Vineet.Gupta1@synopsys.com Cc: Alexey Brodkin abrodkin@synopsys.com --- extra/Configs/defconfigs/arc/arcv2_defconfig | 1 - extra/Configs/defconfigs/arc/defconfig | 1 - 2 files changed, 2 deletions(-)
diff --git a/extra/Configs/defconfigs/arc/arcv2_defconfig b/extra/Configs/defconfigs/arc/arcv2_defconfig index 9e34694..2d12358 100644 --- a/extra/Configs/defconfigs/arc/arcv2_defconfig +++ b/extra/Configs/defconfigs/arc/arcv2_defconfig @@ -9,7 +9,6 @@ LDSO_RUNPATH=y # LDSO_SAFE_RUNPATH is not set UCLIBC_HAS_THREADS_NATIVE=y PTHREADS_DEBUG_SUPPORT=y -UCLIBC_HAS_OBSTACK=y UCLIBC_HAS_UTMPX=y UCLIBC_HAS_UTMP=y UCLIBC_SUSV2_LEGACY=y diff --git a/extra/Configs/defconfigs/arc/defconfig b/extra/Configs/defconfigs/arc/defconfig index bd93696..f582eb5 100644 --- a/extra/Configs/defconfigs/arc/defconfig +++ b/extra/Configs/defconfigs/arc/defconfig @@ -8,7 +8,6 @@ LDSO_RUNPATH=y # LDSO_SAFE_RUNPATH is not set UCLIBC_HAS_THREADS_NATIVE=y PTHREADS_DEBUG_SUPPORT=y -UCLIBC_HAS_OBSTACK=y UCLIBC_HAS_UTMPX=y UCLIBC_HAS_UTMP=y UCLIBC_SUSV2_LEGACY=y
Hi Anton, Anton Kolesov wrote,
Obstack was enabled in ARC defconfig to enable builds of native binutils and GDB. This is not needed after earlier patch which removes invalid _GNU_OBSTACK_INTERFACE_VERSION definition in cases when obstack is not selected in uClibc configuration. With this change binutils and GDB would use obstack implementation from their own source trees. In fact with recent binutils it is not possible to build it using obstack implementation in uClibc, because binutils/include/obstack.h started to use _obstack_free function instead of obstack_free, but _obstack_free is not defined in uClibc.
Thanks for the patch. Can you tell us the version when native binutils fails to build? I regulary testing native binutils compile for different architectures and haven't seen the failure, yet. UCLIBC_HAS_OBSTACK is always enabled in my config.
best regards Waldemar
Thanks for the patch. Can you tell us the version when native binutils fails to build? I regulary testing native binutils compile for different architectures and haven't seen the failure, yet. UCLIBC_HAS_OBSTACK is always enabled in my config.
Hi Waldemar,
I'm working with binutils-gdb master (or close to it). Obstack implementation has been updated in binutils in November 2015:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=314dee8e...
So it should be present in latest binutils 2.26 (released on January 27).
Anton
best regards Waldemar
Hi Anton, Anton Kolesov wrote,
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.
Thanks, both applied and pushed, Waldemar