[uClibc-cvs] uClibc Makefile,1.200,1.201 Rules.mak,1.129,1.130
David McCullough
davidm at uclibc.org
Mon Feb 17 13:03:25 UTC 2003
Update of /var/cvs/uClibc
In directory winder:/tmp/cvs-serv8408
Modified Files:
Makefile Rules.mak
Log Message:
updates to the uClinux-dist romfs and uClinux shared library targets.
Index: Makefile
===================================================================
RCS file: /var/cvs/uClibc/Makefile,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- Makefile 11 Feb 2003 08:16:52 -0000 1.200
+++ Makefile 17 Feb 2003 13:03:21 -0000 1.201
@@ -41,7 +41,8 @@
# In this section, we need .config
-include .config.cmd
-shared:
+.PHONY: $(SHARED_TARGET)
+shared: $(SHARED_TARGET)
ifeq ($(strip $(HAVE_SHARED)),y)
@$(MAKE) -C libc shared
@$(MAKE) -C ldso shared
@@ -52,10 +53,31 @@
@$(MAKE) -C libm shared
@$(MAKE) -C libpthread shared
else
+ifeq ($(SHARED_TARGET),)
@echo
@echo Not building shared libraries...
@echo
endif
+endif
+
+ifneq ($(SHARED_TARGET),)
+
+lib/main.o: $(ROOTDIR)/lib/libc/main.c
+ $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c -o $@ $(ROOTDIR)/lib/libc/main.c
+
+bogus $(SHARED_TARGET): lib/libc.a lib/main.o
+ make -C $(ROOTDIR) relink
+ $(CC) -o $(SHARED_TARGET) $(ARCH_CFLAGS) -Wl,-elf2flt -nostdlib \
+ -Wl,-shared-lib-id,${LIBID} \
+ lib/main.o -Wl,--whole-archive,lib/libc.a,-lgcc,--no-whole-archive
+ $(OBJCOPY) -L _GLOBAL_OFFSET_TABLE_ -L main -L __main -L _start \
+ -L __uClibc_main -L lib_main -L _exit_dummy_ref \
+ -L __do_global_dtors -L __do_global_ctors \
+ -L __CTOR_LIST__ -L __DTOR_LIST__ \
+ -L _current_shared_library_a5_offset_ \
+ $(SHARED_TARGET).gdb
+ ln -sf $(SHARED_TARGET).gdb .
+endif
finished: shared
@echo
@@ -65,16 +87,24 @@
#
# Target for uClinux distro
#
+.PHONY: romfs
romfs:
+ @if [ "$(CONFIG_BINFMT_SHARED_FLAT)" = "y" ]; then \
+ [ -e $(ROMFSDIR)/lib ] || mkdir -p $(ROMFSDIR)/lib; \
+ $(ROMFSINST) $(SHARED_TARGET) /lib/lib$(LIBID).so; \
+ fi
ifeq ($(strip $(HAVE_SHARED)),y)
install -d $(ROMFSDIR)/lib
install -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
$(ROMFSDIR)/lib
- cp -a lib/*.so.* $(ROMFSDIR)/lib
+ cp -fa lib/*.so.* $(ROMFSDIR)/lib/.
@if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
set -x -e; \
install -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
$(ROMFSDIR)/lib; \
+ $(ROMFSINST) -s \
+ /lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
+ /lib/ld-linux.so.2; \
fi;
endif
@@ -148,7 +178,7 @@
@cd $(TOPDIR); \
set -x -e; \
rm -f include/bits/sysnum.h; \
- TOPDIR=. CC=$(CC) /bin/sh extra/scripts/gen_bits_syscall_h.sh > include/bits/sysnum.h
+ TOPDIR=. CC="$(CC)" /bin/sh extra/scripts/gen_bits_syscall_h.sh > include/bits/sysnum.h
$(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) headers
subdirs: $(patsubst %, _dir_%, $(DIRS))
Index: Rules.mak
===================================================================
RCS file: /var/cvs/uClibc/Rules.mak,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- Rules.mak 15 Feb 2003 21:17:10 -0000 1.129
+++ Rules.mak 17 Feb 2003 13:03:21 -0000 1.130
@@ -34,7 +34,9 @@
# make CROSS=mipsel-linux-
# will build uClibc for 'mipsel'.
+ifndef CROSS
CROSS=
+endif
CC= $(CROSS)gcc
AR= $(CROSS)ar
LD= $(CROSS)ld
@@ -223,4 +225,17 @@
# information go if you enabled LIBRARY_CACHE above>
# Very few people will need to change this value from the default...
TARGET_PREFIX = /
+
+########################################
+#
+# uClinux shared lib support
+#
+
+ifdef CONFIG_BINFMT_SHARED_FLAT
+ # For the shared version of this, we specify no stack and its library ID
+ FLTFLAGS += -s 0
+ LIBID=1
+ export LIBID FLTFLAGS
+ SHARED_TARGET = lib/libc
+endif
More information about the uClibc-cvs
mailing list