Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459126 - www-client/chromium-25.0.1364.97: compilation error: ‘_mm_crc32_u64’ was not declared in this scope
Summary: www-client/chromium-25.0.1364.97: compilation error: ‘_mm_crc32_u64’ was not ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal with 2 votes (vote)
Assignee: Chromium Project
URL:
Whiteboard: ht-wanted
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 10:11 UTC by Nuno
Modified: 2013-03-14 01:00 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log of failed build (build.log.gz,35.74 KB, application/x-gzip)
2013-02-25 10:12 UTC, Nuno
Details
Emege Info (emerge-info.txt.gz,5.38 KB, application/x-gzip)
2013-02-25 10:12 UTC, Nuno
Details
-mno-sse4 breaks build on i5-3360M and i7-2600K (emerge --info + chromium-26.0.1410.19.build.log.gz,33.23 KB, application/x-gzip)
2013-03-09 05:05 UTC, Alexandre Rostovtsev (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno 2013-02-25 10:11:03 UTC
www-client/chromium-25.0.1364.97 fails to build on the system. Error fount:

  i686-pc-linux-gnu-g++ '-D_FILE_OFFSET_BITS=64' '-DNO_TCMALLOC' '-DCHROMIUM_BUILD' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DENABLE_ONE_CLICK_SIGNIN' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DUSE_PROPRIETARY_CODECS' '-DENABLE_PEPPER_THREADING' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_GPU=1' '-DENABLE_EGLIMAGE=1' '-DUSE_SKIA=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_WEB_INTENTS=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DENABLE_LANGUAGE_DETECTION=1' '-DENABLE_PRINTING=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0'   -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-format -Wno-unused-result -m32 -mmmx -O2 -fno-ident -fdata-sections -ffunction-sections -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -MMD -MF out/Release/.deps/out/Release/obj.target/cityhash/third_party/smhasher/src/City.o.d.raw -O2 -pipe -march=native -c -o out/Release/obj.target/cityhash/third_party/smhasher/src/City.o third_party/smhasher/src/City.cpp
third_party/smhasher/src/City.cpp: In function ‘void CityHashCrc256Long(const char*, size_t, uint32, uint64*)’:
third_party/smhasher/src/City.cpp:393:5: error: ‘_mm_crc32_u64’ was not declared in this scope
third_party/smhasher/src/City.cpp:399:5: error: ‘_mm_crc32_u64’ was not declared in this scope
third_party/smhasher/src/City.cpp:404:5: error: ‘_mm_crc32_u64’ was not declared in this scope
make: *** [out/Release/obj.target/cityhash/third_party/smhasher/src/City.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: www-client/chromium-25.0.1364.97 failed (compile phase):


Reproducible: Always

Steps to Reproduce:
1. Try to emerge latest stable version of chromium (version 25.0.1364.97)

Actual Results:  
Got a compilation error.

Expected Results:  
Chromium would compile and run.
Comment 1 Nuno 2013-02-25 10:12:08 UTC
Created attachment 340056 [details]
Build log of failed build
Comment 2 Nuno 2013-02-25 10:12:22 UTC
Created attachment 340058 [details]
Emege Info
Comment 3 Nuno 2013-02-25 12:41:40 UTC
Changing in the CFLAGS from -march=native to -march=core2 solves the problem.
Comment 4 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-02-25 15:50:44 UTC
Problem was already discussed on chromium IRC on 23 January and 2 February.

Another workaround is adding -msse4_2 (if your CPU supports it).
Comment 5 Nuno 2013-02-25 15:51:57 UTC
The -msse4_2 workaround did not work for me, I tried it before changing the -march option.
Comment 6 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-27 23:01:08 UTC
(In reply to comment #4)
> Problem was already discussed on chromium IRC on 23 January and 2 February.

It's funny how it's the same guy in both cases and he's on Gentoo. We could have known about this bug a month earlier, before chromium-25.x went to stable.

Alright, now Nuno what CPU do you have? What does /proc/cpuinfo say?

Please also post what -march=native expands to on your system. See http://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-native-will-activate for reference, and make sure to post output of "gcc -march=native -E -v - </dev/null 2>&1 | grep cc1".
Comment 7 Ivan 2013-02-28 03:50:59 UTC
"march=core2" trick works for me. (~x86, i5-2500k, gcc-4.6.3) 
thanks.
Comment 8 Nuno 2013-02-28 09:05:12 UTC
I have a Core i5, but I'm running with 32bits (x86). I am not running on 64bits (amd64). Maybe this happens because this CPU is MSS4.2 capable so GCC will try to use it but the SO is only on 32bits?

Anyhow, here is the cpuinfo for one of the cores of the machine.

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
stepping        : 7
microcode       : 0x28
cpu MHz         : 1000.000
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips        : 4988.81
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
Comment 9 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-03-01 19:38:26 UTC
(In reply to comment #8)
> I have a Core i5, but I'm running with 32bits (x86). I am not running on
> 64bits (amd64). Maybe this happens because this CPU is MSS4.2 capable so GCC
> will try to use it but the SO is only on 32bits?

Please provide the following missing info (Ivan, if you can, please do as well):

(In reply to comment #6)
> Please also post what -march=native expands to on your system. See
> http://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-
> native-will-activate for reference, and make sure to post output of "gcc
> -march=native -E -v - </dev/null 2>&1 | grep cc1".
Comment 10 Stefano 2013-03-01 20:26:33 UTC
(In reply to comment #4)
> Problem was already discussed on chromium IRC on 23 January and 2 February.
> 
> Another workaround is adding -msse4_2 (if your CPU supports it).

CPU supports it but workaround doesn't work for me.
Comment 11 Stefano 2013-03-01 20:27:56 UTC
(In reply to comment #6)

> Please also post what -march=native expands to on your system. See
> http://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-
> native-will-activate for reference, and make sure to post output of "gcc
> -march=native -E -v - </dev/null 2>&1 | grep cc1".

$ gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/i686-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7-avx
Comment 12 mikopp 2013-03-06 21:55:04 UTC
Same thing here, going from native to core2 and removing the explicit sse4.2 solves the issue. gentoo 32bit

gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/i686-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=corei7 -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=corei7

CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse -msse2 -msse3 -mssse3 -mmmx -msse4.1 -msse4.2"

cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i5 CPU       M 520  @ 2.40GHz
stepping        : 5
microcode       : 0x2
cpu MHz         : 2400.000
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips        : 4787.62
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
Comment 13 arsenicum 2013-03-07 10:24:19 UTC
Same thing with i3 on x86:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i3 CPU         550  @ 3.20GHz
stepping        : 5
microcode       : 0x2
cpu MHz         : 3192.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips        : 6399.53
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/i686-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=corei7 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=corei7

Set CFLAGS to "-O2 -pipe -march=core2" solves the problem. Version 25.0.1364.152 is affected too.
Comment 14 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-03-08 00:14:19 UTC
Does adding an explicit -mno-sse4.2 while preserving -march=native fix the build for you? If not, please also try -mno-sse4 and report result of both.
Comment 15 mikopp 2013-03-08 03:09:16 UTC
yes that works
Comment 16 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-03-08 22:10:41 UTC
  08 Mar 2013; Pawel Hajdan jr
  chromium-25.0.1364.160.ebuild, chromium-26.0.1410.19.ebuild,
  chromium-27.0.1430.0.ebuild, chromium-9999-r1.ebuild:
  Work around a compile issue by using -mno-sse4, bug #459126 by Nuno.

After someone reports successful compile with one of above versions, I'm going to close the bug. Please say which version you've tested.
Comment 17 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-03-09 05:05:14 UTC
Created attachment 341368 [details]
-mno-sse4 breaks build on i5-3360M and i7-2600K

(In reply to comment #16)
>   08 Mar 2013; Pawel Hajdan jr
>   chromium-25.0.1364.160.ebuild, chromium-26.0.1410.19.ebuild,
>   chromium-27.0.1430.0.ebuild, chromium-9999-r1.ebuild:
>   Work around a compile issue by using -mno-sse4, bug #459126 by Nuno.
> 
> After someone reports successful compile with one of above versions, I'm
> going to close the bug. Please say which version you've tested.

Please revert this change or add an sse4 USE flag. Forcing -mno-sse4 broke chromium compilation on two machines here - one with i5-3360M and another with i7-2600K:

In file included from third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:12:0:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/smmintrin.h:31:3: error: #error "SSE4.1 instruction set not enabled"
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c: In function ‘vp9_filter_block2d_4x4_8_sse4_1’:
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:93:3: error: unknown type name ‘__m128i’
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:97:3: error: unknown type name ‘__m128i’
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:98:3: error: unknown type name ‘__m128i’
[...]
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:296:9: error: unknown type name ‘__m128i’
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:297:9: error: unknown type name ‘__m128i’
third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.c:298:9: error: unknown type name ‘__m128i’
make: *** [out/Release/obj.target/libvpx_intrinsics/third_party/libvpx/source/libvpx/vp9/common/x86/vp9_filter_sse4.o] Error 1
Comment 18 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-03-09 05:24:18 UTC
$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
stepping	: 7
microcode	: 0x28
cpu MHz		: 3401.000
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 6784.33
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

$ gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.2/cc1 -E -quiet -v - -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=corei7-avx
Comment 19 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-03-09 05:27:41 UTC
(In reply to comment #17)
> Please revert this change or add an sse4 USE flag. Forcing -mno-sse4 broke
> chromium compilation on two machines here - one with i5-3360M and another
> with i7-2600K:

Oops - reverted. Thank you for reporting. Looks like upstream is pretty fragile here.
Comment 20 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-03-09 13:20:28 UTC
I see that the people who were experiencing the "_mm_crc32_u64" failure were all using x86; I am on amd64.

Perhaps -mno-sse4 should be added for x86 only?
Comment 21 Mikhail Gorbunov 2013-03-12 11:19:36 UTC
(building www-client/chromium-25.0.1364.160 with gcc-4.6.3 on my x86 with -march=native)

The _mm_crc32_u64() function declaration in /usr/lib/gcc/i686-pc-linux-gnu/4.6.3/include/smmintrin.h is enveloped into '#ifdef __x86_64__' guard while its call in . is not.

I guess instead of pushing -mno-sse4 disregarding the cpu we need an epatch with something like

#ifdef __x86_64__
  #define CHUNK(multiplier, z) ... _mm_crc32_u64 ...
#else
  #define CHUNK(multiplier, z) ... some_other_method ...
#endif
Comment 22 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-03-14 01:00:11 UTC
  14 Mar 2013; Pawel Hajdan jr
  +files/chromium-smhasher-r0.patch, chromium-25.0.1364.172.ebuild,
  chromium-26.0.1410.28.ebuild, chromium-27.0.1438.7.ebuild:
  Fix build issues with _mm_crc32_u64, bug #459126 by Nuno.