stages/*: change license to Apache 2.0
[dragora.git] / patches / gcc / 0001-libgcc_s.patch
blob103e4b5b7f35535fdb6f50fe055b61b27d26d4aa
1 From f09a0caf978b7aca4a95dd96bc0bdcd9016b933d Mon Sep 17 00:00:00 2001
2 From: Szabolcs Nagy <nsz@port70.net>
3 Date: Sat, 20 Aug 2016 21:16:00 +0000
4 Subject: [PATCH 1/8] libgcc_s
6 ---
7 gcc/config/i386/i386.c | 4 ++--
8 libgcc/config/i386/cpuinfo.c | 6 +++---
9 libgcc/config/i386/t-linux | 2 +-
10 3 files changed, 6 insertions(+), 6 deletions(-)
12 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
13 index 2639c8c..88c7ebe 100644
14 --- a/gcc/config/i386/i386.c
15 +++ b/gcc/config/i386/i386.c
16 @@ -36049,10 +36049,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
18 case IX86_BUILTIN_CPU_INIT:
20 - /* Make it call __cpu_indicator_init in libgcc. */
21 + /* Make it call __cpu_indicator_init_local in libgcc.a. */
22 tree call_expr, fndecl, type;
23 type = build_function_type_list (integer_type_node, NULL_TREE);
24 - fndecl = build_fn_decl ("__cpu_indicator_init", type);
25 + fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
26 call_expr = build_call_expr (fndecl, 0);
27 return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
29 diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
30 index 8c2248d..6c82f15 100644
31 --- a/libgcc/config/i386/cpuinfo.c
32 +++ b/libgcc/config/i386/cpuinfo.c
33 @@ -485,7 +485,7 @@ __cpu_indicator_init (void)
34 return 0;
37 -#if defined SHARED && defined USE_ELF_SYMVER
38 -__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
39 -__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
40 +#ifndef SHARED
41 +int __cpu_indicator_init_local (void)
42 + __attribute__ ((weak, alias ("__cpu_indicator_init")));
43 #endif
44 diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
45 index 11bb46e..4f47f7b 100644
46 --- a/libgcc/config/i386/t-linux
47 +++ b/libgcc/config/i386/t-linux
48 @@ -3,4 +3,4 @@
49 # t-slibgcc-elf-ver and t-linux
50 SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
52 -HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER
53 +HOST_LIBGCC2_CFLAGS += -mlong-double-80
54 --
55 2.8.1