public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* unit-at-a-time fixes
@ 2003-11-30 19:43 Andreas Jaeger
  2003-11-30 20:11 ` Andreas Jaeger
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andreas Jaeger @ 2003-11-30 19:43 UTC (permalink / raw)
  To: GNU libc hacker

[-- Attachment #1: Type: text/plain, Size: 4099 bytes --]


With GCC 3.4 and also the hammer-branch of GCC 3.3, unit-at-a-time
compilation is enabled and rearranges the output order of functions.
This is not desirable in some cases.

Here's the patch that we're currently using at SuSE.  Ok to commit?

Andreas

2003-11-30  Andreas Jaeger  <aj@suse.de>

	* csu/Makefile (CFLAGS-initfini.s): Add -fno-unit-at-a-time.
	* linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
	(CFLAGS-pt-initfini.s): Likewise.
	* locale/Makefile (CFLAGS-loadlocale.c): Likewise.

For linuxthreads:
	* Makefile (CFLAGS-tst-cancel.c): Add -fno-unit-at-a-time.
	(CFLAGS-pt-initfini.s): Likewise.

For nptl:
	* Makefile (CFLAGS-pt-initfini.s): Add -fno-unit-at-a-time.

============================================================
Index: csu/Makefile
--- csu/Makefile	26 Jun 2003 07:27:39 -0000	1.70
+++ csu/Makefile	18 Jul 2003 05:27:14 -0000
@@ -104,7 +104,7 @@ omit-deps += $(crtstuff)
 $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h
 	$(compile.S) -g0 $(ASFLAGS-.os) -o $@
 
-CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions
+CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time
 
 vpath initfini.c $(full_config_sysdirs)
 
============================================================
Index: linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
--- linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile	11 Apr 2003 23:34:02 -0000	1.5
+++ linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile	18 Jul 2003 05:27:14 -0000
@@ -1,3 +1,3 @@
 ifeq ($(subdir),linuxthreads)
-CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables
+CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables  -fno-unit-at-a-time
 endif
============================================================
Index: linuxthreads/Makefile
--- linuxthreads/Makefile	10 Jun 2003 02:19:43 -0000	1.77
+++ linuxthreads/Makefile	18 Jul 2003 05:27:14 -0000
@@ -66,7 +66,7 @@ LDFLAGS-pthread.so = $(nodelete-$(have-z
 vpath %.c Examples
 
 tst-cancel-ARGS = "$(objpfx)"
-CFLAGS-tst-cancel.c = -fno-inline -fno-inline-functions
+CFLAGS-tst-cancel.c = -fno-inline -fno-inline-functions -fno-unit-at-a-time
 
 include ../Makeconfig
 
@@ -99,7 +99,7 @@ endif
 extra-objs += $(crti-objs) $(crtn-objs)
 omit-deps += crti crtn
 
-CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
+CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time
 endif
 
 librt-tests = ex10 ex11


============================================================
Index: locale/Makefile
--- locale/Makefile	13 Jun 2003 20:42:48 -0000	1.71
+++ locale/Makefile	28 Jul 2003 10:45:07 -0000
@@ -100,6 +100,7 @@ locale-CPPFLAGS := -DLOCALE_PATH='$(loca
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
+CFLAGS-loadlocale.c = -fno-unit-at-a-time
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \

--- nptl/Makefile	6 Nov 2003 09:47:37 -0000	1.124
+++ nptl/Makefile	18 Nov 2003 20:30:23 -0000
@@ -312,7 +312,7 @@
 extra-objs += $(crti-objs) $(crtn-objs)
 omit-deps += crti crtn
 
-CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
+CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time
 endif
 
 CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
--- nptl/sysdeps/unix/sysv/linux/x86_64/Makefile	9 May 2003 07:29:09 -0000	1.3
+++ nptl/sysdeps/unix/sysv/linux/x86_64/Makefile	18 Nov 2003 20:30:23 -0000
@@ -1,3 +1,3 @@
 ifeq ($(subdir),nptl)
-CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables
+CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables -fno-unit-at-a-time
 endif

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
  2003-11-30 19:43 unit-at-a-time fixes Andreas Jaeger
@ 2003-11-30 20:11 ` Andreas Jaeger
  2003-11-30 20:50 ` Jakub Jelinek
       [not found] ` <u8u14l352k.fsf@gromit.moeb>
  2 siblings, 0 replies; 7+ messages in thread
From: Andreas Jaeger @ 2003-11-30 20:11 UTC (permalink / raw)
  To: GNU libc hacker

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

Andreas Jaeger <aj@suse.de> writes:

> With GCC 3.4 and also the hammer-branch of GCC 3.3, unit-at-a-time
> compilation is enabled and rearranges the output order of functions.
> This is not desirable in some cases.
>
> Here's the patch that we're currently using at SuSE.  Ok to commit?
>
> Andreas
>
> 2003-11-30  Andreas Jaeger  <aj@suse.de>
>
> 	* csu/Makefile (CFLAGS-initfini.s): Add -fno-unit-at-a-time.
> 	* linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
> 	(CFLAGS-pt-initfini.s): Likewise.
> 	* locale/Makefile (CFLAGS-loadlocale.c): Likewise.

There're two entries missing:

>
> For linuxthreads:
> 	* Makefile (CFLAGS-tst-cancel.c): Add -fno-unit-at-a-time.
> 	(CFLAGS-pt-initfini.s): Likewise.
        * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s): 
        Likewise.

