This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Per-machine additions to CFLAGS-rtld.c being overridden.


Siddhesh,

On hppa I started having crashes in the dynamic linker after updating
all my patches to a recent master.

With the help of Guy Martin we tracked it down this change:

elf/Makefile
73d65cc3 (Siddhesh Poyarekar 2012-04-04 20:09:09 +0530 430) CFLAGS-rtld.c = $(SYSCONF-FLAGS)

Which overrides flags set by per-machine Makefiles.

On hppa we must disable fpregs in the loader because the use of
those registers may require relocations that need the PIC
register to have a valid value and we might not have set it up yet.

e.g.

ports/sysdeps/hppa/Makefile
...
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -mdisable-fpregs
...

Now hppa isn't the only arch with overrides for CFLAGS-rtld.c,
there are several others, but none of those flags are as critical
as the one for hppa.

A quick fix is:
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

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]