This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Per-machine additions to CFLAGS-rtld.c being overridden.
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "Carlos O'Donell" <codonell at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Guy Martin <gmsoft at tuxicoman dot be>, Roland McGrath <roland at hack dot frob dot com>
- Date: Tue, 8 Jan 2013 23:07:53 +0530
- Subject: Re: Per-machine additions to CFLAGS-rtld.c being overridden.
- References: <50EC4D90.1030708@redhat.com>
On Tue, Jan 08, 2013 at 11:47:12AM -0500, Carlos O'Donell wrote:
> diff --git a/elf/Makefile b/elf/Makefile
> index 0d52318..4bee681 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -427,7 +427,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
> -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
> CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
> CFLAGS-cache.c = $(SYSCONF-FLAGS)
> -CFLAGS-rtld.c = $(SYSCONF-FLAGS)
> +CFLAGS-rtld.c += $(SYSCONF-FLAGS)
>
> CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
> -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
> ---
>
> However, this seems like a huge hack.
>
> What's the real problem here?
>
> Is this sysdep ordering come back to bite us again?
>
> Guy has filed BZ#15005 to track this.
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=15005
It depends on where Makeconfig is included in the module makefile and
in this case, it is included before those variables are set.
Makeconfig includes the sysdep makefiles and hence the generic
definitions override the arch-specific ones. In nptl Makeconfig is
included somewhere in the middle.
For this bug, something on the lines of the following would be more
appropriate:
CFLAGS-rtld.c = $(SYSCONF-FLAGS) $(CFLAGS-rtld.c)
so that the sysdeps overrides are appended rather than prepended.
That way the sysdeps flags have a chance to override whatever is set
by the generic Makefile.
As a long term fix however, we need to agree on where Makeconfig gets
included in the Makefile and stick to that order in all modules. I
vote for keeping it near the end so that the sysdeps override/append
to the generic options rather than the other way around.
Siddhesh