> For nptl:
> 	* Makefile (CFLAGS-pt-initfini.s): Add -fno-unit-at-a-time.
        * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s): 
        Likewise.



Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
  2003-11-30 19:43 unit-at-a-time fixes Andreas Jaeger
  2003-11-30 20:11 ` Andreas Jaeger
@ 2003-11-30 20:50 ` Jakub Jelinek
  2003-11-30 21:43   ` Andreas Jaeger
       [not found] ` <u8u14l352k.fsf@gromit.moeb>
  2 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2003-11-30 20:50 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: GNU libc hacker

On Sun, Nov 30, 2003 at 08:38:19PM +0100, Andreas Jaeger wrote:
> 
> With GCC 3.4 and also the hammer-branch of GCC 3.3, unit-at-a-time
> compilation is enabled and rearranges the output order of functions.
> This is not desirable in some cases.
> 
> Here's the patch that we're currently using at SuSE.  Ok to commit?

As long as GCC 3.2.x and 3.3.x are supported to build glibc, this patch is
wrong, since these compilers have no -fno-unit-at-a-time switch.
You should add a configure check for that switch and add
$(fno-unit-at-a-time) to the makefiles instead.

	Jakub

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
  2003-11-30 20:50 ` Jakub Jelinek
@ 2003-11-30 21:43   ` Andreas Jaeger
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Jaeger @ 2003-11-30 21:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: GNU libc hacker

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

Jakub Jelinek <jakub@redhat.com> writes:

> On Sun, Nov 30, 2003 at 08:38:19PM +0100, Andreas Jaeger wrote:
>> 
>> With GCC 3.4 and also the hammer-branch of GCC 3.3, unit-at-a-time
>> compilation is enabled and rearranges the output order of functions.
>> This is not desirable in some cases.
>> 
>> Here's the patch that we're currently using at SuSE.  Ok to commit?
>
> As long as GCC 3.2.x and 3.3.x are supported to build glibc, this patch is
> wrong, since these compilers have no -fno-unit-at-a-time switch.

Argh.  You're right.

> You should add a configure check for that switch and add
> $(fno-unit-at-a-time) to the makefiles instead.

OK, will do tomorrow,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
       [not found] ` <u8u14l352k.fsf@gromit.moeb>
@ 2003-12-01 10:07   ` Andreas Schwab
  2003-12-01 16:57     ` Andreas Jaeger
  2003-12-02  6:41   ` Ulrich Drepper
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2003-12-01 10:07 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: GNU libc hacker

Andreas Jaeger <aj@suse.de> writes:

> @@ -1371,6 +1372,36 @@ EOF
>  
>    AC_SUBST(libc_cv_fpie)
>  fi
> +
> +if test $elf != yes; then
> +  AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
> +		 [AC_TRY_COMPILE(, [asm (".section .init");
> +				    asm (".section .fini");
> +				    asm ("${libc_cv_dot_text}");],
> +				 libc_cv_have_initfini=yes,
> +				 libc_cv_have_initfini=no)])
> +  AC_SUBST(libc_cv_have_initfini)dnl
> +  if test $libc_cv_have_initfini = yes; then
> +    AC_DEFINE(HAVE_INITFINI)
> +  fi
> +fi

This looks bogus.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
  2003-12-01 10:07   ` Andreas Schwab
@ 2003-12-01 16:57     ` Andreas Jaeger
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Jaeger @ 2003-12-01 16:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GNU libc hacker

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

Andreas Schwab <schwab@suse.de> writes:

> Andreas Jaeger <aj@suse.de> writes:
>
>> @@ -1371,6 +1372,36 @@ EOF
>>  
>>    AC_SUBST(libc_cv_fpie)
>>  fi
>> +
>> +if test $elf != yes; then
>> +  AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
>> +		 [AC_TRY_COMPILE(, [asm (".section .init");
>> +				    asm (".section .fini");
>> +				    asm ("${libc_cv_dot_text}");],
>> +				 libc_cv_have_initfini=yes,
>> +				 libc_cv_have_initfini=no)])
>> +  AC_SUBST(libc_cv_have_initfini)dnl
>> +  if test $libc_cv_have_initfini = yes; then
>> +    AC_DEFINE(HAVE_INITFINI)
>> +  fi
>> +fi
>
> This looks bogus.

You're right - this part should be removed, I seemed to have copied
too much :-(

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: unit-at-a-time fixes
       [not found] ` <u8u14l352k.fsf@gromit.moeb>
  2003-12-01 10:07   ` Andreas Schwab
@ 2003-12-02  6:41   ` Ulrich Drepper
  1 sibling, 0 replies; 7+ messages in thread
From: Ulrich Drepper @ 2003-12-02  6:41 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: GNU libc hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Jaeger wrote:
> Here's an updated patch following Jakub's suggestion.

Remove the bogus configure.in part and you can apply it.

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zDPe2ijCOnn/RHQRAsxKAJwJ93njDEmHEqUa8kWej57o1ZLo8wCghJGU
0rDFMoI884nyCchnB1+xthI=
=1Ua3
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-02  6:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-30 19:43 unit-at-a-time fixes Andreas Jaeger
2003-11-30 20:11 ` Andreas Jaeger
2003-11-30 20:50 ` Jakub Jelinek
2003-11-30 21:43   ` Andreas Jaeger
     [not found] ` <u8u14l352k.fsf@gromit.moeb>
2003-12-01 10:07   ` Andreas Schwab
2003-12-01 16:57     ` Andreas Jaeger
2003-12-02  6:41   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).