Jakub Jelinek wrote:
> On Thu, Jul 23, 2015 at 01:03:19PM +0100, Nick Clifton wrote:
> > Hi Helmut, Hi Ulrich, Hi Andreas,
> > 
> >   A toolchain configured as --target=s390-linux currently fails to build
> >   gcc because of an undefined function:
> > 
> >     undefined reference to `s390_host_detect_local_cpu(int, char const**)'
> >     Makefile:1858: recipe for target 'xgcc' failed
> > 
> >   The patch below fixes the problem for me by adding a stub function in
> >   s390-common.c, but I am not sure if it is the correct solution.
> >   Please can you advise ?
> 
> Isn't it better to just follow what other arches do?
> E.g. on i?86/x86_64, the EXTRA_SPEC_FUNCTIONS definition is guarded
> with
> #if defined(__i386__) || defined(__x86_64__)
> and similarly on mips:
> #if defined(__mips__)
> and thus I'd expect s390{,x} should guard it with
> #if defined(__s390__) || defined(__s390x__)
> or so.

This is supposed to be fixed by this pending patch:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01546.html

(which hasn't been applied yet, but probably should be soon ...)

> The config.host change also looks wrong, e.g. i?86 or mips have:
>   i[34567]86-*-* \
>   | x86_64-*-* )
>     case ${target} in
>       i[34567]86-*-* \
>       | x86_64-*-* )
>         host_extra_gcc_objs="driver-i386.o"
>         host_xmake_file="${host_xmake_file} i386/x-i386"
>         ;;
>     esac
>     ;;
>   mips*-*-linux*)
>     case ${target} in
>       mips*-*-linux*)
>         host_extra_gcc_objs="driver-native.o"
>         host_xmake_file="${host_xmake_file} mips/x-native"
>       ;;
>     esac
>     ;;
> while s390 has:
>   s390-*-* | s390x-*-*)
>     host_extra_gcc_objs="driver-native.o"
>     host_xmake_file="${host_xmake_file} s390/x-native"
>     ;;
> I bet that is gone break also cross-compilers from s390* to other targets.

I think this should be fine on s390.  The problem with i386 is that
the driver-native.c file uses data types only defined by the i386
target files (e.g. enum processor_type).  But on s390, the file does
not any target-specific types and should be fully portable.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  ulrich.weig...@de.ibm.com

Reply via email to