Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492964 - =app-laptop/tp_smapi-0.41 arch/x86/Makefile: gcc: error: -mpreferred-stack-boundary=3 is not between 4 and 12
Summary: =app-laptop/tp_smapi-0.41 arch/x86/Makefile: gcc: error: -mpreferred-stack-bo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 17:55 UTC by Dmitri
Modified: 2015-12-23 15:38 UTC (History)
5 users (show)

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


Attachments
build log for tp_smapi-0.41 (tp_smapi-0.41.build.log,5.39 KB, text/plain)
2013-11-30 17:55 UTC, Dmitri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri 2013-11-30 17:55:32 UTC
Created attachment 364276 [details]
build log for tp_smapi-0.41

when i has to update app-laptop/tp_smapi-0.41 it could not update, giving an error that -mpreferred-stack-boundary should bigger

I have updated make.conf and added to CFLAGS -mpreferred-stack-boundary=6 that solve the situation for tp_smapi,
however, mesa did not build up with the new CFLAGS settings, so i has to revert make.conf in order to build mesa.

Relevant line from the build log (for full log see attachment)
=====
/var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/tp_smapi.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
 /*
 ^
/var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/thinkpad_ec.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
====

Following advice from http://forums.gentoo.org/viewtopic.php?p=7451612
I am reporting it as a bug.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-30 18:02:44 UTC
You should probably set some sane CFLAGS.

"Attempt to keep the stack boundary aligned to a 2 raised to num byte boundary"

That means it should be a multiple of 2, so 3 is wrong.
Comment 2 Dmitri 2013-11-30 18:06:25 UTC
CFLAGS in my /etc/portage/make.conf

good for tp_smapi
#CFLAGS="-march=core2 -mtune=generic -Os -pipe -msse3 -msse4 -mcx16 -msahf -mpopcnt -mpreferred-stack-boundary=6"

good for everything else
CFLAGS="-march=core2 -mtune=generic -Os -pipe -msse3 -msse4 -mcx16 -msahf -mpopcnt"
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-30 18:38:07 UTC
arch/x86/Makefile:61:    KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
Comment 4 Sasha Medvedev 2013-12-18 11:20:15 UTC
I have the same error after upgrading to gcc-4.8.2. Everything works with gcc-4.7.3. So could be gcc bug.
Comment 5 Mike Pagano gentoo-dev 2014-01-23 19:40:23 UTC
Reassigning to gcc guys for some assistance. 

Here is what I *think* is happening:

This build is hitting this piece of code:

http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/i386/i386.c?r1=188893&r2=188892&pathrev=188893

with a -msse past in to your use flags, the min boundary is set to 3.
without any -msseN flags, the min boundary will be set to 4.

If I use your cflags without any sse flags, I can compile. When I add one sse flag, I get the error.

Bear in mind this is the first time I've ever looked into the gcc source.
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2014-01-25 17:34:21 UTC
Shouldn't kernel modules always be built with the same options that built the kernel?
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2014-01-25 17:42:24 UTC
Yeah, it does the right thing, but then the user CFLAGS screw things over.

  x86_64-pc-linux-gnu-gcc -Wp,-MD,/var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/.thinkpad_ec.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include -I/usr/src/linux-3.12.8-gentoo/arch/x86/include -Iarch/x86/include/generated  -I/usr/src/linux-3.12.8-gentoo/include -Iinclude -I/usr/src/linux-3.12.8-gentoo/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-3.12.8-gentoo/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-3.12.8-gentoo/include/linux/kconfig.h   -I/var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41 -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mpreferred-stack-boundary=3 -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -march=core2 -mtune=generic -Os -pipe -msse3 -msse4 -mcx16 -msahf -mpopcnt   -I/var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/include  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(thinkpad_ec)"  -D"KBUILD_MODNAME=KBUILD_STR(thinkpad_ec)" -c -o /var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/thinkpad_ec.o /var/tmp/portage/app-laptop/tp_smapi-0.41/work/tp_smapi-0.41/thinkpad_ec.c

A simple strip-flags would fix it.
Comment 8 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-02-02 00:32:17 UTC
Hmm, the summary is wrong given the build log; corrected and reassigned. At least under the assumption that stripping the flag is the way forward. It appears to be maintainer-needed though...
Comment 9 Sebastian Pipping gentoo-dev 2015-12-20 21:49:31 UTC
With the hints from this report and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 I can confirm that the problem is the combination of

 1) archtecture amd64

 2) -mpreferred-stack-boundary=3 (originating from the Kernel Makefiles)

 3) user CFLAGS containing -msse* (e.g. -msse4.1)

I have committed -r1 using flag-o-matic to fix user CFLAGS on the fly.
Please feel free to re-open as needed.


# git show --stat | sed 's,@gentoo.org,@g.o,'
commit b2ae67998fc017775a514b475022f4dc4c3466bc
Author: Sebastian Pipping <sping@g.o>
Date:   Sun Dec 20 22:43:27 2015 +0100

    app-laptop/tp_smapi: Fix compilation (bug #492964)
    
    Package-Manager: portage-2.2.26

 app-laptop/tp_smapi/tp_smapi-0.41-r1.ebuild | 74 +++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
Comment 10 Conrad Kostecki gentoo-dev 2015-12-23 14:03:37 UTC
Hi!
It seems, that filtering to msse* is not enough.
I've ran today into this problem with the newest -r1 ebuild.

It failed, because I have also "-mssse3" set, which is not beeing filtered. That should be added. Could someone do this?

-mssse3 ist not a typo. It's a valid CFLAG.

Conrad
Comment 11 Sebastian Pipping gentoo-dev 2015-12-23 15:38:45 UTC
Fixed.


# git show --stat | sed 's,@gentoo.org,@g.o,'
commit 4a67438e5990e45b6cd37086a59720cbb9d142b8
Author: Sebastian Pipping <sping@g.o>
Date:   Wed Dec 23 16:37:18 2015 +0100

    app-laptop/tp_smapi: Filter -mssse3 (bug #492964)
    
    Package-Manager: portage-2.2.26

 app-laptop/tp_smapi/tp_smapi-0.41-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)