Hi Bence,
> I tried building a cross-compiler for `sparc-sun-solaris2`, but the
> resulting GCC executable wouldn't compile anything, always failing
> with: "as: unrecognized option '-m32'". After extensive research, I
> found that `as` takes `--32`/`--64`, instead of `-m32`/`-m64`. The
> patched GCC now does compile.
this patch is wrong: gcc on Solaris assumes the native assembler by
default, which *does* accept -m32 and -m64. You can see it in the
snippet you patched:
> diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
> index 93404757054..d1d0bb1f99d 100644
> - --- a/gcc/config/sparc/sol2.h
> +++ b/gcc/config/sparc/sol2.h
> @@ -63,9 +63,9 @@ along with GCC; see the file COPYING3. If not see
>
> #ifndef USE_GAS
^^^^^^^^^^^^^^^
> #undef ASM_ARCH32_SPEC
> - -#define ASM_ARCH32_SPEC "-m32"
> +#define ASM_ARCH32_SPEC "--32"
> #undef ASM_ARCH64_SPEC
> - -#define ASM_ARCH64_SPEC "-m64"
> +#define ASM_ARCH64_SPEC "--64"
> #endif
Obviously in a cross configuration you cannot use as, but need to
specify --with-as=<path to cross gas> --with-gnu-as.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University