Bug 17950 - Build fails with -msse
Summary: Build fails with -msse
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.21
: P2 minor
Target Milestone: 2.24
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-10 07:40 UTC by Vyacheslav Barinov
Modified: 2016-04-10 02:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Patch proposal (557 bytes, patch)
2015-02-10 07:40 UTC, Vyacheslav Barinov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vyacheslav Barinov 2015-02-10 07:40:31 UTC
Created attachment 8115 [details]
Patch proposal

Build both with -msse and -Werror causes build error:

  cc1: all warnings being treated as errors
  dl-runtime.c:1:0: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
Comment 1 Carlos O'Donell 2015-02-12 18:23:08 UTC
(In reply to Vyacheslav Barinov from comment #0)
> Created attachment 8115 [details]
> Patch proposal
> 
> Build both with -msse and -Werror causes build error:
> 
>   cc1: all warnings being treated as errors
>   dl-runtime.c:1:0: error: SSE instruction set disabled, using 387
> arithmetics [-Werror]

Adding -Wno-error is not the correct fix.

You need to determine why this warning happens. It's valid to use -msse and -mno-sse together, they do not generate a warning.

It seems like you're compiling with -msse for a target that doesn't support SSE and thus getting a warning.

What are you configure options? What does your config.log say?
Comment 2 Khem Raj 2015-02-19 03:23:26 UTC
-msse -mno-sse works fine however
Error happens when one used -mfpmath=sse in CFLAGS, Since we are explicitly
disabling SSE we very well might disable SSE for fpmath as well.

a patch like this works for me

diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 19f5eca..827ea71 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -1,6 +1,6 @@
 ifeq ($(subdir),elf)
 CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-                  -mno-sse -mno-mmx)
+                  -mno-sse -mno-mmx -mfpmath=387)
 
 tests-special += $(objpfx)tst-ld-sse-use.out
 $(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so
Comment 3 Vyacheslav Barinov 2015-03-01 19:20:16 UTC
Hello,

  I'm very sorry, just found an e-mail under the mount of others.
  The environment is Tizen 3.0:
https://build.tizen.org/package/show?package=glibc&project=devel%3Aarm_toolchain%3AMobile%3ATizen_Common
  I've imported patch from Khem Raj and it worked perfectly. Thank you
for answers.

Best Regards,
Slava Barinov.


On Thu, Feb 19, 2015 at 6:23 AM, raj.khem at gmail dot com
<sourceware-bugzilla@sourceware.org> wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=17950
>
> Khem Raj <raj.khem at gmail dot com> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |raj.khem at gmail dot com
>
> --- Comment #2 from Khem Raj <raj.khem at gmail dot com> ---
> -msse -mno-sse works fine however
> Error happens when one used -mfpmath=sse in CFLAGS, Since we are explicitly
> disabling SSE we very well might disable SSE for fpmath as well.
>
> a patch like this works for me
>
> diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
> index 19f5eca..827ea71 100644
> --- a/sysdeps/x86/Makefile
> +++ b/sysdeps/x86/Makefile
> @@ -1,6 +1,6 @@
>  ifeq ($(subdir),elf)
>  CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
> -                  -mno-sse -mno-mmx)
> +                  -mno-sse -mno-mmx -mfpmath=387)
>
>  tests-special += $(objpfx)tst-ld-sse-use.out
>  $(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 4 Mike Frysinger 2016-04-10 02:16:15 UTC
pushed Khem's patch into master now