This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libgcc] Use i386-cpuinfo.c on all i386 targets

Il 07/05/2012 14:09, Rainer Orth ha scritto:
> currently FAILs on Solaris/x86 (and
> also on on *86*-*-freebsd*, judging from testresults):
> FAIL: (test for excess errors)
> WARNING: 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). 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  <ro@CeBiTec.Uni-Bielefeld.DE>
> 	libgcc:
> 	* (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.
> 	* (AC_CONFIG_HEADER): Call for auto-target.h.
> 	(libgcc_cv_init_priority): New test.
> 	* configure: Regenerate.
> 	* New file.
> 	* (clean): Rename config.h to auto-target.h.
> 	(config.h): Likewise.
> 	(stamp-h): Likewise.
> 	* config/i386/cpuinfo.c (auto-target.h): Include.
> 	(__cpu_indicator_init): Use it.
> 	gcc
> 	* config/i386/i386.c: Update comments for i386-cpuinfo.c name
>         change.

Looks good.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]