COPYING
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
parent 676 78c450c0b219
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 Unless otherwise stated in individual files, this work is licensed to you under
     2 the following terms.
     3 
     4 - Files in docs/ are available under the Creative Commons Attribution, Share
     5   Alike (by-sa), v2.5, to be found there:
     6     licenses.d/by-sa/deed.en     (human-readable summary)
     7     licenses.d/by-sa/legalcode   (legal code, the full license)
     8     
     9 - Files found in patches/*/ are available under the same license as the
    10   upstream software they apply to.
    11 
    12   That means that you can't use those patches if you were licensed the
    13   software under a specific license which is not the one the software is
    14   commonly available under.
    15 
    16   As an example, if you ever managed to get the Linux kernel under a license
    17   other than the GPLv2, you are not allowed to use the Linux kernel patches
    18   coming with crosstool-NG, as those are available under the GPLv2, which is
    19   the license the Linux kernel is most commonly available under.
    20 
    21   As a convenience, the GNU Lesser General Public License (LGPL) v2.1 (for the
    22   patches against glibc, uClibc, and some other libraries) is available there:
    23     licenses.d/lgpl.txt
    24 
    25 - Other files not covered by the above licenses, and not covered by an
    26   individual license specified in the file itself, or an accompanying file,
    27   are available under the GNU General Public License (GPL), v2, to be found
    28   here:
    29     licenses.d/gpl.txt
    30 
    31 - Also, I want to clarify one point. If you build a toolchain with crosstool-NG
    32   and you happen to sell, deliver, or otherwise publish this toolchain to a
    33   third party, I consider crosstool-NG as being part of the sources needed to
    34   rebuild the afore-mentioned toolchain, alongside with all other source code
    35   that third party is otherwise entitled to receive, due to other licenses of
    36   the different components. See licenses.d/gpl.txt, section 3, which reads:
    37    > For an executable work, complete source code means [...], plus the
    38    > scripts used to control compilation and installation of the executable.
    39 
    40   In short: crosstool-NG is the part refered to as "the scripts to control
    41   compilation and installation of the executable", it being the toolchain in
    42   our case; and as such you must make it available, in conformance to the
    43   GPLv2, see above.
    44 
    45   Also, if you have local patches that you apply to the different components
    46   (either manualy, or by instructing crosstool-NG to do so), you will have to
    47   make those patches available alongside with your toolchain, to comply with
    48   the licenses of the components impacted by your patches.