LTO with static libraries

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Feb 12 15:50:27 UTC 2013


Hello,

I currently do some testing with PowerPC GCC 4.8.  On PowerPC and ARM RTEMS a 
lot of LTO (link time optimization) tests fail.  For example:

http://gcc.gnu.org/ml/gcc-testresults/2013-02/msg01371.html

Executing on host: /scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/xgcc 
-B/scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/ 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1-lib.c 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c gcc_tg.o 
  -fno-diagnostics-show-caret  -w  -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -fno-tree-loop-distribute-patterns -DSTACK_SIZE=2048 
-isystem 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/targ-include 
-isystem /home/sh/archive/gcc-git/newlib/libc/include 
-B/scratch/git-rtems-testing/gcc/install-git/powerpc-rtems4.11/psim/lib/ -specs 
bsp_specs -qrtems 
-B/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/ 
-L/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/rtems_gcc_main.o  -Wl,-wrap,exit 
-Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm   -o 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/testsuite/gcc/20010124-1.x8 
  (timeout = 300)
spawn /scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/xgcc 
-B/scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/ 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1-lib.c 
/home/sh/archive/gcc-git/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c gcc_tg.o 
-fno-diagnostics-show-caret -w -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects -fno-tree-loop-distribute-patterns -DSTACK_SIZE=2048 
-isystem 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/targ-include 
-isystem /home/sh/archive/gcc-git/newlib/libc/include 
-B/scratch/git-rtems-testing/gcc/install-git/powerpc-rtems4.11/psim/lib/ -specs 
bsp_specs -qrtems 
-B/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/ 
-L/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/rtems_gcc_main.o -Wl,-wrap,exit 
-Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o 
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/gcc/testsuite/gcc/20010124-1.x8
/tmp/ccvxWHA6.ltrans0.ltrans.o: In function `memcpy':
ccvxWHA6.ltrans0.o:(.text+0x4): multiple definition of `memcpy'
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/libc.a(lib_a-memcpy.o):/home/sh/archive/gcc-git/newlib/libc/string/memcpy.c:79: 
first defined here
collect2: error: ld returned 1 exit status
compiler exited with status 1
output is:
/tmp/ccvxWHA6.ltrans0.ltrans.o: In function `memcpy':
ccvxWHA6.ltrans0.o:(.text+0x4): multiple definition of `memcpy'
/scratch/git-rtems-testing/gcc/b-powerpc-gcc/powerpc-rtems4.11/./newlib/libc.a(lib_a-memcpy.o):/home/sh/archive/gcc-git/newlib/libc/string/memcpy.c:79: 
first defined here
collect2: error: ld returned 1 exit status

FAIL: gcc.c-torture/execute/builtins/20010124-1.c compilation,  -O2 -flto 
-fuse-linker-plugin -fno-fat-lto-objects

See also:

http://gcc.gnu.org/ml/gcc-help/2011-10/msg00201.html

I used

binutils-2.23.1/configure --target=powerpc-rtems4.11 --disable-werror

to configure the Binutils.  Has someone better experiences with LTO on RTEMS?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list