Hi, For some reason I thought I might have reported this bug, but I've had this problem for years, ever since I started using Gentoo, on two separate computers with two different -mtune values (haswell and westmere). If your CFLAGS in make.conf has an -mtune set (e.g. -mtune=haswell) ImageMagick overrides it with a weird value and fails to build at the beginning with errors like these: cc1: error: bad value (‘no-automagic’) for ‘-mtune=’ switch cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 generic I don't know what the "no-automagic" architecture is. There are no references to "no-automagic" in make.conf. The workaround is to remove "-mtune" from the make.conf CFLAGS when it comes time to rebuild or upgrade ImageMagick (which also affects packages which require an ImageMagick rebuild) and then put it back when you're done. Only changing the CFLAGS for media-gfx/imagemagick via package.env and /etc/portage/env has no effect. You have to remove it from the make.conf CFLAGS. This does not affect -march, which works just fine.
Just a note that the westmere laptop mentioned in my original report finally bit the dust last month, and so I cannot try anything regarding this bug there. In its place is a broadwell architecture laptop, which also has the same issue with -mtune=broadwell when building media-gfx/imagemagick.
I hit the same bug. Removing "-mtune" from make.conf worked as you described.
> @Red > Only changing the CFLAGS for media-gfx/imagemagick via package.env and > /etc/portage/env has no effect. You have to remove it from the make.conf CFLAGS. I think the problem was you didn't set the other FLAGS. This setup worked for me. # cat /etc/portage/package.env/package.env media-gfx/imagemagick no-mtune # cat /etc/portage/env/no-mtune CFLAGS="-O2 -pipe -march=native" CXXFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}"
(In reply to email200202 from comment #3) > > @Red > > Only changing the CFLAGS for media-gfx/imagemagick via package.env and > > /etc/portage/env has no effect. You have to remove it from the make.conf CFLAGS. > > I think the problem was you didn't set the other FLAGS. > > This setup worked for me. > > # cat /etc/portage/package.env/package.env > media-gfx/imagemagick no-mtune > > # cat /etc/portage/env/no-mtune > CFLAGS="-O2 -pipe -march=native" > CXXFLAGS="${CFLAGS}" > CPPFLAGS="${CFLAGS}" Yes adding CXXFLAGS and CPPFLAGS to the file worked, thank you!
I can confirm the same bug on an AMD64 machine.
I confirm the same bug for imagemagick-7.0.8.50 with an Atom processor and CFLAGS="-O2 -pipe -march=bonnell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -mfxsr --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=bonnell" CXXFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" These cflags were generated with the following command: $(gcc -march=native -v -E - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;') removing -mtune=bonnell worked however. lscpu Architecture: i686 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 32 bits physical, 48 bits virtual CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 28 Model name: Intel(R) Atom(TM) CPU 230 @ 1.60GHz Stepping: 2 CPU MHz: 1599.524 BogoMIPS: 3199.08 L1d cache: 24K L1i cache: 32K L2 cache: 512K Flags: fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm As additional information: I have another Atom PC that does NOT show the bug: CFLAGS="-O2 -pipe -march=bonnell -mmmx -msse -msse2 -msse3 -mssse3 -msahf -mmovbe -mfxsr --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=bonnell" CXXFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" lscpu Architecture: i686 CPU op-mode(s): 32-bit Byte Order: Little Endian Address sizes: 32 bits physical, 32 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 28 Model name: Intel(R) Atom(TM) CPU N280 @ 1.66GHz Stepping: 2 CPU MHz: 1662.503 BogoMIPS: 3325.01 L1d cache: 24K L1i cache: 32K L2 cache: 512K Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm
Created attachment 587380 [details] ebuild without --with-gcc-arch=no-automagic The error is related to the line --with-gcc-arch=no-automagic in the imagemagick ebuild. Attached ebuild removes the line and builds without error. (Only tested with GCC_FLAGS containing mtune=bonnell).
Comment on attachment 587380 [details] ebuild without --with-gcc-arch=no-automagic Unfortunately just dropping the line is not helpful. Yes it makes the error go away, but it also makes IM ignore your CFLAGS and guess a best setting for your PC. Which is not necessarily what you want (think binary packages).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d49930d33bbd53473777618cf33d1d36682e5ed commit 3d49930d33bbd53473777618cf33d1d36682e5ed Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2022-03-04 00:24:36 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2022-03-04 00:24:56 +0000 media-gfx/imagemagick: Patch out cpu-tuning magic Closes: https://bugs.gentoo.org/678454 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> .../files/imagemagick-9999-nocputuning.patch | 14 ++ .../imagemagick/imagemagick-6.9.12.35-r1.ebuild | 266 ++++++++++++++++++++ .../imagemagick/imagemagick-7.1.0.20-r1.ebuild | 273 +++++++++++++++++++++ media-gfx/imagemagick/imagemagick-9999.ebuild | 12 +- 4 files changed, 561 insertions(+), 4 deletions(-)