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