config/binutils.in
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
parent 1897 0a3b9af21490
child 3117 2b64e1b502cd
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>
yann@1345
     1
# Binary utilities menu
yann@1
     2
yann@1345
     3
menu "Binary utilities"
yann@1
     4
yann@1
     5
choice
yann@1
     6
    bool
yann@1345
     7
    prompt "Binary format:"
yann@1
     8
bartvdrmeulen@1897
     9
if ARCH_USE_MMU || BARE_METAL
yann@1345
    10
yann@1345
    11
config ARCH_BINFMT_ELF
yann@1
    12
    bool
yann@1345
    13
    prompt "ELF"
yann@1345
    14
    help
antony@2564
    15
      This will make your system build ELF executables,
yann@1345
    16
      suitable for architectures with an MMU.
yann@1
    17
yann@1345
    18
endif # ARCH_USE_MMU
yann@1345
    19
yann@1345
    20
if ! ARCH_USE_MMU
yann@1345
    21
yann@1345
    22
config ARCH_BINFMT_FLAT
yann@1
    23
    bool
yann@1345
    24
    prompt "Flat"
yann@1345
    25
    help
yann@1345
    26
      This will build flat binaries, suitable for
yann@1345
    27
      MMU-less architectures.
yann@1
    28
thomas@1887
    29
config ARCH_BINFMT_FDPIC
thomas@1887
    30
    bool
thomas@1887
    31
    prompt "FD_PIC ELF"
thomas@1887
    32
    help
thomas@1887
    33
      This will build FD_PIC ELF binaries, suitable for
thomas@1887
    34
      MMU-less architectures that still require to use
thomas@1887
    35
      shared libraries (FIXME).
yann@1
    36
yann@1345
    37
endif # ! ARCH_USE_MMU
yann@1
    38
yann@1
    39
endchoice
yann@1
    40
yann@1870
    41
source "config/binutils/binutils.in"
yann@1870
    42
source "config/binutils/elf2flt.in"
yann@1870
    43
source "config/binutils/sstrip.in"
yann@458
    44
yann@1
    45
endmenu