View Single Post
Posts: 839 | Thanked: 3,386 times | Joined on Mar 2009
#20
I installed new binutils and new gcc and checked gcc-4.6 --version -v
Code:
Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.6.1/lto-wrapper
gcc-4.6 (Debian 4.6.1-9ubuntu3) 4.6.1

Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-9ubuntu3) 
COLLECT_GCC_OPTIONS='--version' '-v'
 /usr/lib/gcc/arm-linux-gnueabi/4.6.1/cc1 -quiet -v -imultilib . -imultiarch arm-linux-gnueabi help-dummy -quiet -dumpbase help-dummy -auxbase help-dummy -version --version -o /tmp/ccl7Wdzd.s
GNU C (Debian 4.6.1-9ubuntu3) version 4.6.1 (arm-linux-gnueabi)
	compiled by GNU C version 4.6.1, GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='--version' '-v'
 as -meabi=5 --version -o /tmp/ccc8qQgm.o /tmp/ccl7Wdzd.s
GNU assembler (GNU Binutils for Debian) 2.22

This assembler was configured for a target of `arm-linux-gnueabi'.
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.6.1/:/usr/lib/gcc/arm-linux-gnueabi/4.6.1/:/usr/lib/gcc/arm-linux-gnueabi/:/usr/lib/gcc/arm-linux-gnueabi/4.6.1/:/usr/lib/gcc/arm-linux-gnueabi/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.6.1/:/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../://lib/://usr/lib/
COLLECT_GCC_OPTIONS='--version' '-v'
 /usr/lib/gcc/arm-linux-gnueabi/4.6.1/collect2 --sysroot=/ --build-id --no-add-needed --as-needed --eh-frame-hdr -dynamic-linker /lib/ld-linux.so.3 -X --hash-style=both -m armelf_linux_eabi --version /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crt1.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crti.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtbegin.o -L/usr/lib/gcc/arm-linux-gnueabi/4.6.1 -L/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.. -L//lib -L//usr/lib /tmp/ccc8qQgm.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtend.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crtn.o
collect2 version 4.6.1 (ARM GNU/Linux with ELF)
/usr/bin/ld --sysroot=/ --build-id --no-add-needed --as-needed --eh-frame-hdr -dynamic-linker /lib/ld-linux.so.3 -X --hash-style=both -m armelf_linux_eabi --version /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crt1.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crti.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtbegin.o -L/usr/lib/gcc/arm-linux-gnueabi/4.6.1 -L/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.. -L//lib -L//usr/lib /tmp/ccc8qQgm.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtend.o /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../crtn.o
GNU ld (GNU Binutils for Debian) 2.22
if there are anything suspicious (or even not-perfect) in configurations, please comment.

Originally Posted by Android_808 View Post
it helps remove traces of old gcc from build by compiling itslef with newly generated binary:
1st build: gcc 4.6 built with 4.2
2nd build: 4.6 built with 4.6 built with 4.2
3rd build 4.6 built with 4.6 built with 4.6
Seems I'm doing this already:
compiled by GNU C version 4.6.1, GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.9

Originally Posted by Android_808 View Post
are you sure you're making use of the new binutils?
GNU assembler (GNU Binutils for Debian) 2.22
GNU ld (GNU Binutils for Debian) 2.22

And this gcc-packaging uses 'ld --sysroot', which is not working with old binutils, so I'm sure it is compiled with new binutils.
(It is possible to compile gcc-4.6 with binutils-2.18, just disabling --sysroot. Truly speaking I do not know what this means.)


Originally Posted by Android_808 View Post
make sure libtool using correct paths after gcc build. it might still be hardcoded to old version of gcc.
libtool is pointing to the gcc. I have /usr/bin/gcc -> gcc-4.6
(and g++ -> g++-4.6)
--
I made more application tests with gcc-4.6 and binutils-2.22
A) multifile complex c-application which is using sin (libm.so)

Code:
/usr/bin/ld: test.a(test.o): undefined reference to symbol 'sinf@@GLIBC_2.4'
/usr/bin/ld: note: 'sinf@@GLIBC_2.4' is defined in DSO /usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../libm.so so try adding it to the linker command line
/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../libm.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
B) c-application without sin:
works

c) c++ application without sin:
works

d) naive sin-test: works:
Code:
/*gcc math_test.c -lm*/
#include <stdio.h>
#include <math.h>

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 30.0;
  result = sinf (param*PI/180);
  printf ("The sine of %lf degrees is %lf.\n", param, result );
  return 0;
}
---
So I'm still wondering is there need for compiling libc6?

My fault was start testing new compiler with huge and complex application. It caused lots of warning relating /usr/include/sys/stat.h and libm.so, which come from libc6-dev and libc6. (Same test compiles under Ubuntu with gcc-4.6 so it is not just deprecation of gcc-4.2). Maybe I should just compile everything lying on hard disk with gcc-4.6 and collect similarities from every failing applications.

Last edited by AapoRantalainen; 2012-02-10 at 17:36. Reason: typo
 

The Following 4 Users Say Thank You to AapoRantalainen For This Useful Post: