This is the mail archive of the
mailing list for the glibc project.
Re: How are CPU-optimized libraries supposed to work?
On Fri, Oct 03, 2003 at 12:07:52PM -0700, Roland McGrath wrote:
> > Then why do we search CPU-optimized directories at all, if we don't
> > support using the same sources built with different options?
> The feature is there for finding all libraries, not just for libc.
> Having some mismatch ld+libc cases work is worthwhile. We have taken
> special pains to make __thread vs no-__thread combinations work, for
> example. Making i386 vs i686 work is worthwhile too. But there is no
> generic principle by which you should expect this to already have worked,
> or consider it a bug per se if it doesn't. Any such support is a special case.
Thanks, I understand now.
In any case here's a patch to make i686 libraries work with an i386
ld.so again. Results look pretty good so far.
MontaVista Software Debian GNU/Linux Developer
2003-10-03 Daniel Jacobowitz <firstname.lastname@example.org>
* sysdeps/generic/ldsodefs.h (struct rtld_global): Include timing
members if HP_TIMING_PAD is defined.
* sysdeps/i386/hp-timing.h: New file.
--- glibc-2.3.2/sysdeps/generic/ldsodefs.h.orig 2003-10-03 11:47:45.000000000 -0400
+++ glibc-2.3.2/sysdeps/generic/ldsodefs.h 2003-10-03 11:48:10.000000000 -0400
@@ -292,7 +292,7 @@ struct rtld_global
/* The object to be initialized first. */
EXTERN struct link_map *_dl_initfirst;
-#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
+#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL || HP_TIMING_PAD
/* Start time on CPU clock. */
EXTERN hp_timing_t _dl_cpuclock_offset;
--- /dev/null 1969-12-31 19:00:00.000000000 -0500
+++ glibc-2.3.2/sysdeps/i386/hp-timing.h 2003-10-03 11:50:30.000000000 -0400
@@ -0,0 +1,34 @@
+/* High precision, low overhead timing functions. i386 version.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#define _i386_HP_TIMING_H 1
+#define hp_timing_t hp_timing_t__
+/* We don't use high-precision timers, but we might load an i686 libpthread
+ which does. */
+#define HP_TIMING_PAD 1
+/* i686 uses 64bit values for the times. */
+typedef unsigned long long int hp_timing_t;
+#endif /* hp-timing.h */