123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- diff -Naurp dietlibc-0.33.20120825/diet.c~ dietlibc-0.33.20120825/diet.c
- --- diet.c~ 2013-11-03 18:56:45.416768005 +0100
- +++ diet.c 2013-11-03 18:59:06.785762840 +0100
- @@ -71,6 +71,7 @@ int main(int argc,char *argv[]) {
- int shared=0;
- #endif
- char* shortplatform=0;
- + char* shortplatform32=0;
- #ifdef WANT_SAFEGUARD
- char safeguard1[]="-include";
- char* safeguard2;
- @@ -187,11 +188,26 @@ int main(int argc,char *argv[]) {
- shortplatform="parisc";
- #endif
- #ifdef __x86_64__
- - shortplatform=(m==32?"i386":(m==33?"x32":"x86_64"));
- + shortplatform="x86_64";
- + shortplatform32="i386";
- #endif
- #ifdef __ia64__
- shortplatform="ia64";
- #endif
- + /* Check for -m32 on biarch platforms */
- + /* NOTE: though it's wrong to pass both -m32/-m64 flags to
- + * gcc at once, we pick up the last one only */
- + if (shortplatform32) {
- + int i, m64=1;
- + for (i=0; i<argc; ++i) {
- + if (!strcmp(argv[i],"-m32"))
- + m64=0;
- + else if (!strcmp(argv[i],"-m64"))
- + m64=1;
- + }
- + if (!m64)
- + shortplatform=shortplatform32;
- + }
- {
- char *tmp=platform+strlen(platform);
- strcpy(tmp,shortplatform);
- diff -Naurp dietlibc-0.33.20120825/Makefile~ dietlibc-0.33.20120825/Makefile
- --- Makefile~ 2013-11-03 19:10:57.392736875 +0100
- +++ Makefile 2013-11-03 19:15:01.344727962 +0100
- @@ -56,6 +56,7 @@ MYARCH=parisc
- else
- ifeq ($(MYARCH),x86_64)
- ARCH=x86_64
- +ARCH32=i386
- else
- ifeq ($(MYARCH),ia64)
- ARCH=ia64
- @@ -88,15 +89,22 @@ ILIBDIR=$(LIBDIR)-$(ARCH)
-
- HOME=$(shell pwd)
-
- -WHAT= $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o \
- +LIBS= $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o \
- $(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a \
- $(OBJDIR)/libcompat.a $(OBJDIR)/libm.a \
- $(OBJDIR)/librpc.a $(OBJDIR)/libpthread.a \
- - $(OBJDIR)/libcrypt.a \
- - $(OBJDIR)/diet $(OBJDIR)/diet-i $(OBJDIR)/elftrunc \
- - $(OBJDIR)/dnsd
- + $(OBJDIR)/libcrypt.a
-
- -all: $(WHAT)
- +all: all_32 libs $(OBJDIR)/diet $(OBJDIR)/diet-i
- +
- +libs: $(LIBS)
- +
- +ifeq (,$(ARCH32))
- +all_32:
- +else
- +all_32:
- + $(MAKE) MYARCH=$(ARCH32) CC="$(CC) -m32" libs
- +endif
-
- profiling: $(OBJDIR)/libgmon.a $(OBJDIR)/pstart.o
-
- @@ -363,17 +371,19 @@ t:
- t1:
- $(CROSS)$(CC) -g -o t1 t.c
-
- -install-bin: $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/librpc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(OBJDIR)/elftrunc $(OBJDIR)/diet-i
- - $(INSTALL) -d $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
- +install-lib: $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/librpc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a
- + $(INSTALL) -d $(DESTDIR)$(ILIBDIR)
- $(INSTALL) $(OBJDIR)/start.o $(DESTDIR)$(ILIBDIR)/start.o
- $(INSTALL) -m 644 $(OBJDIR)/libm.a $(OBJDIR)/libpthread.a $(OBJDIR)/librpc.a \
- $(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(OBJDIR)/libcrypt.a $(DESTDIR)$(ILIBDIR)
- $(INSTALL) -m 644 $(OBJDIR)/dietlibc.a $(DESTDIR)$(ILIBDIR)/libc.a
- +
- +install-bin: $(OBJDIR)/diet-i
- + $(INSTALL) -d $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
- ifeq ($(MYARCH),$(ARCH))
- $(INSTALL) $(OBJDIR)/diet-i $(DESTDIR)$(BINDIR)/diet
- -$(INSTALL) $(PICODIR)/diet-dyn-i $(DESTDIR)$(BINDIR)/diet-dyn
- endif
- - $(INSTALL) -m 755 $(OBJDIR)/elftrunc $(OBJDIR)/dnsd $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 644 diet.1 $(DESTDIR)$(MAN1DIR)/diet.1
-
- install-profiling:
- @@ -393,8 +403,14 @@ install-pic:
- install-headers:
- for i in `find include -name \*.h`; do install -m 644 -D $$i $(DESTDIR)$(prefix)/$$i; done
-
- +ifeq (,$(ARCH32))
- +install-32:
- +else
- +install-32:
- + $(MAKE) MYARCH=$(ARCH32) CC="$(CC) -m32" install-lib
- +endif
-
- -install: install-bin install-profiling install-pic install-headers
- +install: install-32 install-lib install-bin install-profiling install-pic install-headers
-
- uninstall:
- for i in start.o libm.a libpthread.a librpc.a liblatin1.a libcompat.a libcrypt.a libc.a; do rm -f $(DESTDIR)$(ILIBDIR)/$$i; done
|