[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patches] Revert --disable-versioning support changes
- To: <patches@xxxxxxxxxx>
- Subject: [Patches] Revert --disable-versioning support changes
- From: "Joseph S. Myers" <joseph@xxxxxxxxxxxxxxxx>
- Date: Thu, 29 Aug 2013 20:49:46 +0000
I've applied this patch to revert the bitrotten EGLIBC-local changes to
support --disable-versioning, and to change one other $(versioning)
conditional in local makefile changes to $(build-shared), in preparation
for a merge from glibc once the removal of --disable-versioning has gone
in there.
Index: Makerules
===================================================================
--- Makerules (revision 23870)
+++ Makerules (working copy)
@@ -105,7 +105,6 @@
sed -n '/ VERSION_$*_/{s/^.*_\([A-Z0-9_]*\).*$$/\1/;h;};$${g;p;}' \
$(common-objpfx)abi-versions.h > $@T
mv -f $@T $@
-abi_versions_file := $(common-objpfx)abi-versions.h
endif # avoid-generated
endif # $(versioning) = yes
@@ -284,9 +283,7 @@
# Generate version maps, but wait until sysdep-subdirs is known
ifeq ($(sysd-sorted-done),t)
-# eglibc: Even when not using symbol versioning we still need to generate
-# eglibc: version maps to make all the necessary symbols global.
-# eglibc: ifeq ($(versioning),yes)
+ifeq ($(versioning),yes)
-include $(common-objpfx)sysd-versions
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
common-generated += $(version-maps)
@@ -314,7 +311,7 @@
# See %.v/%.v.i implicit rules in Makeconfig.
$(common-objpfx)Versions.v.i: $(wildcard $(subdirs:%=$(..)%/Versions)) \
$(wildcard $(sysdirs:%=%/Versions)) \
- $(abi_versions_file) \
+ $(common-objpfx)abi-versions.h \
$(sysd-versions-force)
$(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
$(common-objpfx)Versions.v \
@@ -323,12 +320,11 @@
cat $(word 2,$^) \
| LC_ALL=C $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
-v move_if_change='$(move-if-change)' \
- -v versioning=$(versioning) \
-f $(word 3,$^); \
) > $@T
mv -f $@T $@
endif # avoid-generated
-# eglibc: endif # $(versioning) = yes
+endif # $(versioning) = yes
endif # sysd-sorted-done
# Generate .dT files as we compile.
@@ -425,12 +421,12 @@
# Reference map file only when versioning is selected and a map file name
# is given.
-# eglibc: ifeq ($(versioning),yes)
+ifeq ($(versioning),yes)
map-file = $(firstword $($(@F:.so=-map)) \
$(addprefix $(common-objpfx), \
$(filter $(@F:.so=.map),$(version-maps))))
load-map-file = $(map-file:%=-Wl,--version-script=%)
-# eglibc: endif
+endif
# Compiler arguments to use to link a shared object with libc and
# ld.so. This is intended to be as similar as possible to a default
@@ -588,13 +584,6 @@
libc_pic_clean := .clean
endif
-ifneq ($(versioning),yes)
-# When EGLIBC is built without symbol versioning, local copy of
-# unwind-dw2-fde-glibc.c is not compiled, so we need to link against
-# libgcc_eh to get _Unwind_Find_FDE.
-libc_gcclibs := -lgcc_eh
-endif
-
# Do not filter ld.so out of libc.so link.
$(common-objpfx)libc.so: link-libc-deps = # empty
@@ -604,10 +593,10 @@
$(elfobjdir)/sofini.os \
$(elfobjdir)/interp.os $(elfobjdir)/ld.so \
$(shlib-lds)
- $(build-shlib) $(libc_gcclibs)
-# eglibc: ifeq ($(versioning),yes)
+ $(build-shlib)
+ifeq ($(versioning),yes)
$(common-objpfx)libc.so: $(common-objpfx)libc.map
-# eglibc: endif
+endif
common-generated += libc.so libc_pic.os
ifndef subdir
install-extras := soinit.o sofini.o
@@ -870,7 +859,7 @@
install-lib := $(filter-out libpthread_pic.a,$(install-lib))
# Despite having a soname libhurduser and libmachuser do not use symbol
# versioning, so don't install the corresponding .map files.
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
install-map := $(patsubst %.so,%.map,\
$(foreach L,$(install-lib.so-versioned),$(notdir $L)))
install-map := $(filter-out libhurduser.map libmachuser.map libpthread.map,$(install-map))
Index: elf/do-rel.h
===================================================================
--- elf/do-rel.h (revision 23870)
+++ elf/do-rel.h (working copy)
@@ -111,7 +111,7 @@
for (; relative < r; ++relative)
DO_ELF_MACHINE_REL_RELATIVE (map, l_addr, relative);
-#if defined RTLD_BOOTSTRAP && defined DO_VERSIONING
+#ifdef RTLD_BOOTSTRAP
/* The dynamic linker always uses versioning. */
assert (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL);
#else
@@ -154,7 +154,7 @@
}
#endif
}
-#if !defined RTLD_BOOTSTRAP || !defined DO_VERSIONING
+#ifndef RTLD_BOOTSTRAP
else
{
for (; r < end; ++r)
Index: elf/Makefile
===================================================================
--- elf/Makefile (revision 23870)
+++ elf/Makefile (working copy)
@@ -59,9 +59,9 @@
generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
generated-dirs := for-renamed
-# eglibc: ifeq ($(versioning),yes)
+ifeq ($(versioning),yes)
ld-map = $(common-objpfx)ld.map
-# eglibc: endif
+endif
ifeq (yes,$(build-shared))
extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
Index: resolv/res_libc.c
===================================================================
--- resolv/res_libc.c (revision 23870)
+++ resolv/res_libc.c (working copy)
@@ -144,9 +144,9 @@
/* We declare this with compat_symbol so that it's not
visible at link time. Programs must use the accessor functions. */
-#if defined SHARED
+#if defined SHARED && defined DO_VERSIONING
# include <shlib-compat.h>
-invisible_compat_symbol (libc, _res, GLIBC_2_0);
+compat_symbol (libc, _res, _res, GLIBC_2_0);
#endif
#include <shlib-compat.h>
Index: scripts/versions.awk
===================================================================
--- scripts/versions.awk (revision 23870)
+++ scripts/versions.awk (working copy)
@@ -6,7 +6,6 @@
# defsfile name of Versions.def file
# buildroot name of build directory with trailing slash
# move_if_change move-if-change command
-# versioning "yes", if symbol versioning is being used
# Read definitions for the versions.
BEGIN {
@@ -68,10 +67,7 @@
sortver=actver
# Ensure GLIBC_ versions come always first
sub(/^GLIBC_/," GLIBC_",sortver)
- if (versioning == "yes") printf("%s %s %s\n", actlib, sortver, $0) | sort;
- # When not using symbol versioning, assign all symbols non-existent GLIBC
- # version 1.1; this will allow us to make all necessary symbols global.
- else printf("%s GLIBC_1.1 %s\n", actlib, $0) | sort;
+ printf("%s %s %s\n", actlib, sortver, $0) | sort;
}
@@ -85,7 +81,7 @@
# or FOO_x and FOO_y but not GLIBC_x and FOO_y.
pfx = oldname;
sub(/[0-9.]+/,".+",pfx);
- if (oldname == "" || name !~ pfx || versioning != "yes") print "};" > outfile;
+ if (oldname == "" || name !~ pfx) print "};" > outfile;
else printf("} %s;\n", oldname) > outfile;
}
@@ -125,10 +121,7 @@
closeversion(oldver, veryoldver);
veryoldver = oldver;
}
- if (versioning == "yes") printf("%s {\n global:\n", $2) > outfile;
- # When not using symbol versioning, just output which symbols should be
- # made global.
- else print "{\n global:\n" > outfile;
+ printf("%s {\n global:\n", $2) > outfile;
oldver = $2;
}
printf(" ") > outfile;
Index: ChangeLog.eglibc
===================================================================
--- ChangeLog.eglibc (revision 23870)
+++ ChangeLog.eglibc (working copy)
@@ -1,3 +1,19 @@
+2013-08-29 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * Makerules, elf/Makefile, elf/do-rel.h, extra-lib.mk,
+ include/libc-symbols.h, include/shlib-compat.h, nptl/Makefile,
+ nptl/pthread_kill_other_threads.c, resolv/res_libc.c,
+ scripts/versions.awk, sysdeps/ieee754/ldbl-128ibm/s_finitel.c,
+ sysdeps/ieee754/ldbl-128ibm/s_isinfl.c,
+ sysdeps/ieee754/ldbl-128ibm/s_isnanl.c,
+ sysdeps/ieee754/ldbl-128ibm/strtold_l.c,
+ sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h,
+ sysdeps/powerpc/longjmp.c, sysdeps/powerpc/powerpc32/dl-machine.c,
+ sysdeps/wordsize-32/divdi3.c: Revert --disable-versioning support
+ changes.
+ * Makerules: Change $(versioning) conditional in local code to
+ $(build-shared).
+
2013-08-20 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* debug/tst-backtrace6.c: Remove.
Index: include/shlib-compat.h
===================================================================
--- include/shlib-compat.h (revision 23870)
+++ include/shlib-compat.h (working copy)
@@ -25,36 +25,6 @@
#include <abi-versions.h> /* header generated by abi-versions.awk */
#endif
-#if defined SHARED
-
-# ifndef NOT_IN_libc
-# define IS_IN_libc 1
-# endif
-
-/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
- the version set name to use for e.g. symbols first introduced into
- libm in the GLIBC_2.1 version. Definitions of symbols with explicit
- versions should look like:
- versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
- This will define the symbol `foo' with the appropriate default version,
- i.e. either GLIBC_2.1 or the "earliest version" specified in
- shlib-versions if that is newer. */
-
-# define versioned_symbol(lib, local, symbol, version) \
- versioned_symbol_1 (lib, local, symbol, version)
-# define versioned_symbol_1(lib, local, symbol, version) \
- versioned_symbol_2 (local, symbol, VERSION_##lib##_##version)
-# define versioned_symbol_2(local, symbol, name) \
- default_symbol_version (local, symbol, name)
-
-#else
-
-/* No versions to worry about, just make this the global definition. */
-# define versioned_symbol(lib, local, symbol, version) \
- weak_alias (local, symbol)
-
-#endif
-
#if defined SHARED && defined DO_VERSIONING
/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
@@ -79,6 +49,26 @@
&& (!(ABI_##lib##_##obsoleted - 0) \
|| ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
+# ifndef NOT_IN_libc
+# define IS_IN_libc 1
+# endif
+
+/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
+ the version set name to use for e.g. symbols first introduced into
+ libm in the GLIBC_2.1 version. Definitions of symbols with explicit
+ versions should look like:
+ versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
+ This will define the symbol `foo' with the appropriate default version,
+ i.e. either GLIBC_2.1 or the "earliest version" specified in
+ shlib-versions if that is newer. */
+
+# define versioned_symbol(lib, local, symbol, version) \
+ versioned_symbol_1 (lib, local, symbol, version)
+# define versioned_symbol_1(lib, local, symbol, version) \
+ versioned_symbol_2 (local, symbol, VERSION_##lib##_##version)
+# define versioned_symbol_2(local, symbol, name) \
+ default_symbol_version (local, symbol, name)
+
# define compat_symbol(lib, local, symbol, version) \
compat_symbol_1 (lib, local, symbol, version)
# define compat_symbol_1(lib, local, symbol, version) \
@@ -86,26 +76,18 @@
# define compat_symbol_2(local, symbol, name) \
symbol_version (local, symbol, name)
-/* This macro is used to provide a versioned-only only symbol
- which is otherwise invisible at link time. */
-# define invisible_compat_symbol(lib, symbol, version) \
- compat_symbol (lib, symbol, symbol, version)
-
#else
/* Not compiling ELF shared libraries at all, so never any old versions. */
# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+/* No versions to worry about, just make this the global definition. */
+# define versioned_symbol(lib, local, symbol, version) \
+ weak_alias (local, symbol)
+
/* This should not appear outside `#if SHLIB_COMPAT (...)'. */
# define compat_symbol(lib, local, symbol, version) ...
-# if defined SHARED
-/* When not using symbol versioning, invisible_compat_symbol
- is merely a hidden one. */
-# define invisible_compat_symbol(lib, symbol, version) \
- extern __typeof (symbol) symbol attribute_hidden;
-# endif
-
#endif
Index: include/libc-symbols.h
===================================================================
--- include/libc-symbols.h (revision 23870)
+++ include/libc-symbols.h (working copy)
@@ -356,31 +356,10 @@
__asm__ (".symver " #real "," #name "@@" #version)
# endif
# endif
-# define versioned_weak /* nothing */
-#else /* !DO_VERSIONING */
-
+#else
# define symbol_version(real, name, version)
-# ifdef __ASSEMBLER__
-# define default_symbol_version(real, name, version) \
- strong_alias (real, name)
-# else
-/* We can't use simple strong_alias in C here due to
- symbols defined with hidden_def and company.
- As you see above, symbol versions are output in plain assembly,
- so, to archieve the same effect, we use __asm__ (#name).
-
- Define an alias to REAL with C name __FI_##NAME and
- asm name NAME. We use __FI_* namespace to fill a gap
- between __EI_* and __GI_* namespaces. */
-# define default_symbol_version(real, name, version) \
- extern __typeof (real) __FI_##name __asm__ (#name); \
- extern __typeof (real) __FI_##name __attribute__((alias (#real)))
-# endif
-/* When not using symbol versioning we use an equivalent of
- strong_alias to define a symbol; hence add __attribute__((weak))
- to make it weak instead. When using .symver, this is not necessary
- as .symver handles weakness properly. */
-# define versioned_weak __attribute__((weak))
+# define default_symbol_version(real, name, version) \
+ strong_alias(real, name)
#endif
#if defined SHARED || defined LIBC_NONSHARED
@@ -487,7 +466,7 @@
versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
libc_hidden_ver (__real_foo, foo) */
-#if defined SHARED && !defined NO_HIDDEN
+#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
# ifndef __ASSEMBLER__
# define __hidden_proto_hiddenattr(attrs...) \
__attribute__ ((visibility ("hidden"), ##attrs))
Index: sysdeps/powerpc/longjmp.c
===================================================================
--- sysdeps/powerpc/longjmp.c (revision 23870)
+++ sysdeps/powerpc/longjmp.c (working copy)
@@ -55,6 +55,6 @@
default_symbol_version (__vmx__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE);
default_symbol_version (__vmx__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE);
-default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4) versioned_weak;
-default_symbol_version (__vmxlongjmp, longjmp, GLIBC_2.3.4) versioned_weak;
-default_symbol_version (__vmxsiglongjmp, siglongjmp, GLIBC_2.3.4) versioned_weak;
+default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4);
+default_symbol_version (__vmxlongjmp, longjmp, GLIBC_2.3.4);
+default_symbol_version (__vmxsiglongjmp, siglongjmp, GLIBC_2.3.4);
Index: sysdeps/powerpc/powerpc32/dl-machine.c
===================================================================
--- sysdeps/powerpc/powerpc32/dl-machine.c (revision 23870)
+++ sysdeps/powerpc/powerpc32/dl-machine.c (working copy)
@@ -32,10 +32,9 @@
/* Because ld.so is now versioned, these functions can be in their own file;
no relocations need to be done to call them.
Of course, if ld.so is not versioned... */
-/* eglibc: This does work without symbol versioning.
#if defined SHARED && !(DO_VERSIONING - 0)
#error This will not work with versioning turned off, sorry.
-#endif */
+#endif
/* Stuff for the PLT. */
Index: sysdeps/wordsize-32/divdi3.c
===================================================================
--- sysdeps/wordsize-32/divdi3.c (revision 23870)
+++ sysdeps/wordsize-32/divdi3.c (working copy)
@@ -333,10 +333,10 @@
/* We declare these with compat_symbol so that they are not visible at
link time. Programs must use the functions from libgcc. */
-#if defined SHARED
+#if defined SHARED && defined DO_VERSIONING
# include <shlib-compat.h>
-invisible_compat_symbol (libc, __divdi3, GLIBC_2_0);
-invisible_compat_symbol (libc, __moddi3, GLIBC_2_0);
-invisible_compat_symbol (libc, __udivdi3, GLIBC_2_0);
-invisible_compat_symbol (libc, __umoddi3, GLIBC_2_0);
+compat_symbol (libc, __divdi3, __divdi3, GLIBC_2_0);
+compat_symbol (libc, __moddi3, __moddi3, GLIBC_2_0);
+compat_symbol (libc, __udivdi3, __udivdi3, GLIBC_2_0);
+compat_symbol (libc, __umoddi3, __umoddi3, GLIBC_2_0);
#endif
Index: sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
===================================================================
--- sysdeps/ieee754/ldbl-128ibm/s_isinfl.c (revision 23870)
+++ sysdeps/ieee754/ldbl-128ibm/s_isinfl.c (working copy)
@@ -31,5 +31,5 @@
#ifndef IS_IN_libm
weak_alias (___isinfl, ____isinfl)
long_double_symbol (libc, ___isinfl, isinfl);
-long_double_symbol (libc, ____isinfl, __isinfl) versioned_weak;
+long_double_symbol (libc, ____isinfl, __isinfl);
#endif
Index: sysdeps/ieee754/ldbl-128ibm/s_finitel.c
===================================================================
--- sysdeps/ieee754/ldbl-128ibm/s_finitel.c (revision 23870)
+++ sysdeps/ieee754/ldbl-128ibm/s_finitel.c (working copy)
@@ -37,9 +37,9 @@
hidden_ver (___finitel, __finitel)
weak_alias (___finitel, ____finitel)
#ifdef IS_IN_libm
-long_double_symbol (libm, ____finitel, finitel) versioned_weak;
+long_double_symbol (libm, ____finitel, finitel);
long_double_symbol (libm, ___finitel, __finitel);
#else
-long_double_symbol (libc, ____finitel, finitel) versioned_weak;
+long_double_symbol (libc, ____finitel, finitel);
long_double_symbol (libc, ___finitel, __finitel);
#endif
Index: sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
===================================================================
--- sysdeps/ieee754/ldbl-128ibm/s_isnanl.c (revision 23870)
+++ sysdeps/ieee754/ldbl-128ibm/s_isnanl.c (working copy)
@@ -40,5 +40,5 @@
#ifndef IS_IN_libm
weak_alias (___isnanl, ____isnanl)
long_double_symbol (libc, ___isnanl, isnanl);
-long_double_symbol (libc, ____isnanl, __isnanl) versioned_weak;
+long_double_symbol (libc, ____isnanl, __isnanl);
#endif
Index: sysdeps/ieee754/ldbl-128ibm/strtold_l.c
===================================================================
--- sysdeps/ieee754/ldbl-128ibm/strtold_l.c (revision 23870)
+++ sysdeps/ieee754/ldbl-128ibm/strtold_l.c (working copy)
@@ -57,11 +57,11 @@
# include <math_ldbl_opt.h>
# ifdef USE_WIDE_CHAR
weak_alias (____new_wcstold_l, ___new_wcstold_l);
-long_double_symbol (libc, ___new_wcstold_l, wcstold_l) versioned_weak;
+long_double_symbol (libc, ___new_wcstold_l, wcstold_l);
long_double_symbol (libc, ____new_wcstold_l, __wcstold_l);
# else
weak_alias (____new_strtold_l, ___new_strtold_l);
-long_double_symbol (libc, ___new_strtold_l, strtold_l) versioned_weak;
+long_double_symbol (libc, ___new_strtold_l, strtold_l);
long_double_symbol (libc, ____new_strtold_l, __strtold_l);
# endif
#endif
Index: sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
===================================================================
--- sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h (revision 23870)
+++ sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h (working copy)
@@ -10,15 +10,14 @@
SHLIB_COMPAT(lib, introduced, LONG_DOUBLE_COMPAT_VERSION)
#define long_double_symbol(lib, local, symbol) \
long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION)
-#if defined SHARED
+#if defined SHARED && defined DO_VERSIONING
# define ldbl_hidden_def(local, name) libc_hidden_ver (local, name)
# define ldbl_strong_alias(name, aliasname) \
strong_alias (name, __GL_##name##_##aliasname) \
long_double_symbol (libc, __GL_##name##_##aliasname, aliasname);
# define ldbl_weak_alias(name, aliasname) \
- weak_alias (name, __GL_##name##_##aliasname) \
- long_double_symbol (libc, __GL_##name##_##aliasname, aliasname) \
- versioned_weak;
+ weak_alias (name, __GL_##name##_##aliasname) \
+ long_double_symbol (libc, __GL_##name##_##aliasname, aliasname);
# define long_double_symbol_1(lib, local, symbol, version) \
versioned_symbol (lib, local, symbol, version)
#else
Index: extra-lib.mk
===================================================================
--- extra-lib.mk (revision 23870)
+++ extra-lib.mk (working copy)
@@ -92,13 +92,13 @@
$(build-extra-lib)
endif
-# eglibc: ifeq ($(versioning),yes)
+ifeq ($(versioning),yes)
# Add the version script to the dependencies of the shared library.
$(objpfx)$(lib).so: $(firstword $($(lib)-map) \
$(addprefix $(common-objpfx), \
$(filter $(lib).map, \
$(version-maps))))
-# eglibc: endif
+endif
endif
Index: nptl/Makefile
===================================================================
--- nptl/Makefile (revision 23870)
+++ nptl/Makefile (working copy)
@@ -303,13 +303,8 @@
tst-oncex3 tst-oncex4
endif
ifeq ($(build-shared),yes)
-tests += tst-atfork2 tst-tls3 tst-tls4 tst-tls5 tst-fini1 \
+tests += tst-atfork2 tst-tls3 tst-tls4 tst-tls5 tst-_res1 tst-fini1 \
tst-stackguard1
-ifeq ($(versioning),yes)
-# struct __res_state _res is only available with
-# symbol versioning after GLIBC_2.2.
-tests += tst-_res1
-endif
tests-nolibpthread += tst-fini1
ifeq ($(have-z-execstack),yes)
tests += tst-execstack
Index: nptl/pthread_kill_other_threads.c
===================================================================
--- nptl/pthread_kill_other_threads.c (revision 23870)
+++ nptl/pthread_kill_other_threads.c (working copy)
@@ -31,8 +31,6 @@
__pthread_kill_other_threads_np (void)
{
}
-# ifdef DO_VERSIONING
compat_symbol (libpthread, __pthread_kill_other_threads_np,
pthread_kill_other_threads_np, GLIBC_2_0);
-# endif
#endif
--
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches