Il 07/05/2012 14:09, Rainer Orth ha scritto:
> gcc.target/i386/builtin_target.c currently FAILs on Solaris/x86 (and
> also on on *86*-*-freebsd*, judging from testresults):
> 
> FAIL: gcc.target/i386/builtin_target.c (test for excess errors)
> WARNING: gcc.target/i386/builtin_target.c compilation failed to produce 
> executable
> 
> Excess errors:
> Undefined                     first referenced
>  symbol                           in file
> __cpu_indicator_init                /var/tmp//ccj7aaTp.o
> ld: fatal: symbol referencing errors. No output written to .
> 
> The problem is that the test is run on all i?86/x86_64 targets, but
> i386-cpuinfo.c is only added to libgcc on a select smaller set of
> targets, only those using glibc, it seems.  AFAICS there's nothing
> glibc-specific in that file (with the possible exection of constructor
> priority, which might depend on gld), so I suggest to use it everywhere.
> 
> In order for this to work, one needs to check if init priority is
> supported by the toolchain used, otherwise i386-cpuinfo.c will fail to
> compile.  It seems that the only thing you loose if it's not is the
> ability to use __builtin_cpu_* in constructors without explicitly
> calling __builtin_cpu_init, which seems like an acceptable limitation if
> documented (not yet in this patch).
> 
> I'm now introducing a config header for libgcc to contain the test
> results, but to avoid clashes with the (still used) headers in gcc, I'm
> calling it auto-target.h (like gcc's auto-host.h).  Makefile.in still
> contained references to the generic config.h, but that file doesn't
> exist, so I've reused them for auto-target.h.
> 
> Bootstrapped without regressions on i386-pc-solaris2.11 (as/ld, gas/ld,
> gas/gld).  Ok for mainline?
> 
>       Rainer
> 
> 
> 2012-04-26  Rainer Orth  <r...@cebitec.uni-bielefeld.de>
> 
>       libgcc:
>       * config.host (i[34567]86-*-linux*, x86_64-*-linux*)
>       (i[34567]86-*-kfreebsd*-gnu, x86_64-*-kfreebsd*-gnu)
>       (i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*): Move
>       i386/t-cpuinfo ...
>       (i[34567]86-*-*, x86_64-*-*): ... here.
> 
>       * config/i386/libgcc-bsd.ver (GCC_4.8.0): New version.
>       * config/i386/libgcc-sol2.ver (GCC_4.8.0): New version.
> 
>       * config/i386/i386-cpuinfo.c: Rename to ...
>       * config/i386/cpuinfo.c: ... this.
>       * config/i386/t-cpuinfo (LIB2ADD): Reflect this.
> 
>       * configure.ac (AC_CONFIG_HEADER): Call for auto-target.h.
>       (libgcc_cv_init_priority): New test.
>       * configure: Regenerate.
>       * config.in: New file.
>       * Makefile.in (clean): Rename config.h to auto-target.h.
>       (config.h): Likewise.
>       (stamp-h): Likewise.
> 
>       * config/i386/cpuinfo.c (auto-target.h): Include.
>       (CONSTRUCTOR_PRIORITY): Define.
>       (__cpu_indicator_init): Use it.
> 
>       gcc
>       * config/i386/i386.c: Update comments for i386-cpuinfo.c name
>         change.
> 

Looks good.

Paolo

Reply via email to