This is the mail archive of the gcc-patches@gcc.gnu.org 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: [libitm, build] Clear hardware capabilities on libitm.so with Sun ld


On 11/21/2011 05:53 AM, Rainer Orth wrote:
> The libitm execution tests are currently failing on Solaris 10 and up
> with Sun as/ld:
> 
> ld.so.1: cancel.exe: fatal: /var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/./libitm/.libs/libitm.so.0: hardware capability (CA_SUNW_HW_1) unsupported: 0x20000000  [ AVX ]
> FAIL: libitm.c/cancel.c execution test
> 
> This is the same issue solved by
> gcc/testsuite/gcc.target/i386/clearcap.map, and the following patch
> adresses it in the same way:
> 
> * Detect if the linker used supports -M <map file>.
> 
> * Use it when linking libitm.so.
> 
> Right now, it is only possible to clear the hardware capabilities
> completely, while the new v2 mapfile syntax supports selectively adding
> and removing capabilities.  It is only available in Solaris 11 and
> Solaris 10 Update 10, though, so I'm restricting us to the v1 syntax for
> now.

This is only ok if the compiler and library are build with default options.
If you use --with-arch=corei7-avx then we may well use AVX insns all through
the library, not just in the one interface that will only be used if the 
user of the library is using avx.

Can you auto-foo this based on CC+CFLAGS?  E.g.  compile-time tests for the
various __SSE__ / __AVX__ macros?


r~


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