about summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-21 06:24:21 +0000
committerRoland McGrath <roland@gnu.org>1995-09-21 06:24:21 +0000
commit0324daa0055227fdb157b8491d4e5bbe9d9d579a (patch)
tree1cc1994ae9fa52ba09e28498b50911628f366add /Makerules
parent600927014b78e4247e36bbc554c188c7a3cca40e (diff)
downloadglibc-0324daa0055227fdb157b8491d4e5bbe9d9d579a.tar.gz
glibc-0324daa0055227fdb157b8491d4e5bbe9d9d579a.tar.xz
glibc-0324daa0055227fdb157b8491d4e5bbe9d9d579a.zip
Thu Sep 21 00:03:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* sysdeps/stub/sys/sem_buf.h (union semun): New type.

	* sysdeps/mach/hurd/i386/init-first.c (init1) [PIC]: Call
	__libc_global_ctors.
	* sysdeps/i386/init-first.c: Rewritten.
	* sysdeps/unix/sysv/linux/i386/init-first.S: File removed.
	* sysdeps/unix/sysv/linux/i386/init-first.c: New file.

	* sysdeps/unix/sysv/linux/i386/fpu_control.h: Fix name in decl of
	___fpu_control.

	* Makerules (build-shlib): New canned sequence, broken out of
	lib%.so rule.  Link in $^ instead of just $<.
	(lib%.so: lib%_pic.a): Use it.
	(libc.so): New target; use $(build-shlib) for cmds, but also depend
	on soinit.so first and sofini.so last.

	* elf/soinit.c: New file.
	* elf/sofini.c: New file.
	* elf/Makefile (distribute): Add soinit.c and sofini.c.
	(extra-objs): Add soinit.so and sofini.so.

	* sysvipc/sys/shm.h (shmat): Fix return type to char *.
	* sysdeps/stub/sys/ipc_buf.h (key_t): Type removed.

	* misc/syslog.c (vsyslog): Rewritten using open_memstream to
	dynamically allocate buffers.

	* Makerules (install-lib-nosubdir): Make this, rather than
	install-no-libc.a, depend on the installed shared libraries.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules23
1 files changed, 16 insertions, 7 deletions
diff --git a/Makerules b/Makerules
index e8904b8570..a781c43921 100644
--- a/Makerules
+++ b/Makerules
@@ -476,7 +476,7 @@ install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
 install-lib := $(filter-out %.so,$(install-lib))
 ifeq (yes,$(build-shared))
 install: $(libdir)/libc.so$(libc.so-version)
-install-no-libc.a: $(foreach so,$(install-lib.so),\
+install-lib-nosubdir: $(foreach so,$(install-lib.so),\
   $(libdir)/$(patsubst $(libprefix)lib%,lib$(libprefix)%,\
 		       $(libprefix)$(so))$($(so)-version))
 
@@ -550,12 +550,15 @@ ifeq (yes,$(build-shared))
 # build shared libraries in place from the installed *_pic.a files.
 # $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
 # on other shared objects.
-lib%.so: lib%_pic.a
-	$(LINK.o) -shared -o $@ -Wl,-soname \
-		  -Wl,lib$(libprefix)$(notdir $*).so$($(@F)-version) \
-		  $(LDFLAGS.so) $(LDFLAGS-$(notdir $*).so) \
-		  -L$(firstword $(objdir) .)  -L$(common-objpfx:%/=%) \
-		  $(LDLIBS-$(notdir $*).so) -Wl,--whole-archive $< \
+lib%.so: lib%_pic.a; $(build-shlib)
+
+define build-shlib
+$(LINK.o) -shared -o $@ -Wl,-soname \
+	  -Wl,lib$(libprefix)$(notdir $*).so$($(@F)-version) \
+	  $(LDFLAGS.so) $(LDFLAGS-$(notdir $*).so) \
+	  -L$(firstword $(objdir) .)  -L$(common-objpfx:%/=%) \
+	  -Wl,--whole-archive $^ $(LDLIBS-$(notdir $*).so)
+endef
 
 # Don't try to use -lc when making libc.so itself.
 # Also omits crti.o and crtn.o, which we do not want
@@ -563,6 +566,12 @@ lib%.so: lib%_pic.a
 LDFLAGS-c.so = -nostdlib -nostartfiles
 # Give libc.so an entry point and make it directly runnable itself.
 LDFLAGS-c.so += -Wl,-dynamic-linker -Wl,/lib/ld.so -e __libc_print_version
+# Use our own special initializer and finalizer files for libc.so.
+elfobjdir := $(firstword $(objdir) $(..)elf)
+$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
+			 $(common-objpfx)libc_pic.a \
+			 $(elfobjdir)/sofini.so
+	$(build-shlib)
 endif