Comment # 11
on bug 10792
from Guy Harris
(In reply to Jeff Morriss from comment #10)
> (In reply to Jeroen Roovers from comment #9)
> > (In reply to Guy Harris from comment #8)
> >
> > > Perhaps if we added the -msse4.2 to the end, it'd be the last option seen by
> > > GCC, and thus override the -mno-sse4.2 (as it should, given that the code
> > > will work Just Fine on machines without SSE 4.2).
> >
> > Sounds good. In that case you probably wouldn't need a configure switch
> > either.
>
> But automake doesn't want us to do that: users' settings (in this case
> CFLAGS) are supposed to override all--and so they come last on the compile
> line.
>
> https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-
> Ordering.html
>
> To do it we'd have to override CFLAGS (which we're not supposed to do).
Or, at least with newer versions of GCC:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Function-Attributes.html#Function-Attributes
According to the manuals on gcc.gnu.org, the first version of GCC to support
-msse4.2 is 4.3.6, but the first version to support "#pragma GCC target
("string"...)" is 4.4.:
https://gcc.gnu.org/gcc-4.4/changes.html
So, *if* we can put that at the beginning of ws_mempbrk_sse42.c and have it
affect the include files, not just the functions compiled after it, that would
work.
Clang's documentation sucks, so it's not clear whether it supports that, or, if
it is, in what versions of clang it's supported. We should probably check
whether the pragma is supported, rather than whether the -msse4.2 flag is
supported, and only build ws_mempbrk_sse42.c if it is.
You are receiving this mail because:
- You are watching all bug changes.