patches/libfloat/990616/200-cross_compile.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
yann@1
     1
When linking, call directly ld in place of the gcc wrapper, because the wrapper
yann@1
     2
will try to link with -lfloat, which we don't have right now...
yann@1
     3
yann@1
     4
Simplify CFLAGS to stay ABI compliant (ot so I guess)...
yann@1
     5
yann@1
     6
diff -dur libfloat.orig/Makefile libfloat/Makefile
yann@1
     7
--- libfloat.orig/Makefile	2007-02-16 19:38:55.000000000 +0100
yann@1
     8
+++ libfloat/Makefile	2007-02-16 19:46:23.000000000 +0100
yann@1
     9
@@ -1,8 +1,11 @@
yann@1
    10
 # Makefile for the Linux soft-float library
yann@1
    11
 
yann@1
    12
-CC=gcc -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
yann@1
    13
-#CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
yann@1
    14
-AR=ar
yann@1
    15
+AR=$(CROSS_COMPILE)ar
yann@1
    16
+#CFLAGS=-O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
yann@1
    17
+CFLAGS=-O2 -D__LIBFLOAT__
yann@1
    18
+CC=$(CROSS_COMPILE)gcc 
yann@1
    19
+LDFLAGS=-shared -nostdlib
yann@1
    20
+LD=$(CROSS_COMPILE)ld
yann@1
    21
 
yann@1
    22
 all: libfloat.a libfloat.so.1
yann@1
    23
 
yann@1
    24
@@ -12,28 +13,31 @@
yann@1
    25
 
yann@1
    26
 libfloat.so.1: softfloat.os fplib_glue.os
yann@1
    27
 	rm -f libfloat.so.1
yann@1
    28
-	gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
yann@1
    29
+	$(LD) $(LDFLAGS) -soname=libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
yann@1
    30
 
yann@1
    31
 softfloat.o: softfloat/bits64/softfloat.c
yann@1
    32
-	$(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
yann@1
    33
+	$(CC) $(CFLAGS) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
yann@1
    34
 
yann@1
    35
 fplib_glue.o: fplib_glue.S
yann@1
    36
-	$(CC) -c -o fplib_glue.o fplib_glue.S
yann@1
    37
+	$(CC) $(CFLAGS) -c -o fplib_glue.o fplib_glue.S
yann@1
    38
 
yann@1
    39
 softfloat.os: softfloat/bits64/softfloat.c
yann@1
    40
-	$(CC) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
yann@1
    41
+	$(CC) $(CFLAGS) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
yann@1
    42
 
yann@1
    43
 fplib_glue.os: fplib_glue.S
yann@1
    44
-	$(CC) -fpic -c -o fplib_glue.os fplib_glue.S
yann@1
    45
+	$(CC) $(CFLAGS) -fpic -c -o fplib_glue.os fplib_glue.S
yann@1
    46
 
yann@1
    47
 install: libfloat.a libfloat.so.1
yann@1
    48
-	cp -a libfloat.a $(DESTDIR)/usr/lib
yann@1
    49
-	cp -a libfloat.so.1 $(DESTDIR)/usr/lib
yann@1
    50
-	cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
yann@1
    51
+	install -d -m 755 "$(DESTDIR)/usr/lib"
yann@1
    52
+	install -m 755 libfloat.a "$(DESTDIR)/usr/lib"
yann@1
    53
+	install -m 755 libfloat.so.1 "$(DESTDIR)/usr/lib"
yann@1
    54
+	cd $(DESTDIR)/usr/lib
yann@1
    55
+	ln -s libfloat.so.1 libfloat.so
yann@1
    56
 
yann@1
    57
 clean: 
yann@1
    58
 	rm -f *.o
yann@1
    59
 	rm -f *.os
yann@1
    60
 	rm -f libfloat.a
yann@1
    61
 	rm -f libfloat.so.1
yann@1
    62
+	rm -f libfloat.so
yann@1
    63
 	rm -f *~