patches/dmalloc/5.5.2/110-block_size.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
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 This patch sets the page size to a default 12, that is a 4KiB block size.
     2 Testing for the correct block-size is impossible when cross-compiling.
     3 
     4 It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
     5 bits gathered from buildroot, which is LGPL v2.1
     6 License for dmalloc is:
     7  * Permission to use, copy, modify, and distribute this software for
     8  * any purpose and without fee is hereby granted, provided that the
     9  * above copyright notice and this permission notice appear in all
    10  * copies, and that the name of Gray Watson not be used in advertising
    11  * or publicity pertaining to distribution of the document or software
    12  * without specific, written prior permission.
    13  *
    14  * Gray Watson makes no representations about the suitability of the
    15  * software described herein for any purpose.  It is provided "as is"
    16  * without express or implied warranty.
    17 
    18 I personnaly believe that the resulting code should therefore be
    19 LGPL v2.1, but don't believe me, ask your lawyers!
    20 
    21 diff -dur dmalloc-5.5.2.orig/configure dmalloc-5.5.2/configure
    22 --- dmalloc-5.5.2.orig/configure	2007-05-14 19:26:14.000000000 +0200
    23 +++ dmalloc-5.5.2/configure	2007-05-18 11:38:25.000000000 +0200
    24 @@ -5306,7 +5306,7 @@
    25  
    26  echo "$as_me:$LINENO: checking basic-block size" >&5
    27  echo $ECHO_N "checking basic-block size... $ECHO_C" >&6
    28 -ac_cv_page_size=0
    29 +ac_cv_page_size=12
    30  if test $ac_cv_page_size = 0; then
    31     if test "$cross_compiling" = yes; then
    32    { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling