Am 23.05.2017 um 07:00 schrieb Pete Zaitcev:
Hi, All:

I'm going to re-state the problem in short, but in case, URL
  https://bugzilla.redhat.com/show_bug.cgi?id=1454543

- I maintain a library (liberasurecode)
- It contains a call to ceill() from -lm
- When Koji builds the code, something makes gcc to inline AVX
- The result blows up:
Program received signal SIGILL, Illegal instruction.
0x00007fafaf9e04bd in liberasurecode_get_aligned_data_size (
=> 0x00007ffff78c44bd <+61>:    vxorpd %xmm0,%xmm0,%xmm0

As much as I can tell, there's nothing custom in CFLAGS in Makefile.am,
everything is inherited from RPM somehow. Here's how the actual line
looks like in Koji logs:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include 
-I../include/erasurecode -I../include/xor_codes -I../include/rs_vand 
-I../include/isa_l -I../include/shss -Werror -O2 -g -Werror -D_GNU_SOURCE=1 
-Wall -pedantic -std=c99 -O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong 
--param=ssp-buffer-size=4 -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -mmmx 
-DINTEL_MMX -msse -DINTEL_SSE -msse2 -DINTEL_SSE2 -msse3 -DINTEL_SSE3 -mssse3 
-DINTEL_SSSE3 -msse4.1 -DINTEL_SSE41 -msse4.2 -DINTEL_SSE42 -mavx -DINTEL_AVX 
-DARCH_64 -c erasurecode.c  -fPIC -DPIC -o .libs/liberasurecode_la-erasurecode.o

So, what now? I have no clue where to start fixing this.

Thanks in advance for any suggestions,
-- Pete


Hi Pete,

for some reason upstream appends `-mmmx -DINTEL_MMX -msse -DINTEL_SSE -msse2 -DINTEL_SSE2 -msse3 -DINTEL_SSE3 -mssse3 -DINTEL_SSSE3 -msse4.1 -DINTEL_SSE41 -msse4.2 -DINTEL_SSE42 -mavx -DINTEL_AVX` to CFLAGS, activating avx and several different sse versions…

You must remove remove those (except for sse <= 2 on x86_64), to make the compiled binaries portable between different (older) CPUs; those might be set in configure.ac [1] as well…

Cheers,
  Björn


[1] https://github.com/openstack/liberasurecode/blob/master/configure.ac#L155
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

Reply via email to