patches/cygwin/1.5.15-1/100-crossbuild.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
parent 402 197e1b49586e
permissions -rw-r--r--
complibs/cloog: fix linking with libm

In Ubuntu 11.04 and 11.10, the default options for ld have changed.
--no-copy-dt-needed-entries and --as-needed are now enabled by default, which
causes errors like:

[EXTRA] Checking CLooG/ppl
[DEBUG] ==> Executing: 'make' '-j3' '-s' 'check'
[ALL ] Making check in .
[ALL ] config.status: creating include/cloog/cloog-config.h
[ALL ] config.status: include/cloog/cloog-config.h is unchanged
[ALL ] libtool: link: i686-build_pc-linux-gnu-gcc -Wall -fomit-frame-pointer
-pipe -o cloog cloog.o -L/<snip>/build/static/lib ./.libs/libcloog.a -lm
/<snip>/build/static/lib/libppl_c.a /<snip>/build/static/lib/libpwl.a
/<snip>/build/static/lib/libppl.a /<snip>/build/static/lib/libgmpxx.a
/<snip>/build/static/lib/libgmp.a -lstdc++
[ALL ] /usr/bin/ld: /<snip>/build/static/lib/libppl.a(MIP_Problem.o):
undefined reference to symbol 'sqrt@@GLIBC_2.0'
[ALL ] /usr/bin/ld: note: 'sqrt@@GLIBC_2.0' is defined in DSO
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so so try adding
it to the linker command line
[ALL ] /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so:
could not read symbols: Invalid operation
[ALL ] collect2: ld returned 1 exit status
[ERROR] make[2]: *** [cloog] Error 1
[ERROR] make[1]: *** [check-recursive] Error 1

See:
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

This patch fixes these errors by placing '-lm' at the right place on the command
line as libppl requires libm when linking cloog.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
     1 Message-ID: <4269173F.7020705@zee2.com>
     2 Date: Fri, 22 Apr 2005 16:24:47 +0100
     3 From: Steve Papacharalambous <stevep@zee2.com>
     4 To: "Robert P. J. Day" <rpjday@mindspring.com>
     5 CC: crossgcc list <crossgcc@sources.redhat.com>
     6 Subject: Re: cygwin source directory has moved
     7 In-Reply-To: <Pine.LNX.4.61.0504181746050.11794@localhost.localdomain>
     8 
     9 Hi Robert,
    10 
    11 I've attached two patches:
    12 
    13 1/  For crosstool-0.31 which changes the CYGWIN_URL to one which has the
    14 cygwin source archives.  The version of cygwin that is used to build the
    15 cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since
    16 most of the mirror sites don't seem to have the original archive used.
    17 [created gcc-3.3.2-cygwin-1.5.15-1.dat - dank]
    18 
    19 
    20 2/ The later cygwin source archive fails to cross build with the error:
    21 /opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld:
    22 cannot find -luser32
    23 
    24 unless the second patch is applied,
    25 
    26 
    27 diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in
    28 --- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in	2005-02-28 22:51:02.000000000 +0000
    29 +++ cygwin-1.5.15-1/winsup/mingw/Makefile.in	2005-04-22 15:29:18.000000000 +0100
    30 @@ -71,7 +71,7 @@
    31  mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
    32  
    33  CC := @CC@
    34 -override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    35 +override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    36  # FIXME: Which is it, CC or CC_FOR_TARGET?
    37  CC_FOR_TARGET = $(CC)
    38  AS_FOR_TARGET = $(AS)
    39 
    40