Hello > > 3. I'm having bad time with gcc-3.4 sparc multilib target. Current > > debian/rules.conf contains code that changes TARGET_ALIAS from > > sparc-linux to sparc64-linux. But this causes unwanted side-effects > > (such as attempts to use 'sparc64-linux-as' instead of > > 'sparc-linux-as' as assembler; that fails because there is no > > 'sparc64-linux-as', so it falls back to 'as'; that also fails because > > 'as' is native and can't process sparc assembler. Also, files go to > > /usr/sparc64-linux/... instead of /usr/sparc-linux/...) If I comment > > out TARGET_ALIAS change, buld fails with > > In file included from ../../src/gcc/libgcc2.c:56: > > ../../src/gcc/libgcc2.h:81: error: no data type for mode `TI' > > ../../src/gcc/libgcc2.h:82: error: no data type for mode `TI' > > make[4]: *** [libgcc/64/_muldi3.o] Error 1 > > Before I go deep into upstream code, I'd love to get some advice from > > somebody who has better understanding of what that means and how > > things work... > > I remember having stopped at the very same point and then found out > about the configury done as above. CC'ed Clint and Ben.
I think I've found a fix to this. See the attachement. Adding a single line to gcc/config.gcc makes sparc target to build correctly, without having to change it to sparc64. [EMAIL PROTECTED]:~/debian/gcc/3.4/test> dpkg-architecture -qDEB_HOST_ARCH i386 [EMAIL PROTECTED]:~/debian/gcc/3.4/test> sparc-linux-gcc-3.4 -o h hello.c [EMAIL PROTECTED]:~/debian/gcc/3.4/test> file h h: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped [EMAIL PROTECTED]:~/debian/gcc/3.4/test> sparc-linux-gcc-3.4 -m64 -o h64 hello.c [EMAIL PROTECTED]:~/debian/gcc/3.4/test> file h64 h64: ELF 64-bit MSB executable, SPARC V9, version 1 (SYSV), for GNU/Linux 2.4.18, dynamically linked (uses shared libs), not stripped I think the attached change (that is not cross-specific) should go in gcc-3.4 package. With this change and the cross patch I've sent some days ago, gcc-3.4 becomes in sync with gcc-3.3 (that means, builds for all debian linux targets, including biarch s390 and sparc). Nikita
--- gcc-3.4/debian/patches/sparc64-build.dpatch 2004-10-04 10:54:41.000000000 +0400 +++ test/gcc-3.4/debian/patches/sparc64-build.dpatch 2004-10-13 18:35:05.000000000 +0400 @@ -37,7 +37,7 @@ diff -urNad sparc64-build.gcc-3.3.tmp/src/gcc/config.gcc sparc64-build.gcc-3.3/src/gcc/config.gcc --- sparc64-build.gcc-3.3.tmp/src/gcc/config.gcc 2003-03-13 08:40:33.000000000 +0000 +++ sparc64-build.gcc-3.3/src/gcc/config.gcc 2003-03-13 08:48:27.000000000 +0000 -@@ -2383,8 +2383,17 @@ +@@ -2383,8 +2383,18 @@ gnu_ld=yes ;; sparc-*-linux*) # SPARC's running GNU/Linux, libc6 @@ -49,6 +49,7 @@ + tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux64 sparc/t-crtfm" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h" + float_format=sparc ++ need_64bit_hwint=yes + fi + #tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h" + #tmake_file="t-slibgcc-elf-ver t-linux sparc/t-crtfm" --- gcc-3.4/debian/rules.defs 2004-10-06 01:00:12.000000000 +0400 +++ test/gcc-3.4/debian/rules.defs 2004-10-13 23:30:12.000000000 +0400 @@ -559,9 +559,6 @@ biarch := yes with_lib64gcc := yes with_lib64cxx := yes - ifeq ($(TARGET_ALIAS),sparc-linux) - TARGET_ALIAS := sparc64-linux - endif endif # s390x build --------------------