From b72e71a39c33fac823b8f65f43aa15a8bb0ae676 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 27 Jul 2018 14:40:47 +0000 Subject: i386: Remove _Unwind_Frames_Increment CET kernel has been changed to place a restore token on shadow stack for signal handler to enhance security. It is usually transparent to user programs since kernel will pop the restore token when signal handler returns. But when an exception is thrown from a signal handler, now we need to remove _Unwind_Frames_Increment to pop the the restore token from shadow stack. Otherwise, we get FAIL: g++.dg/torture/pr85334.C -O0 execution test FAIL: g++.dg/torture/pr85334.C -O1 execution test FAIL: g++.dg/torture/pr85334.C -O2 execution test FAIL: g++.dg/torture/pr85334.C -O3 -g execution test FAIL: g++.dg/torture/pr85334.C -Os execution test FAIL: g++.dg/torture/pr85334.C -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test PR libgcc/85334 * config/i386/shadow-stack-unwind.h (_Unwind_Frames_Increment): Removed. From-SVN: r263030 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/i386/shadow-stack-unwind.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c13bf4c..e0db8d1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-07-27 H.J. Lu + + PR libgcc/85334 + * config/i386/shadow-stack-unwind.h (_Unwind_Frames_Increment): + Removed. + 2018-07-05 James Clarke * configure: Regenerated. diff --git a/libgcc/config/i386/shadow-stack-unwind.h b/libgcc/config/i386/shadow-stack-unwind.h index a32f3e7..40f48df 100644 --- a/libgcc/config/i386/shadow-stack-unwind.h +++ b/libgcc/config/i386/shadow-stack-unwind.h @@ -49,8 +49,3 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see } \ } \ while (0) - -/* Increment frame count. Skip signal frames. */ -#undef _Unwind_Frames_Increment -#define _Unwind_Frames_Increment(context, frames) \ - if (!_Unwind_IsSignalFrame (context)) frames++ -- cgit v1.1 From b74159752d6c1f955660e829a17e1aad1cead348 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 30 Jul 2018 12:51:42 +0000 Subject: [ARM] libgcc: Fix comment for code working on architectures >= 4. 2018-07-30 Christophe Lyon * config/arm/ieee754-df.S: Fix comment for code working on architectures >= 4. * config/arm/ieee754-sf.S: Likewise. From-SVN: r263066 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/arm/ieee754-df.S | 2 +- libgcc/config/arm/ieee754-sf.S | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e0db8d1..b8f85b6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-07-30 Christophe Lyon + + * config/arm/ieee754-df.S: Fix comment for code working on + architectures >= 4. + * config/arm/ieee754-sf.S: Likewise. + 2018-07-27 H.J. Lu PR libgcc/85334 diff --git a/libgcc/config/arm/ieee754-df.S b/libgcc/config/arm/ieee754-df.S index 8741aa9..7f2afb2 100644 --- a/libgcc/config/arm/ieee754-df.S +++ b/libgcc/config/arm/ieee754-df.S @@ -657,7 +657,7 @@ ARM_FUNC_ALIAS aeabi_dmul muldf3 beq LSYM(Lml_1) @ Here is the actual multiplication. - @ This code works on architecture versions > 4 + @ This code works on architecture versions >= 4 umull ip, lr, xl, yl mov r5, #0 umlal lr, r5, xh, yl diff --git a/libgcc/config/arm/ieee754-sf.S b/libgcc/config/arm/ieee754-sf.S index d80d5e9..e8ee76e 100644 --- a/libgcc/config/arm/ieee754-sf.S +++ b/libgcc/config/arm/ieee754-sf.S @@ -461,7 +461,7 @@ LSYM(Lml_x): orr r1, r3, r1, lsr #5 @ The actual multiplication. - @ This code works on architecture versions > 4 + @ This code works on architecture versions >= 4 umull r3, r1, r0, r1 @ Put final sign in r0. -- cgit v1.1 From fd2e1dcd253d34aeca751518970c20cc3e9a8716 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 1 Aug 2018 12:22:18 +0200 Subject: __gcov_indirect_call_callee can't be null in __gcov_indirect_call_profiler_v2. 2018-08-01 Martin Liska * libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not check that __gcov_indirect_call_callee is non-null. From-SVN: r263202 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-profiler.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b8f85b6..4f8ddce 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-08-01 Martin Liska + + * libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not + check that __gcov_indirect_call_callee is non-null. + 2018-07-30 Christophe Lyon * config/arm/ieee754-df.S: Fix comment for code working on diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 596b35b..7e208d7 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -333,7 +333,7 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ if (cur_func == __gcov_indirect_call_callee - || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && __gcov_indirect_call_callee + || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && *(void **) cur_func == *(void **) __gcov_indirect_call_callee)) __gcov_one_value_profiler_body (__gcov_indirect_call_counters, value, 0); -- cgit v1.1 From 89fff9cc2bb4f789afe9d99986222e36f23c848b Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Thu, 2 Aug 2018 16:50:07 +0000 Subject: arm - correctly handle denormal results during softfp subtraction 2018-08-02 Nicolas Pitre PR libgcc/86512 * config/arm/ieee754-df.S (adddf3): Don't shortcut denormal handling when exponent goes negative. Update my email address. * config/arm/ieee754-sf.S (addsf3): Likewise. From-SVN: r263267 --- libgcc/ChangeLog | 7 +++++++ libgcc/config/arm/ieee754-df.S | 9 +++++---- libgcc/config/arm/ieee754-sf.S | 11 ++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 4f8ddce..bfdda6e 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2018-08-02 Nicolas Pitre + + PR libgcc/86512 + * config/arm/ieee754-df.S: Don't shortcut denormal handling when + exponent goes negative. Update my email address. + * config/arm/ieee754-sf.S: Likewise. + 2018-08-01 Martin Liska * libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not diff --git a/libgcc/config/arm/ieee754-df.S b/libgcc/config/arm/ieee754-df.S index 7f2afb2..480e33d 100644 --- a/libgcc/config/arm/ieee754-df.S +++ b/libgcc/config/arm/ieee754-df.S @@ -1,7 +1,7 @@ /* ieee754-df.S double-precision floating point support for ARM Copyright (C) 2003-2018 Free Software Foundation, Inc. - Contributed by Nicolas Pitre (nico@cam.org) + Contributed by Nicolas Pitre (nico@fluxnic.net) This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -238,9 +238,10 @@ LSYM(Lad_a): movs ip, ip, lsl #1 adcs xl, xl, xl adc xh, xh, xh - tst xh, #0x00100000 - sub r4, r4, #1 - bne LSYM(Lad_e) + subs r4, r4, #1 + do_it hs + cmphs xh, #0x00100000 + bhs LSYM(Lad_e) @ No rounding necessary since ip will always be 0 at this point. LSYM(Lad_l): diff --git a/libgcc/config/arm/ieee754-sf.S b/libgcc/config/arm/ieee754-sf.S index e8ee76e..28e0d79 100644 --- a/libgcc/config/arm/ieee754-sf.S +++ b/libgcc/config/arm/ieee754-sf.S @@ -1,7 +1,7 @@ /* ieee754-sf.S single-precision floating point support for ARM Copyright (C) 2003-2018 Free Software Foundation, Inc. - Contributed by Nicolas Pitre (nico@cam.org) + Contributed by Nicolas Pitre (nico@fluxnic.net) This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -168,10 +168,11 @@ LSYM(Lad_e): LSYM(Lad_a): movs r1, r1, lsl #1 adc r0, r0, r0 - tst r0, #0x00800000 - sub r2, r2, #1 - bne LSYM(Lad_e) - + subs r2, r2, #1 + do_it hs + cmphs r0, #0x00800000 + bhs LSYM(Lad_e) + @ No rounding necessary since r1 will always be 0 at this point. LSYM(Lad_l): -- cgit v1.1 From 2b1969f6355abca6017fc817524a7d3cbd07f923 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 11 Aug 2018 21:37:55 +0000 Subject: pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum. gcc * config/pa/pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum. Update comment for atomic instructions. (atomic_storeqi, atomic_storehi, atomic_storesi, atomic_storesf, atomic_loaddf, atomic_loaddf_1, atomic_storedf, atomic_storedf_1): Remove. (atomic_loaddi): Revise fence expansion to only emit fence prior to load for __ATOMIC_SEQ_CST model. (atomic_loaddi_1): Remove float register target. (atomic_storedi): Handle CONST_INT values. (atomic_storedi_1): Remove float register source. Add special case for zero value. (memory_barrier): New expander and insn. libgcc * config/pa/linux-atomic.c: Update comment. (FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD, COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4, SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use __ATOMIC_RELAXED for atomic loads. (SYNC_LOCK_RELEASE_1): New define. Use __sync_synchronize() and unordered store to release lock. (__sync_lock_release_8): Likewise. (SYNC_LOCK_RELEASE_2): Remove define. From-SVN: r263488 --- libgcc/ChangeLog | 12 ++++++++ libgcc/config/pa/linux-atomic.c | 66 +++++++++++++++++------------------------ 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index bfdda6e..084131a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,15 @@ +2018-08-11 John David Anglin + + * config/pa/linux-atomic.c: Update comment. + (FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD, + COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4, + SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use + __ATOMIC_RELAXED for atomic loads. + (SYNC_LOCK_RELEASE_1): New define. Use __sync_synchronize() and + unordered store to release lock. + (__sync_lock_release_8): Likewise. + (SYNC_LOCK_RELEASE_2): Remove define. + 2018-08-02 Nicolas Pitre PR libgcc/86512 diff --git a/libgcc/config/pa/linux-atomic.c b/libgcc/config/pa/linux-atomic.c index 79c89e1..ddd0b1e 100644 --- a/libgcc/config/pa/linux-atomic.c +++ b/libgcc/config/pa/linux-atomic.c @@ -28,14 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define EBUSY 16 #define ENOSYS 251 -/* All PA-RISC implementations supported by linux have strongly - ordered loads and stores. Only cache flushes and purges can be - delayed. The data cache implementations are all globally - coherent. Thus, there is no need to synchonize memory accesses. - - GCC automatically issues a asm memory barrier when it encounters - a __sync_synchronize builtin. Thus, we do not need to define this - builtin. +/* PA-RISC 2.0 supports out-of-order execution for loads and stores. + Thus, we need to synchonize memory accesses. For more info, see: + "Advanced Performance Features of the 64-bit PA-8000" by Doug Hunt. We implement byte, short and int versions of each atomic operation using the kernel helper defined below. There is no support for @@ -119,7 +114,7 @@ __kernel_cmpxchg2 (void *mem, const void *oldval, const void *newval, long failure; \ \ do { \ - tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + tmp = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ newval = PFX_OP (tmp INF_OP val); \ failure = __kernel_cmpxchg2 (ptr, &tmp, &newval, INDEX); \ } while (failure != 0); \ @@ -156,7 +151,7 @@ FETCH_AND_OP_2 (nand, ~, &, signed char, 1, 0) long failure; \ \ do { \ - tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + tmp = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ newval = PFX_OP (tmp INF_OP val); \ failure = __kernel_cmpxchg2 (ptr, &tmp, &newval, INDEX); \ } while (failure != 0); \ @@ -193,7 +188,7 @@ OP_AND_FETCH_2 (nand, ~, &, signed char, 1, 0) long failure; \ \ do { \ - tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + tmp = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ failure = __kernel_cmpxchg (ptr, tmp, PFX_OP (tmp INF_OP val)); \ } while (failure != 0); \ \ @@ -215,7 +210,7 @@ FETCH_AND_OP_WORD (nand, ~, &) long failure; \ \ do { \ - tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + tmp = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ failure = __kernel_cmpxchg (ptr, tmp, PFX_OP (tmp INF_OP val)); \ } while (failure != 0); \ \ @@ -241,7 +236,7 @@ typedef unsigned char bool; \ while (1) \ { \ - actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + actual_oldval = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ \ if (__builtin_expect (oldval != actual_oldval, 0)) \ return actual_oldval; \ @@ -273,7 +268,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) while (1) { - actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); + actual_oldval = __atomic_load_n (ptr, __ATOMIC_RELAXED); if (__builtin_expect (oldval != actual_oldval, 0)) return actual_oldval; @@ -300,7 +295,7 @@ TYPE HIDDEN \ long failure; \ \ do { \ - oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ + oldval = __atomic_load_n (ptr, __ATOMIC_RELAXED); \ failure = __kernel_cmpxchg2 (ptr, &oldval, &val, INDEX); \ } while (failure != 0); \ \ @@ -318,38 +313,31 @@ __sync_lock_test_and_set_4 (int *ptr, int val) int oldval; do { - oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); + oldval = __atomic_load_n (ptr, __ATOMIC_RELAXED); failure = __kernel_cmpxchg (ptr, oldval, val); } while (failure != 0); return oldval; } -#define SYNC_LOCK_RELEASE_2(TYPE, WIDTH, INDEX) \ +void HIDDEN +__sync_lock_release_8 (long long *ptr) +{ + /* All accesses must be complete before we release the lock. */ + __sync_synchronize (); + *(double *)ptr = 0; +} + +#define SYNC_LOCK_RELEASE_1(TYPE, WIDTH) \ void HIDDEN \ __sync_lock_release_##WIDTH (TYPE *ptr) \ { \ - TYPE oldval, zero = 0; \ - long failure; \ - \ - do { \ - oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \ - failure = __kernel_cmpxchg2 (ptr, &oldval, &zero, INDEX); \ - } while (failure != 0); \ + /* All accesses must be complete before we release \ + the lock. */ \ + __sync_synchronize (); \ + *ptr = 0; \ } -SYNC_LOCK_RELEASE_2 (long long, 8, 3) -SYNC_LOCK_RELEASE_2 (short, 2, 1) -SYNC_LOCK_RELEASE_2 (signed char, 1, 0) - -void HIDDEN -__sync_lock_release_4 (int *ptr) -{ - long failure; - int oldval; - - do { - oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); - failure = __kernel_cmpxchg (ptr, oldval, 0); - } while (failure != 0); -} +SYNC_LOCK_RELEASE_1 (int, 4) +SYNC_LOCK_RELEASE_1 (short, 2) +SYNC_LOCK_RELEASE_1 (signed char, 1) -- cgit v1.1 From a49317452416282f4cb4da0149754c58d87b2241 Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Sun, 12 Aug 2018 07:38:40 +0000 Subject: [NDS32] Implement more C ISR extension. gcc/ * config.gcc (nds32*): Add nds32_isr.h and nds32_init.inc in extra_headers. * common/config/nds32/nds32-common.c (nds32_handle_option): Handle OPT_misr_secure_ case. * config/nds32/nds32-isr.c: Implementation of backward compatibility. * config/nds32/nds32-protos.h (nds32_isr_function_critical_p): New. * config/nds32/nds32.c (nds32_attribute_table): Add critical and secure attribute. * config/nds32/nds32.h (nds32_isr_nested_type): Add NDS32_CRITICAL. (nds32_isr_info): New field security_level. (TARGET_ISR_VECTOR_SIZE_4_BYTE): New macro. * config/nds32/nds32.md (return_internal): Consider critical attribute. * config/nds32/nds32.opt (misr-secure): New option. * config/nds32/nds32_init.inc: New file. * config/nds32/nds32_isr.h: New file. libgcc/ * config/nds32/t-nds32-isr: Rearrange object dependency. * config/nds32/initfini.c: Add dwarf2 unwinding support. * config/nds32/isr-library/adj_intr_lvl.inc: Consider new extensions and registers usage. * config/nds32/isr-library/excp_isr.S: Ditto. * config/nds32/isr-library/intr_isr.S: Ditto. * config/nds32/isr-library/reset.S: Ditto. * config/nds32/isr-library/restore_all.inc: Ditto. * config/nds32/isr-library/restore_mac_regs.inc: Ditto. * config/nds32/isr-library/restore_partial.inc: Ditto. * config/nds32/isr-library/restore_usr_regs.inc: Ditto. * config/nds32/isr-library/save_all.inc: Ditto. * config/nds32/isr-library/save_mac_regs.inc: Ditto. * config/nds32/isr-library/save_partial.inc: Ditto. * config/nds32/isr-library/save_usr_regs.inc: Ditto. * config/nds32/isr-library/vec_vid*.S: Consider 4-byte vector size. From-SVN: r263493 --- libgcc/ChangeLog | 19 ++++ libgcc/config/nds32/initfini.c | 84 ++++++++++++++-- libgcc/config/nds32/isr-library/adj_intr_lvl.inc | 13 +++ libgcc/config/nds32/isr-library/excp_isr.S | 55 +++++----- libgcc/config/nds32/isr-library/intr_isr.S | 67 +++++++----- libgcc/config/nds32/isr-library/reset.S | 81 +++++++++------ libgcc/config/nds32/isr-library/restore_all.inc | 10 +- .../config/nds32/isr-library/restore_mac_regs.inc | 2 +- .../config/nds32/isr-library/restore_partial.inc | 12 +-- .../config/nds32/isr-library/restore_usr_regs.inc | 42 ++++++++ libgcc/config/nds32/isr-library/save_all.inc | 43 ++++---- libgcc/config/nds32/isr-library/save_mac_regs.inc | 2 +- libgcc/config/nds32/isr-library/save_partial.inc | 46 ++++----- libgcc/config/nds32/isr-library/save_usr_regs.inc | 44 ++++++++ libgcc/config/nds32/isr-library/vec_vid00.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid01.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid02.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid03.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid04.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid05.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid06.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid07.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid08.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid09.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid10.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid11.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid12.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid13.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid14.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid15.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid16.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid17.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid18.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid19.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid20.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid21.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid22.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid23.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid24.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid25.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid26.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid27.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid28.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid29.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid30.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid31.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid32.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid33.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid34.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid35.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid36.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid37.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid38.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid39.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid40.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid41.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid42.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid43.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid44.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid45.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid46.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid47.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid48.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid49.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid50.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid51.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid52.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid53.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid54.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid55.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid56.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid57.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid58.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid59.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid60.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid61.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid62.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid63.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid64.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid65.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid66.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid67.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid68.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid69.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid70.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid71.S | 7 ++ libgcc/config/nds32/isr-library/vec_vid72.S | 7 ++ libgcc/config/nds32/t-nds32-isr | 112 +++++---------------- 88 files changed, 902 insertions(+), 241 deletions(-) create mode 100644 libgcc/config/nds32/isr-library/restore_usr_regs.inc create mode 100644 libgcc/config/nds32/isr-library/save_usr_regs.inc (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 084131a..d499020 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,22 @@ +2018-08-12 Chung-Ju Wu + + * config/nds32/t-nds32-isr: Rearrange object dependency. + * config/nds32/initfini.c: Add dwarf2 unwinding support. + * config/nds32/isr-library/adj_intr_lvl.inc: Consider new extensions + and registers usage. + * config/nds32/isr-library/excp_isr.S: Ditto. + * config/nds32/isr-library/intr_isr.S: Ditto. + * config/nds32/isr-library/reset.S: Ditto. + * config/nds32/isr-library/restore_all.inc: Ditto. + * config/nds32/isr-library/restore_mac_regs.inc: Ditto. + * config/nds32/isr-library/restore_partial.inc: Ditto. + * config/nds32/isr-library/restore_usr_regs.inc: Ditto. + * config/nds32/isr-library/save_all.inc: Ditto. + * config/nds32/isr-library/save_mac_regs.inc: Ditto. + * config/nds32/isr-library/save_partial.inc: Ditto. + * config/nds32/isr-library/save_usr_regs.inc: Ditto. + * config/nds32/isr-library/vec_vid*.S: Consider 4-byte vector size. + 2018-08-11 John David Anglin * config/pa/linux-atomic.c: Update comment. diff --git a/libgcc/config/nds32/initfini.c b/libgcc/config/nds32/initfini.c index 49ca44f..dfbcc43 100644 --- a/libgcc/config/nds32/initfini.c +++ b/libgcc/config/nds32/initfini.c @@ -25,6 +25,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include +/* Need header file for `struct object' type. */ +#include "../libgcc/unwind-dw2-fde.h" + /* Declare a pointer to void function type. */ typedef void (*func_ptr) (void); @@ -42,11 +46,59 @@ typedef void (*func_ptr) (void); refer to only the __CTOR_END__ symbol in crtfini.o and the __DTOR_LIST__ symbol in crtinit.o, where they are defined. */ -static func_ptr __CTOR_LIST__[1] __attribute__ ((section (".ctors"))) - = { (func_ptr) (-1) }; +static func_ptr __CTOR_LIST__[1] __attribute__ ((section (".ctors"), used)) + = { (func_ptr) 0 }; + +static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors"), used)) + = { (func_ptr) 0 }; + + +#ifdef SUPPORT_UNWINDING_DWARF2 +/* Preparation of exception handling with dwar2 mechanism registration. */ -static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors"))) - = { (func_ptr) (-1) }; +asm ("\n\ + .section .eh_frame,\"aw\",@progbits\n\ + .global __EH_FRAME_BEGIN__\n\ + .type __EH_FRAME_BEGIN__, @object\n\ + .align 2\n\ +__EH_FRAME_BEGIN__:\n\ + ! Beginning location of eh_frame section\n\ + .previous\n\ +"); + +extern func_ptr __EH_FRAME_BEGIN__[]; + + +/* Note that the following two functions are going to be chained into + constructor and destructor list, repectively. So these two declarations + must be placed after __CTOR_LIST__ and __DTOR_LIST. */ +extern void __nds32_register_eh(void) __attribute__((constructor, used)); +extern void __nds32_deregister_eh(void) __attribute__((destructor, used)); + +/* Register the exception handling table as the first constructor. */ +void +__nds32_register_eh (void) +{ + static struct object object; + if (__register_frame_info) + __register_frame_info (__EH_FRAME_BEGIN__, &object); +} + +/* Unregister the exception handling table as a deconstructor. */ +void +__nds32_deregister_eh (void) +{ + static int completed = 0; + + if (completed) + return; + + if (__deregister_frame_info) + __deregister_frame_info (__EH_FRAME_BEGIN__); + + completed = 1; +} +#endif /* Run all the global destructors on exit from the program. */ @@ -63,7 +115,7 @@ static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors"))) same particular root executable or shared library file. */ static void __do_global_dtors (void) -asm ("__do_global_dtors") __attribute__ ((section (".text"))); +asm ("__do_global_dtors") __attribute__ ((section (".text"), used)); static void __do_global_dtors (void) @@ -116,23 +168,37 @@ void *__dso_handle = 0; last, these words naturally end up at the very ends of the two lists contained in these two sections. */ -static func_ptr __CTOR_END__[1] __attribute__ ((section (".ctors"))) +static func_ptr __CTOR_END__[1] __attribute__ ((section (".ctors"), used)) = { (func_ptr) 0 }; -static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors"))) +static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors"), used)) = { (func_ptr) 0 }; +#ifdef SUPPORT_UNWINDING_DWARF2 +/* ZERO terminator in .eh_frame section. */ +asm ("\n\ + .section .eh_frame,\"aw\",@progbits\n\ + .global __EH_FRAME_END__\n\ + .type __EH_FRAME_END__, @object\n\ + .align 2\n\ +__EH_FRAME_END__:\n\ + ! End location of eh_frame section with ZERO terminator\n\ + .word 0\n\ + .previous\n\ +"); +#endif + /* Run all global constructors for the program. Note that they are run in reverse order. */ static void __do_global_ctors (void) -asm ("__do_global_ctors") __attribute__ ((section (".text"))); +asm ("__do_global_ctors") __attribute__ ((section (".text"), used)); static void __do_global_ctors (void) { func_ptr *p; - for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) + for (p = __CTOR_END__ - 1; *p; p--) (*p) (); } diff --git a/libgcc/config/nds32/isr-library/adj_intr_lvl.inc b/libgcc/config/nds32/isr-library/adj_intr_lvl.inc index 5cc1a6f..275e558 100644 --- a/libgcc/config/nds32/isr-library/adj_intr_lvl.inc +++ b/libgcc/config/nds32/isr-library/adj_intr_lvl.inc @@ -26,13 +26,26 @@ .macro ADJ_INTR_LVL #if defined(NDS32_NESTED) /* Nested handler. */ mfsr $r3, $PSW + /* By substracting 1 from $PSW, we can lower PSW.INTL + and enable GIE simultaneously. */ addi $r3, $r3, #-0x1 + #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__ + ori $r3, $r3, 0x2000 /* Set PSW.AEN(b'13) */ + #endif mtsr $r3, $PSW #elif defined(NDS32_NESTED_READY) /* Nested ready handler. */ /* Save ipc and ipsw and lower INT level. */ mfsr $r3, $PSW addi $r3, $r3, #-0x2 + #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__ + ori $r3, $r3, 0x2000 /* Set PSW.AEN(b'13) */ + #endif mtsr $r3, $PSW #else /* Not nested handler. */ + #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__ + mfsr $r3, $PSW + ori $r3, $r3, 0x2000 /* Set PSW.AEN(b'13) */ + mtsr $r3, $PSW + #endif #endif .endm diff --git a/libgcc/config/nds32/isr-library/excp_isr.S b/libgcc/config/nds32/isr-library/excp_isr.S index f24f856..6e7de5f8 100644 --- a/libgcc/config/nds32/isr-library/excp_isr.S +++ b/libgcc/config/nds32/isr-library/excp_isr.S @@ -23,6 +23,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "save_usr_regs.inc" #include "save_mac_regs.inc" #include "save_fpu_regs.inc" #include "save_fpu_regs_00.inc" @@ -32,35 +33,33 @@ #include "save_all.inc" #include "save_partial.inc" #include "adj_intr_lvl.inc" -#include "restore_mac_regs.inc" #include "restore_fpu_regs_00.inc" #include "restore_fpu_regs_01.inc" #include "restore_fpu_regs_02.inc" #include "restore_fpu_regs_03.inc" #include "restore_fpu_regs.inc" +#include "restore_mac_regs.inc" +#include "restore_usr_regs.inc" #include "restore_all.inc" #include "restore_partial.inc" + .section .nds32_isr, "ax" /* Put it in the section of 1st level handler. */ .align 1 -/* - First Level Handlers - 1. First Level Handlers are invokded in vector section via jump instruction - with specific names for different configurations. - 2. Naming Format: _nds32_e_SR_NT for exception handlers. - _nds32_i_SR_NT for interrupt handlers. - 2.1 All upper case letters are replaced with specific lower case letters encodings. - 2.2 SR: Saved Registers - sa: Save All regs (context) - ps: Partial Save (all caller-saved regs) - 2.3 NT: Nested Type - ns: nested - nn: not nested - nr: nested ready -*/ - -/* - This is original 16-byte vector size version. -*/ + +/* First Level Handlers + 1. First Level Handlers are invokded in vector section via jump instruction + with specific names for different configurations. + 2. Naming Format: _nds32_e_SR_NT for exception handlers. + _nds32_i_SR_NT for interrupt handlers. + 2.1 All upper case letters are replaced with specific lower case letters encodings. + 2.2 SR -- Saved Registers + sa: Save All regs (context) + ps: Partial Save (all caller-saved regs) + 2.3 NT -- Nested Type + ns: nested + nn: not nested + nr: nested ready */ + #ifdef NDS32_SAVE_ALL_REGS #if defined(NDS32_NESTED) .globl _nds32_e_sa_ns @@ -91,21 +90,26 @@ _nds32_e_ps_nn: #endif /* endif for Nest Type */ #endif /* not NDS32_SAVE_ALL_REGS */ -/* - This is 16-byte vector size version. - The vector id was restored into $r0 in vector by compiler. -*/ + +/* For 4-byte vector size version, the vector id is + extracted from $ITYPE and is set into $r0 by library. + For 16-byte vector size version, the vector id + is set into $r0 in vector section by compiler. */ + +/* Save used registers. */ #ifdef NDS32_SAVE_ALL_REGS SAVE_ALL #else SAVE_PARTIAL #endif + /* Prepare to call 2nd level handler. */ la $r2, _nds32_jmptbl_00 lw $r2, [$r2 + $r0 << #2] ADJ_INTR_LVL /* Adjust INTR level. $r3 is clobbered. */ jral $r2 - /* Restore used registers. */ + +/* Restore used registers. */ #ifdef NDS32_SAVE_ALL_REGS RESTORE_ALL #else @@ -113,6 +117,7 @@ _nds32_e_ps_nn: #endif iret + #ifdef NDS32_SAVE_ALL_REGS #if defined(NDS32_NESTED) .size _nds32_e_sa_ns, .-_nds32_e_sa_ns diff --git a/libgcc/config/nds32/isr-library/intr_isr.S b/libgcc/config/nds32/isr-library/intr_isr.S index 0431ac1..23ffa10 100644 --- a/libgcc/config/nds32/isr-library/intr_isr.S +++ b/libgcc/config/nds32/isr-library/intr_isr.S @@ -23,6 +23,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "save_usr_regs.inc" #include "save_mac_regs.inc" #include "save_fpu_regs.inc" #include "save_fpu_regs_00.inc" @@ -32,35 +33,33 @@ #include "save_all.inc" #include "save_partial.inc" #include "adj_intr_lvl.inc" -#include "restore_mac_regs.inc" #include "restore_fpu_regs_00.inc" #include "restore_fpu_regs_01.inc" #include "restore_fpu_regs_02.inc" #include "restore_fpu_regs_03.inc" #include "restore_fpu_regs.inc" +#include "restore_mac_regs.inc" +#include "restore_usr_regs.inc" #include "restore_all.inc" #include "restore_partial.inc" + .section .nds32_isr, "ax" /* Put it in the section of 1st level handler. */ .align 1 -/* - First Level Handlers - 1. First Level Handlers are invokded in vector section via jump instruction - with specific names for different configurations. - 2. Naming Format: _nds32_e_SR_NT for exception handlers. - _nds32_i_SR_NT for interrupt handlers. - 2.1 All upper case letters are replaced with specific lower case letters encodings. - 2.2 SR: Saved Registers - sa: Save All regs (context) - ps: Partial Save (all caller-saved regs) - 2.3 NT: Nested Type - ns: nested - nn: not nested - nr: nested ready -*/ - -/* - This is original 16-byte vector size version. -*/ + +/* First Level Handlers + 1. First Level Handlers are invokded in vector section via jump instruction + with specific names for different configurations. + 2. Naming Format: _nds32_e_SR_NT for exception handlers. + _nds32_i_SR_NT for interrupt handlers. + 2.1 All upper case letters are replaced with specific lower case letters encodings. + 2.2 SR -- Saved Registers + sa: Save All regs (context) + ps: Partial Save (all caller-saved regs) + 2.3 NT -- Nested Type + ns: nested + nn: not nested + nr: nested ready */ + #ifdef NDS32_SAVE_ALL_REGS #if defined(NDS32_NESTED) .globl _nds32_i_sa_ns @@ -91,21 +90,36 @@ _nds32_i_ps_nn: #endif /* endif for Nest Type */ #endif /* not NDS32_SAVE_ALL_REGS */ -/* - This is 16-byte vector size version. - The vector id was restored into $r0 in vector by compiler. -*/ + +/* For 4-byte vector size version, the vector id is + extracted from $ITYPE and is set into $r0 by library. + For 16-byte vector size version, the vector id + is set into $r0 in vector section by compiler. */ + +/* Save used registers first. */ #ifdef NDS32_SAVE_ALL_REGS SAVE_ALL #else SAVE_PARTIAL #endif - /* Prepare to call 2nd level handler. */ + +/* According to vector size, we need to have different implementation. */ +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* Prepare to call 2nd level handler. */ + la $r2, _nds32_jmptbl_00 + lw $r2, [$r2 + $r0 << #2] + addi $r0, $r0, #-9 /* Make interrput vector id zero-based. */ + ADJ_INTR_LVL /* Adjust INTR level. $r3 is clobbered. */ + jral $r2 +#else /* not __NDS32_ISR_VECTOR_SIZE_4__ */ + /* Prepare to call 2nd level handler. */ la $r2, _nds32_jmptbl_09 /* For zero-based vcetor id. */ lw $r2, [$r2 + $r0 << #2] ADJ_INTR_LVL /* Adjust INTR level. $r3 is clobbered. */ jral $r2 - /* Restore used registers. */ +#endif /* not __NDS32_ISR_VECTOR_SIZE_4__ */ + +/* Restore used registers. */ #ifdef NDS32_SAVE_ALL_REGS RESTORE_ALL #else @@ -113,6 +127,7 @@ _nds32_i_ps_nn: #endif iret + #ifdef NDS32_SAVE_ALL_REGS #if defined(NDS32_NESTED) .size _nds32_i_sa_ns, .-_nds32_i_sa_ns diff --git a/libgcc/config/nds32/isr-library/reset.S b/libgcc/config/nds32/isr-library/reset.S index 78abeb2..2ac247e 100644 --- a/libgcc/config/nds32/isr-library/reset.S +++ b/libgcc/config/nds32/isr-library/reset.S @@ -26,22 +26,18 @@ .section .nds32_isr, "ax" /* Put it in the section of 1st level handler. */ .align 1 .weak _SDA_BASE_ /* For reset handler only. */ - .weak _FP_BASE_ /* For reset handler only. */ .weak _nds32_init_mem /* User defined memory initialization function. */ .globl _start .globl _nds32_reset .type _nds32_reset, @function _nds32_reset: _start: -#ifdef NDS32_EXT_EX9 - .no_ex9_begin -#endif /* Handle NMI and warm boot if any of them exists. */ beqz $sp, 1f /* Reset, NMI or warm boot? */ /* Either NMI or warm boot; save all regs. */ /* Preserve registers for context-switching. */ -#ifdef __NDS32_REDUCED_REGS__ +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS /* For 16-reg mode. */ smw.adm $r0, [$sp], $r10, #0x0 smw.adm $r15, [$sp], $r15, #0xf @@ -49,10 +45,9 @@ _start: /* For 32-reg mode. */ smw.adm $r0, [$sp], $r27, #0xf #endif -#ifdef NDS32_EXT_IFC +#if __NDS32_EXT_IFC__ mfusr $r1, $IFC_LP - smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep - stack 8-byte alignment. */ + smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep stack 8-byte alignment. */ #endif la $gp, _SDA_BASE_ /* Init GP for small data access. */ @@ -71,12 +66,11 @@ _start: bnez $r0, 1f /* If fail to resume, do cold boot. */ /* Restore registers for context-switching. */ -#ifdef NDS32_EXT_IFC - lmw.bim $r1, [$sp], $r2, #0x0 /* Restore extra $r2 to keep - stack 8-byte alignment. */ +#if __NDS32_EXT_IFC__ + lmw.bim $r1, [$sp], $r2, #0x0 /* Restore extra $r2 to keep stack 8-byte alignment. */ mtusr $r1, $IFC_LP #endif -#ifdef __NDS32_REDUCED_REGS__ +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS /* For 16-reg mode. */ lmw.bim $r15, [$sp], $r15, #0xf lmw.bim $r0, [$sp], $r10, #0x0 @@ -88,6 +82,17 @@ _start: 1: /* Cold boot. */ +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* With vector ID feature for v3 architecture, default vector size is 4-byte. */ + /* Set IVB.ESZ = 0 (vector table entry size = 4 bytes) */ + mfsr $r0, $IVB + li $r1, #0xc000 + or $r0, $r0, $r1 + xor $r0, $r0, $r1 + mtsr $r0, $IVB + dsb +#else + /* There is no vector ID feature, so the vector size must be 16-byte. */ /* Set IVB.ESZ = 1 (vector table entry size = 16 bytes) */ mfsr $r0, $IVB li $r1, #0xffff3fff @@ -95,36 +100,54 @@ _start: ori $r0, $r0, #0x4000 mtsr $r0, $IVB dsb +#endif la $gp, _SDA_BASE_ /* Init $gp. */ - la $fp, _FP_BASE_ /* Init $fp. */ la $sp, _stack /* Init $sp. */ -#ifdef NDS32_EXT_EX9 -/* - * Initialize the table base of EX9 instruction - * ex9 generation needs to disable before the ITB is set - */ - mfsr $r0, $MSC_CFG /* Check if HW support of EX9. */ + +#if __NDS32_EXT_EX9__ +.L_init_itb: + /* Initialization for Instruction Table Base (ITB). + The symbol _ITB_BASE_ is determined by Linker. + Set $ITB only if MSC_CFG.EIT (cr4.b'24) is set. */ + mfsr $r0, $MSC_CFG srli $r0, $r0, 24 andi $r0, $r0, 0x1 - beqz $r0, 4f /* Zero means HW does not support EX9. */ - la $r0, _ITB_BASE_ /* Init $ITB. */ + beqz $r0, 4f /* Fall through ? */ + la $r0, _ITB_BASE_ mtusr $r0, $ITB - .no_ex9_end 4: #endif - la $r15, _nds32_init_mem /* Call DRAM init. _nds32_init_mem - may written by C language. */ + +#if __NDS32_EXT_FPU_SP__ || __NDS32_EXT_FPU_DP__ +.L_init_fpu: + /* Initialize FPU + Set FUCOP_CTL.CP0EN (fucpr.b'0). */ + mfsr $r0, $FUCOP_CTL + ori $r0, $r0, 0x1 + mtsr $r0, $FUCOP_CTL + dsb + /* According to [bugzilla #9425], set flush-to-zero mode. + That is, set $FPCSR.DNZ(b'12) = 1. */ + FMFCSR $r0 + ori $r0, $r0, 0x1000 + FMTCSR $r0 + dsb +#endif + + /* Call DRAM init. _nds32_init_mem may written by C language. */ + la $r15, _nds32_init_mem beqz $r15, 6f jral $r15 6: l.w $r15, _nds32_jmptbl_00 /* Load reset handler. */ jral $r15 -/* Reset handler() should never return in a RTOS or non-OS system. - In case it does return, an exception will be generated. - This exception will be caught either by default break handler or by EDM. - Default break handle may just do an infinite loop. - EDM will notify GDB and GDB will regain control when the ID is 0x7fff. */ + + /* Reset handler() should never return in a RTOS or non-OS system. + In case it does return, an exception will be generated. + This exception will be caught either by default break handler or by EDM. + Default break handle may just do an infinite loop. + EDM will notify GDB and GDB will regain control when the ID is 0x7fff. */ 5: break #0x7fff .size _nds32_reset, .-_nds32_reset diff --git a/libgcc/config/nds32/isr-library/restore_all.inc b/libgcc/config/nds32/isr-library/restore_all.inc index 7455646..23cdf8c 100644 --- a/libgcc/config/nds32/isr-library/restore_all.inc +++ b/libgcc/config/nds32/isr-library/restore_all.inc @@ -31,15 +31,11 @@ mtsr $r2, $IPSW RESTORE_FPU_REGS RESTORE_MAC_REGS -#ifdef NDS32_EXT_IFC - lmw.bim $r1, [$sp], $r2, #0x0 /* Restore extra $r2 to keep - stack 8-byte alignment. */ - mtusr $r1, $IFC_LP -#endif -#ifdef __NDS32_REDUCED_REGS__ + RESTORE_USR_REGS +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS lmw.bim $r0, [$sp], $r10, #0x0 /* Restore all regs. */ lmw.bim $r15, [$sp], $r15, #0xf -#else /* not __NDS32_REDUCED_REGS__ */ +#else lmw.bim $r0, [$sp], $r27, #0xf /* Restore all regs. */ #endif .endm diff --git a/libgcc/config/nds32/isr-library/restore_mac_regs.inc b/libgcc/config/nds32/isr-library/restore_mac_regs.inc index 1e6aac6..a434083 100644 --- a/libgcc/config/nds32/isr-library/restore_mac_regs.inc +++ b/libgcc/config/nds32/isr-library/restore_mac_regs.inc @@ -24,7 +24,7 @@ . */ .macro RESTORE_MAC_REGS -#ifdef NDS32_DX_REGS +#if __NDS32_DX_REGS__ lmw.bim $r1, [$sp], $r4, #0x0 mtusr $r1, $d0.lo mtusr $r2, $d0.hi diff --git a/libgcc/config/nds32/isr-library/restore_partial.inc b/libgcc/config/nds32/isr-library/restore_partial.inc index d406a99..c43ad16 100644 --- a/libgcc/config/nds32/isr-library/restore_partial.inc +++ b/libgcc/config/nds32/isr-library/restore_partial.inc @@ -31,15 +31,11 @@ mtsr $r1, $IPC /* Set IPC. */ mtsr $r2, $IPSW /* Set IPSW. */ #endif - RESTORE_FPU_REGS - RESTORE_MAC_REGS -#ifdef NDS32_EXT_IFC - lmw.bim $r1, [$sp], $r2, #0x0 /* Restore extra $r2 to keep - stack 8-byte alignment. */ - mtusr $r1, $IFC_LP -#endif + RESTORE_FPU_REGS + RESTORE_MAC_REGS + RESTORE_USR_REGS lmw.bim $r0, [$sp], $r5, #0x0 /* Restore all regs. */ -#ifdef __NDS32_REDUCED_REGS__ +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS lmw.bim $r15, [$sp], $r15, #0x2 #else lmw.bim $r15, [$sp], $r27, #0x2 /* Restore all regs. */ diff --git a/libgcc/config/nds32/isr-library/restore_usr_regs.inc b/libgcc/config/nds32/isr-library/restore_usr_regs.inc new file mode 100644 index 0000000..9602c74 --- /dev/null +++ b/libgcc/config/nds32/isr-library/restore_usr_regs.inc @@ -0,0 +1,42 @@ +/* c-isr library stuff of Andes NDS32 cpu for GNU compiler + Copyright (C) 2012-2018 Free Software Foundation, Inc. + Contributed by Andes Technology Corporation. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +.macro RESTORE_USR_REGS +#if __NDS32_EXT_IFC__ && (__NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__) + lmw.bim $r1, [$sp], $r4, #0x0 + mtusr $r1, $IFC_LP + mtusr $r2, $LB + mtusr $r3, $LE + mtusr $r4, $LC +#elif __NDS32_EXT_IFC__ + lmw.bim $r1, [$sp], $r2, #0x0 + mtusr $r1, $IFC_LP +#elif __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__ + lmw.bim $r1, [$sp], $r4, #0x0 + mtusr $r1, $LB + mtusr $r2, $LE + mtusr $r3, $LC +#endif +.endm diff --git a/libgcc/config/nds32/isr-library/save_all.inc b/libgcc/config/nds32/isr-library/save_all.inc index fa08b39..8886edb 100644 --- a/libgcc/config/nds32/isr-library/save_all.inc +++ b/libgcc/config/nds32/isr-library/save_all.inc @@ -23,45 +23,42 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -.macro SAVE_ALL_4B -#ifdef __NDS32_REDUCED_REGS__ +#if __NDS32_ISR_VECTOR_SIZE_4__ + +/* If vector size is 4-byte, we have to save registers + in the macro implementation. */ +.macro SAVE_ALL +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS smw.adm $r15, [$sp], $r15, #0xf smw.adm $r0, [$sp], $r10, #0x0 -#else /* not __NDS32_REDUCED_REGS__ */ +#else smw.adm $r0, [$sp], $r27, #0xf -#endif /* not __NDS32_REDUCED_REGS__ */ -#ifdef NDS32_EXT_IFC - mfusr $r1, $IFC_LP - smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep - stack 8-byte alignment. */ #endif - SAVE_MAC_REGS - SAVE_FPU_REGS + SAVE_USR_REGS + SAVE_MAC_REGS + SAVE_FPU_REGS mfsr $r1, $IPC /* Get IPC. */ mfsr $r2, $IPSW /* Get IPSW. */ smw.adm $r1, [$sp], $r2, #0x0 /* Push IPC, IPSW. */ move $r1, $sp /* $r1 is ptr to NDS32_CONTEXT. */ mfsr $r0, $ITYPE /* Get VID to $r0. */ srli $r0, $r0, #5 -#ifdef __NDS32_ISA_V2__ andi $r0, $r0, #127 -#else - fexti33 $r0, #6 -#endif .endm +#else /* not __NDS32_ISR_VECTOR_SIZE_4__ */ + +/* If vector size is 16-byte, some works can be done in + the vector section generated by compiler, so that we + can implement less in the macro. */ .macro SAVE_ALL -/* SAVE_REG_TBL code has been moved to - vector table generated by compiler. */ -#ifdef NDS32_EXT_IFC - mfusr $r1, $IFC_LP - smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep - stack 8-byte alignment. */ -#endif - SAVE_MAC_REGS - SAVE_FPU_REGS + SAVE_USR_REGS + SAVE_MAC_REGS + SAVE_FPU_REGS mfsr $r1, $IPC /* Get IPC. */ mfsr $r2, $IPSW /* Get IPSW. */ smw.adm $r1, [$sp], $r2, #0x0 /* Push IPC, IPSW. */ move $r1, $sp /* $r1 is ptr to NDS32_CONTEXT. */ .endm + +#endif /* not __NDS32_ISR_VECTOR_SIZE_4__ */ diff --git a/libgcc/config/nds32/isr-library/save_mac_regs.inc b/libgcc/config/nds32/isr-library/save_mac_regs.inc index ff120e8..a6a9230 100644 --- a/libgcc/config/nds32/isr-library/save_mac_regs.inc +++ b/libgcc/config/nds32/isr-library/save_mac_regs.inc @@ -24,7 +24,7 @@ . */ .macro SAVE_MAC_REGS -#ifdef NDS32_DX_REGS +#if __NDS32_DX_REGS__ mfusr $r1, $d0.lo mfusr $r2, $d0.hi mfusr $r3, $d1.lo diff --git a/libgcc/config/nds32/isr-library/save_partial.inc b/libgcc/config/nds32/isr-library/save_partial.inc index 2445e48..c81ebaa 100644 --- a/libgcc/config/nds32/isr-library/save_partial.inc +++ b/libgcc/config/nds32/isr-library/save_partial.inc @@ -23,20 +23,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -.macro SAVE_PARTIAL_4B -#ifdef __NDS32_REDUCED_REGS__ +#if __NDS32_ISR_VECTOR_SIZE_4__ + +/* If vector size is 4-byte, we have to save registers + in the macro implementation. */ +.macro SAVE_PARTIAL +#if __NDS32_REDUCED_REGS__ || __NDS32_REDUCE_REGS smw.adm $r15, [$sp], $r15, #0x2 -#else /* not __NDS32_REDUCED_REGS__ */ +#else smw.adm $r15, [$sp], $r27, #0x2 -#endif /* not __NDS32_REDUCED_REGS__ */ - smw.adm $r0, [$sp], $r5, #0x0 -#ifdef NDS32_EXT_IFC - mfusr $r1, $IFC_LP - smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep - stack 8-byte alignment. */ #endif - SAVE_MAC_REGS - SAVE_FPU_REGS + smw.adm $r0, [$sp], $r5, #0x0 + SAVE_USR_REGS + SAVE_MAC_REGS + SAVE_FPU_REGS #if defined(NDS32_NESTED) || defined(NDS32_NESTED_READY) mfsr $r1, $IPC /* Get IPC. */ mfsr $r2, $IPSW /* Get IPSW. */ @@ -44,26 +44,24 @@ #endif mfsr $r0, $ITYPE /* Get VID to $r0. */ srli $r0, $r0, #5 -#ifdef __NDS32_ISA_V2__ andi $r0, $r0, #127 -#else - fexti33 $r0, #6 -#endif .endm +#else /* not __NDS32_ISR_VECTOR_SIZE_4__ */ + +/* If vector size is 16-byte, some works can be done in + the vector section generated by compiler, so that we + can implement less in the macro. */ + .macro SAVE_PARTIAL -/* SAVE_CALLER_REGS code has been moved to - vector table generated by compiler. */ -#ifdef NDS32_EXT_IFC - mfusr $r1, $IFC_LP - smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep - stack 8-byte alignment. */ -#endif - SAVE_MAC_REGS - SAVE_FPU_REGS + SAVE_USR_REGS + SAVE_MAC_REGS + SAVE_FPU_REGS #if defined(NDS32_NESTED) || defined(NDS32_NESTED_READY) mfsr $r1, $IPC /* Get IPC. */ mfsr $r2, $IPSW /* Get IPSW. */ smw.adm $r1, [$sp], $r2, #0x0 /* Push IPC, IPSW. */ #endif .endm + +#endif /* not __NDS32_ISR_VECTOR_SIZE_4__ */ diff --git a/libgcc/config/nds32/isr-library/save_usr_regs.inc b/libgcc/config/nds32/isr-library/save_usr_regs.inc new file mode 100644 index 0000000..5a3f618 --- /dev/null +++ b/libgcc/config/nds32/isr-library/save_usr_regs.inc @@ -0,0 +1,44 @@ +/* c-isr library stuff of Andes NDS32 cpu for GNU compiler + Copyright (C) 2012-2018 Free Software Foundation, Inc. + Contributed by Andes Technology Corporation. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +.macro SAVE_USR_REGS +/* Store User Special Registers according to supported ISA extension + !!! WATCH OUT !!! Take care of 8-byte alignment issue. */ +#if __NDS32_EXT_IFC__ && (__NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__) + mfusr $r1, $IFC_LP + mfusr $r2, $LB + mfusr $r3, $LE + mfusr $r4, $LC + smw.adm $r1, [$sp], $r4, #0x0 /* Save even. Ok! */ +#elif __NDS32_EXT_IFC__ + mfusr $r1, $IFC_LP + smw.adm $r1, [$sp], $r2, #0x0 /* Save extra $r2 to keep stack 8-byte aligned. */ +#elif (__NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__) + mfusr $r1, $LB + mfusr $r2, $LE + mfusr $r3, $LC + smw.adm $r1, [$sp], $r4, #0x0 /* Save extra $r4 to keep stack 8-byte aligned. */ +#endif +.endm diff --git a/libgcc/config/nds32/isr-library/vec_vid00.S b/libgcc/config/nds32/isr-library/vec_vid00.S index b2a645c..643009e 100644 --- a/libgcc/config/nds32/isr-library/vec_vid00.S +++ b/libgcc/config/nds32/isr-library/vec_vid00.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.00, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_00 .type _nds32_vector_00, @function _nds32_vector_00: diff --git a/libgcc/config/nds32/isr-library/vec_vid01.S b/libgcc/config/nds32/isr-library/vec_vid01.S index 9e796c7..fd9bc8b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid01.S +++ b/libgcc/config/nds32/isr-library/vec_vid01.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.01, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_01 .type _nds32_vector_01, @function _nds32_vector_01: diff --git a/libgcc/config/nds32/isr-library/vec_vid02.S b/libgcc/config/nds32/isr-library/vec_vid02.S index a6b34b7..c5a8843 100644 --- a/libgcc/config/nds32/isr-library/vec_vid02.S +++ b/libgcc/config/nds32/isr-library/vec_vid02.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.02, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_02 .type _nds32_vector_02, @function _nds32_vector_02: diff --git a/libgcc/config/nds32/isr-library/vec_vid03.S b/libgcc/config/nds32/isr-library/vec_vid03.S index 680f6d9..7f11fb9 100644 --- a/libgcc/config/nds32/isr-library/vec_vid03.S +++ b/libgcc/config/nds32/isr-library/vec_vid03.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.03, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_03 .type _nds32_vector_03, @function _nds32_vector_03: diff --git a/libgcc/config/nds32/isr-library/vec_vid04.S b/libgcc/config/nds32/isr-library/vec_vid04.S index f0b616c..de2e249 100644 --- a/libgcc/config/nds32/isr-library/vec_vid04.S +++ b/libgcc/config/nds32/isr-library/vec_vid04.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.04, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_04 .type _nds32_vector_04, @function _nds32_vector_04: diff --git a/libgcc/config/nds32/isr-library/vec_vid05.S b/libgcc/config/nds32/isr-library/vec_vid05.S index 47cbcea..62e1cda 100644 --- a/libgcc/config/nds32/isr-library/vec_vid05.S +++ b/libgcc/config/nds32/isr-library/vec_vid05.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.05, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_05 .type _nds32_vector_05, @function _nds32_vector_05: diff --git a/libgcc/config/nds32/isr-library/vec_vid06.S b/libgcc/config/nds32/isr-library/vec_vid06.S index 851836c..e41a60c 100644 --- a/libgcc/config/nds32/isr-library/vec_vid06.S +++ b/libgcc/config/nds32/isr-library/vec_vid06.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.06, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_06 .type _nds32_vector_06, @function _nds32_vector_06: diff --git a/libgcc/config/nds32/isr-library/vec_vid07.S b/libgcc/config/nds32/isr-library/vec_vid07.S index 664ee0c..b5447a8 100644 --- a/libgcc/config/nds32/isr-library/vec_vid07.S +++ b/libgcc/config/nds32/isr-library/vec_vid07.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.07, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_07 .type _nds32_vector_07, @function _nds32_vector_07: diff --git a/libgcc/config/nds32/isr-library/vec_vid08.S b/libgcc/config/nds32/isr-library/vec_vid08.S index 1b5534c..2c07dd3 100644 --- a/libgcc/config/nds32/isr-library/vec_vid08.S +++ b/libgcc/config/nds32/isr-library/vec_vid08.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.08, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_08 .type _nds32_vector_08, @function _nds32_vector_08: diff --git a/libgcc/config/nds32/isr-library/vec_vid09.S b/libgcc/config/nds32/isr-library/vec_vid09.S index 81a5675..e858cea 100644 --- a/libgcc/config/nds32/isr-library/vec_vid09.S +++ b/libgcc/config/nds32/isr-library/vec_vid09.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.09, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_09 .type _nds32_vector_09, @function _nds32_vector_09: diff --git a/libgcc/config/nds32/isr-library/vec_vid10.S b/libgcc/config/nds32/isr-library/vec_vid10.S index 102f7cf..e8bbc0b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid10.S +++ b/libgcc/config/nds32/isr-library/vec_vid10.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.10, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_10 .type _nds32_vector_10, @function _nds32_vector_10: diff --git a/libgcc/config/nds32/isr-library/vec_vid11.S b/libgcc/config/nds32/isr-library/vec_vid11.S index ade2ee5..92aebb4 100644 --- a/libgcc/config/nds32/isr-library/vec_vid11.S +++ b/libgcc/config/nds32/isr-library/vec_vid11.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.11, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_11 .type _nds32_vector_11, @function _nds32_vector_11: diff --git a/libgcc/config/nds32/isr-library/vec_vid12.S b/libgcc/config/nds32/isr-library/vec_vid12.S index a595811..6fd050a 100644 --- a/libgcc/config/nds32/isr-library/vec_vid12.S +++ b/libgcc/config/nds32/isr-library/vec_vid12.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.12, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_12 .type _nds32_vector_12, @function _nds32_vector_12: diff --git a/libgcc/config/nds32/isr-library/vec_vid13.S b/libgcc/config/nds32/isr-library/vec_vid13.S index 55863be..0a45c45 100644 --- a/libgcc/config/nds32/isr-library/vec_vid13.S +++ b/libgcc/config/nds32/isr-library/vec_vid13.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.13, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_13 .type _nds32_vector_13, @function _nds32_vector_13: diff --git a/libgcc/config/nds32/isr-library/vec_vid14.S b/libgcc/config/nds32/isr-library/vec_vid14.S index abe7f42..837b848 100644 --- a/libgcc/config/nds32/isr-library/vec_vid14.S +++ b/libgcc/config/nds32/isr-library/vec_vid14.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.14, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_14 .type _nds32_vector_14, @function _nds32_vector_14: diff --git a/libgcc/config/nds32/isr-library/vec_vid15.S b/libgcc/config/nds32/isr-library/vec_vid15.S index 890819f..c639aa4 100644 --- a/libgcc/config/nds32/isr-library/vec_vid15.S +++ b/libgcc/config/nds32/isr-library/vec_vid15.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.15, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_15 .type _nds32_vector_15, @function _nds32_vector_15: diff --git a/libgcc/config/nds32/isr-library/vec_vid16.S b/libgcc/config/nds32/isr-library/vec_vid16.S index 20db625..a762130 100644 --- a/libgcc/config/nds32/isr-library/vec_vid16.S +++ b/libgcc/config/nds32/isr-library/vec_vid16.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.16, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_16 .type _nds32_vector_16, @function _nds32_vector_16: diff --git a/libgcc/config/nds32/isr-library/vec_vid17.S b/libgcc/config/nds32/isr-library/vec_vid17.S index c1ca9f6..b17681f 100644 --- a/libgcc/config/nds32/isr-library/vec_vid17.S +++ b/libgcc/config/nds32/isr-library/vec_vid17.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.17, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_17 .type _nds32_vector_17, @function _nds32_vector_17: diff --git a/libgcc/config/nds32/isr-library/vec_vid18.S b/libgcc/config/nds32/isr-library/vec_vid18.S index ef4cbee..4166fa1 100644 --- a/libgcc/config/nds32/isr-library/vec_vid18.S +++ b/libgcc/config/nds32/isr-library/vec_vid18.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.18, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_18 .type _nds32_vector_18, @function _nds32_vector_18: diff --git a/libgcc/config/nds32/isr-library/vec_vid19.S b/libgcc/config/nds32/isr-library/vec_vid19.S index 5efab98..0d7d1de 100644 --- a/libgcc/config/nds32/isr-library/vec_vid19.S +++ b/libgcc/config/nds32/isr-library/vec_vid19.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.19, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_19 .type _nds32_vector_19, @function _nds32_vector_19: diff --git a/libgcc/config/nds32/isr-library/vec_vid20.S b/libgcc/config/nds32/isr-library/vec_vid20.S index 95e1247..d39d74b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid20.S +++ b/libgcc/config/nds32/isr-library/vec_vid20.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.20, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_20 .type _nds32_vector_20, @function _nds32_vector_20: diff --git a/libgcc/config/nds32/isr-library/vec_vid21.S b/libgcc/config/nds32/isr-library/vec_vid21.S index f3f401e..deff0cf 100644 --- a/libgcc/config/nds32/isr-library/vec_vid21.S +++ b/libgcc/config/nds32/isr-library/vec_vid21.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.21, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_21 .type _nds32_vector_21, @function _nds32_vector_21: diff --git a/libgcc/config/nds32/isr-library/vec_vid22.S b/libgcc/config/nds32/isr-library/vec_vid22.S index 28d0d99..ebd3891 100644 --- a/libgcc/config/nds32/isr-library/vec_vid22.S +++ b/libgcc/config/nds32/isr-library/vec_vid22.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.22, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_22 .type _nds32_vector_22, @function _nds32_vector_22: diff --git a/libgcc/config/nds32/isr-library/vec_vid23.S b/libgcc/config/nds32/isr-library/vec_vid23.S index a824629..90562e7 100644 --- a/libgcc/config/nds32/isr-library/vec_vid23.S +++ b/libgcc/config/nds32/isr-library/vec_vid23.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.23, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_23 .type _nds32_vector_23, @function _nds32_vector_23: diff --git a/libgcc/config/nds32/isr-library/vec_vid24.S b/libgcc/config/nds32/isr-library/vec_vid24.S index 2c0e2d8..7bd344c 100644 --- a/libgcc/config/nds32/isr-library/vec_vid24.S +++ b/libgcc/config/nds32/isr-library/vec_vid24.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.24, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_24 .type _nds32_vector_24, @function _nds32_vector_24: diff --git a/libgcc/config/nds32/isr-library/vec_vid25.S b/libgcc/config/nds32/isr-library/vec_vid25.S index 56f7886..245db6e 100644 --- a/libgcc/config/nds32/isr-library/vec_vid25.S +++ b/libgcc/config/nds32/isr-library/vec_vid25.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.25, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_25 .type _nds32_vector_25, @function _nds32_vector_25: diff --git a/libgcc/config/nds32/isr-library/vec_vid26.S b/libgcc/config/nds32/isr-library/vec_vid26.S index b02163e..4df61ff 100644 --- a/libgcc/config/nds32/isr-library/vec_vid26.S +++ b/libgcc/config/nds32/isr-library/vec_vid26.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.26, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_26 .type _nds32_vector_26, @function _nds32_vector_26: diff --git a/libgcc/config/nds32/isr-library/vec_vid27.S b/libgcc/config/nds32/isr-library/vec_vid27.S index 276d1f0..50960db 100644 --- a/libgcc/config/nds32/isr-library/vec_vid27.S +++ b/libgcc/config/nds32/isr-library/vec_vid27.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.27, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_27 .type _nds32_vector_27, @function _nds32_vector_27: diff --git a/libgcc/config/nds32/isr-library/vec_vid28.S b/libgcc/config/nds32/isr-library/vec_vid28.S index 59e8cc2..e44adbb 100644 --- a/libgcc/config/nds32/isr-library/vec_vid28.S +++ b/libgcc/config/nds32/isr-library/vec_vid28.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.28, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_28 .type _nds32_vector_28, @function _nds32_vector_28: diff --git a/libgcc/config/nds32/isr-library/vec_vid29.S b/libgcc/config/nds32/isr-library/vec_vid29.S index 7119e25..f7e6c77 100644 --- a/libgcc/config/nds32/isr-library/vec_vid29.S +++ b/libgcc/config/nds32/isr-library/vec_vid29.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.29, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_29 .type _nds32_vector_29, @function _nds32_vector_29: diff --git a/libgcc/config/nds32/isr-library/vec_vid30.S b/libgcc/config/nds32/isr-library/vec_vid30.S index 7c7bd5f..7fac25d 100644 --- a/libgcc/config/nds32/isr-library/vec_vid30.S +++ b/libgcc/config/nds32/isr-library/vec_vid30.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.30, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_30 .type _nds32_vector_30, @function _nds32_vector_30: diff --git a/libgcc/config/nds32/isr-library/vec_vid31.S b/libgcc/config/nds32/isr-library/vec_vid31.S index bd29e03..5857765 100644 --- a/libgcc/config/nds32/isr-library/vec_vid31.S +++ b/libgcc/config/nds32/isr-library/vec_vid31.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.31, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_31 .type _nds32_vector_31, @function _nds32_vector_31: diff --git a/libgcc/config/nds32/isr-library/vec_vid32.S b/libgcc/config/nds32/isr-library/vec_vid32.S index 57b8db0..bcd5dbf 100644 --- a/libgcc/config/nds32/isr-library/vec_vid32.S +++ b/libgcc/config/nds32/isr-library/vec_vid32.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.32, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_32 .type _nds32_vector_32, @function _nds32_vector_32: diff --git a/libgcc/config/nds32/isr-library/vec_vid33.S b/libgcc/config/nds32/isr-library/vec_vid33.S index 609735e..abfed4e 100644 --- a/libgcc/config/nds32/isr-library/vec_vid33.S +++ b/libgcc/config/nds32/isr-library/vec_vid33.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.33, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_33 .type _nds32_vector_33, @function _nds32_vector_33: diff --git a/libgcc/config/nds32/isr-library/vec_vid34.S b/libgcc/config/nds32/isr-library/vec_vid34.S index 2a91328..f9446bb 100644 --- a/libgcc/config/nds32/isr-library/vec_vid34.S +++ b/libgcc/config/nds32/isr-library/vec_vid34.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.34, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_34 .type _nds32_vector_34, @function _nds32_vector_34: diff --git a/libgcc/config/nds32/isr-library/vec_vid35.S b/libgcc/config/nds32/isr-library/vec_vid35.S index 65dd081..8862137 100644 --- a/libgcc/config/nds32/isr-library/vec_vid35.S +++ b/libgcc/config/nds32/isr-library/vec_vid35.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.35, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_35 .type _nds32_vector_35, @function _nds32_vector_35: diff --git a/libgcc/config/nds32/isr-library/vec_vid36.S b/libgcc/config/nds32/isr-library/vec_vid36.S index fa47b8e..dbcbbf4 100644 --- a/libgcc/config/nds32/isr-library/vec_vid36.S +++ b/libgcc/config/nds32/isr-library/vec_vid36.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.36, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_36 .type _nds32_vector_36, @function _nds32_vector_36: diff --git a/libgcc/config/nds32/isr-library/vec_vid37.S b/libgcc/config/nds32/isr-library/vec_vid37.S index ece8456..392f18b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid37.S +++ b/libgcc/config/nds32/isr-library/vec_vid37.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.37, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_37 .type _nds32_vector_37, @function _nds32_vector_37: diff --git a/libgcc/config/nds32/isr-library/vec_vid38.S b/libgcc/config/nds32/isr-library/vec_vid38.S index c4a12f5..efe6619 100644 --- a/libgcc/config/nds32/isr-library/vec_vid38.S +++ b/libgcc/config/nds32/isr-library/vec_vid38.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.38, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_38 .type _nds32_vector_38, @function _nds32_vector_38: diff --git a/libgcc/config/nds32/isr-library/vec_vid39.S b/libgcc/config/nds32/isr-library/vec_vid39.S index b3e56ed..238c43a 100644 --- a/libgcc/config/nds32/isr-library/vec_vid39.S +++ b/libgcc/config/nds32/isr-library/vec_vid39.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.39, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_39 .type _nds32_vector_39, @function _nds32_vector_39: diff --git a/libgcc/config/nds32/isr-library/vec_vid40.S b/libgcc/config/nds32/isr-library/vec_vid40.S index 01364aa..cf3eaa2 100644 --- a/libgcc/config/nds32/isr-library/vec_vid40.S +++ b/libgcc/config/nds32/isr-library/vec_vid40.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.40, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_40 .type _nds32_vector_40, @function _nds32_vector_40: diff --git a/libgcc/config/nds32/isr-library/vec_vid41.S b/libgcc/config/nds32/isr-library/vec_vid41.S index f20beec..27b7aac 100644 --- a/libgcc/config/nds32/isr-library/vec_vid41.S +++ b/libgcc/config/nds32/isr-library/vec_vid41.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.41, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_41 .type _nds32_vector_41, @function _nds32_vector_41: diff --git a/libgcc/config/nds32/isr-library/vec_vid42.S b/libgcc/config/nds32/isr-library/vec_vid42.S index 6c29f1f..bfeed46 100644 --- a/libgcc/config/nds32/isr-library/vec_vid42.S +++ b/libgcc/config/nds32/isr-library/vec_vid42.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.42, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_42 .type _nds32_vector_42, @function _nds32_vector_42: diff --git a/libgcc/config/nds32/isr-library/vec_vid43.S b/libgcc/config/nds32/isr-library/vec_vid43.S index 8767f99..54640c9 100644 --- a/libgcc/config/nds32/isr-library/vec_vid43.S +++ b/libgcc/config/nds32/isr-library/vec_vid43.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.43, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_43 .type _nds32_vector_43, @function _nds32_vector_43: diff --git a/libgcc/config/nds32/isr-library/vec_vid44.S b/libgcc/config/nds32/isr-library/vec_vid44.S index 8b6f53d..f617243 100644 --- a/libgcc/config/nds32/isr-library/vec_vid44.S +++ b/libgcc/config/nds32/isr-library/vec_vid44.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.44, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_44 .type _nds32_vector_44, @function _nds32_vector_44: diff --git a/libgcc/config/nds32/isr-library/vec_vid45.S b/libgcc/config/nds32/isr-library/vec_vid45.S index 52e344b..2cfeb78 100644 --- a/libgcc/config/nds32/isr-library/vec_vid45.S +++ b/libgcc/config/nds32/isr-library/vec_vid45.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.45, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_45 .type _nds32_vector_45, @function _nds32_vector_45: diff --git a/libgcc/config/nds32/isr-library/vec_vid46.S b/libgcc/config/nds32/isr-library/vec_vid46.S index f9dc0d1..45c8847 100644 --- a/libgcc/config/nds32/isr-library/vec_vid46.S +++ b/libgcc/config/nds32/isr-library/vec_vid46.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.46, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_46 .type _nds32_vector_46, @function _nds32_vector_46: diff --git a/libgcc/config/nds32/isr-library/vec_vid47.S b/libgcc/config/nds32/isr-library/vec_vid47.S index 436e7e3..25469e4 100644 --- a/libgcc/config/nds32/isr-library/vec_vid47.S +++ b/libgcc/config/nds32/isr-library/vec_vid47.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.47, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_47 .type _nds32_vector_47, @function _nds32_vector_47: diff --git a/libgcc/config/nds32/isr-library/vec_vid48.S b/libgcc/config/nds32/isr-library/vec_vid48.S index 219dfd4..5a00119 100644 --- a/libgcc/config/nds32/isr-library/vec_vid48.S +++ b/libgcc/config/nds32/isr-library/vec_vid48.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.48, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_48 .type _nds32_vector_48, @function _nds32_vector_48: diff --git a/libgcc/config/nds32/isr-library/vec_vid49.S b/libgcc/config/nds32/isr-library/vec_vid49.S index e3ba753..dfe11f1 100644 --- a/libgcc/config/nds32/isr-library/vec_vid49.S +++ b/libgcc/config/nds32/isr-library/vec_vid49.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.49, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_49 .type _nds32_vector_49, @function _nds32_vector_49: diff --git a/libgcc/config/nds32/isr-library/vec_vid50.S b/libgcc/config/nds32/isr-library/vec_vid50.S index b0b3fc2..0dacd26 100644 --- a/libgcc/config/nds32/isr-library/vec_vid50.S +++ b/libgcc/config/nds32/isr-library/vec_vid50.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.50, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_50 .type _nds32_vector_50, @function _nds32_vector_50: diff --git a/libgcc/config/nds32/isr-library/vec_vid51.S b/libgcc/config/nds32/isr-library/vec_vid51.S index bf3011d..5ab28ef 100644 --- a/libgcc/config/nds32/isr-library/vec_vid51.S +++ b/libgcc/config/nds32/isr-library/vec_vid51.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.51, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_51 .type _nds32_vector_51, @function _nds32_vector_51: diff --git a/libgcc/config/nds32/isr-library/vec_vid52.S b/libgcc/config/nds32/isr-library/vec_vid52.S index eaf5f14..ed00f40 100644 --- a/libgcc/config/nds32/isr-library/vec_vid52.S +++ b/libgcc/config/nds32/isr-library/vec_vid52.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.52, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_52 .type _nds32_vector_52, @function _nds32_vector_52: diff --git a/libgcc/config/nds32/isr-library/vec_vid53.S b/libgcc/config/nds32/isr-library/vec_vid53.S index 3f92e56..564cadb 100644 --- a/libgcc/config/nds32/isr-library/vec_vid53.S +++ b/libgcc/config/nds32/isr-library/vec_vid53.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.53, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_53 .type _nds32_vector_53, @function _nds32_vector_53: diff --git a/libgcc/config/nds32/isr-library/vec_vid54.S b/libgcc/config/nds32/isr-library/vec_vid54.S index f22793f..377c524 100644 --- a/libgcc/config/nds32/isr-library/vec_vid54.S +++ b/libgcc/config/nds32/isr-library/vec_vid54.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.54, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_54 .type _nds32_vector_54, @function _nds32_vector_54: diff --git a/libgcc/config/nds32/isr-library/vec_vid55.S b/libgcc/config/nds32/isr-library/vec_vid55.S index 1017130..497252a 100644 --- a/libgcc/config/nds32/isr-library/vec_vid55.S +++ b/libgcc/config/nds32/isr-library/vec_vid55.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.55, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_55 .type _nds32_vector_55, @function _nds32_vector_55: diff --git a/libgcc/config/nds32/isr-library/vec_vid56.S b/libgcc/config/nds32/isr-library/vec_vid56.S index a0923e9..b62534b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid56.S +++ b/libgcc/config/nds32/isr-library/vec_vid56.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.56, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_56 .type _nds32_vector_56, @function _nds32_vector_56: diff --git a/libgcc/config/nds32/isr-library/vec_vid57.S b/libgcc/config/nds32/isr-library/vec_vid57.S index e711b89..b1bb42d 100644 --- a/libgcc/config/nds32/isr-library/vec_vid57.S +++ b/libgcc/config/nds32/isr-library/vec_vid57.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.57, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_57 .type _nds32_vector_57, @function _nds32_vector_57: diff --git a/libgcc/config/nds32/isr-library/vec_vid58.S b/libgcc/config/nds32/isr-library/vec_vid58.S index f8d9064..14595a5 100644 --- a/libgcc/config/nds32/isr-library/vec_vid58.S +++ b/libgcc/config/nds32/isr-library/vec_vid58.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.58, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_58 .type _nds32_vector_58, @function _nds32_vector_58: diff --git a/libgcc/config/nds32/isr-library/vec_vid59.S b/libgcc/config/nds32/isr-library/vec_vid59.S index 58fb6e6..e5be177 100644 --- a/libgcc/config/nds32/isr-library/vec_vid59.S +++ b/libgcc/config/nds32/isr-library/vec_vid59.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.59, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_59 .type _nds32_vector_59, @function _nds32_vector_59: diff --git a/libgcc/config/nds32/isr-library/vec_vid60.S b/libgcc/config/nds32/isr-library/vec_vid60.S index 94aa6e0..f6df971 100644 --- a/libgcc/config/nds32/isr-library/vec_vid60.S +++ b/libgcc/config/nds32/isr-library/vec_vid60.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.60, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_60 .type _nds32_vector_60, @function _nds32_vector_60: diff --git a/libgcc/config/nds32/isr-library/vec_vid61.S b/libgcc/config/nds32/isr-library/vec_vid61.S index 869f6c8..4f97b04 100644 --- a/libgcc/config/nds32/isr-library/vec_vid61.S +++ b/libgcc/config/nds32/isr-library/vec_vid61.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.61, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_61 .type _nds32_vector_61, @function _nds32_vector_61: diff --git a/libgcc/config/nds32/isr-library/vec_vid62.S b/libgcc/config/nds32/isr-library/vec_vid62.S index acc846c..08d1bbb 100644 --- a/libgcc/config/nds32/isr-library/vec_vid62.S +++ b/libgcc/config/nds32/isr-library/vec_vid62.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.62, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_62 .type _nds32_vector_62, @function _nds32_vector_62: diff --git a/libgcc/config/nds32/isr-library/vec_vid63.S b/libgcc/config/nds32/isr-library/vec_vid63.S index d0727ec..2b2068c 100644 --- a/libgcc/config/nds32/isr-library/vec_vid63.S +++ b/libgcc/config/nds32/isr-library/vec_vid63.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.63, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_63 .type _nds32_vector_63, @function _nds32_vector_63: diff --git a/libgcc/config/nds32/isr-library/vec_vid64.S b/libgcc/config/nds32/isr-library/vec_vid64.S index cb1659a..2c06ea0 100644 --- a/libgcc/config/nds32/isr-library/vec_vid64.S +++ b/libgcc/config/nds32/isr-library/vec_vid64.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.64, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_64 .type _nds32_vector_64, @function _nds32_vector_64: diff --git a/libgcc/config/nds32/isr-library/vec_vid65.S b/libgcc/config/nds32/isr-library/vec_vid65.S index da46481..d2359fd 100644 --- a/libgcc/config/nds32/isr-library/vec_vid65.S +++ b/libgcc/config/nds32/isr-library/vec_vid65.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.65, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_65 .type _nds32_vector_65, @function _nds32_vector_65: diff --git a/libgcc/config/nds32/isr-library/vec_vid66.S b/libgcc/config/nds32/isr-library/vec_vid66.S index a8c18b8..69ccf36 100644 --- a/libgcc/config/nds32/isr-library/vec_vid66.S +++ b/libgcc/config/nds32/isr-library/vec_vid66.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.66, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_66 .type _nds32_vector_66, @function _nds32_vector_66: diff --git a/libgcc/config/nds32/isr-library/vec_vid67.S b/libgcc/config/nds32/isr-library/vec_vid67.S index d2996a3..78a68cb 100644 --- a/libgcc/config/nds32/isr-library/vec_vid67.S +++ b/libgcc/config/nds32/isr-library/vec_vid67.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.67, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_67 .type _nds32_vector_67, @function _nds32_vector_67: diff --git a/libgcc/config/nds32/isr-library/vec_vid68.S b/libgcc/config/nds32/isr-library/vec_vid68.S index 0c9de86..a120ec3 100644 --- a/libgcc/config/nds32/isr-library/vec_vid68.S +++ b/libgcc/config/nds32/isr-library/vec_vid68.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.68, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_68 .type _nds32_vector_68, @function _nds32_vector_68: diff --git a/libgcc/config/nds32/isr-library/vec_vid69.S b/libgcc/config/nds32/isr-library/vec_vid69.S index 43cf748..e2bdd5f 100644 --- a/libgcc/config/nds32/isr-library/vec_vid69.S +++ b/libgcc/config/nds32/isr-library/vec_vid69.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.69, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_69 .type _nds32_vector_69, @function _nds32_vector_69: diff --git a/libgcc/config/nds32/isr-library/vec_vid70.S b/libgcc/config/nds32/isr-library/vec_vid70.S index aba3e6a..a5ac1f3 100644 --- a/libgcc/config/nds32/isr-library/vec_vid70.S +++ b/libgcc/config/nds32/isr-library/vec_vid70.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.70, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_70 .type _nds32_vector_70, @function _nds32_vector_70: diff --git a/libgcc/config/nds32/isr-library/vec_vid71.S b/libgcc/config/nds32/isr-library/vec_vid71.S index be8aaa5..06ed89c 100644 --- a/libgcc/config/nds32/isr-library/vec_vid71.S +++ b/libgcc/config/nds32/isr-library/vec_vid71.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.71, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_71 .type _nds32_vector_71, @function _nds32_vector_71: diff --git a/libgcc/config/nds32/isr-library/vec_vid72.S b/libgcc/config/nds32/isr-library/vec_vid72.S index 041c895..2163201b 100644 --- a/libgcc/config/nds32/isr-library/vec_vid72.S +++ b/libgcc/config/nds32/isr-library/vec_vid72.S @@ -24,8 +24,15 @@ . */ .section .nds32_vector.72, "ax" +#if __NDS32_ISR_VECTOR_SIZE_4__ + /* The vector size is default 4-byte for v3 architecture. */ + .vec_size 4 + .align 2 +#else + /* The vector size is default 16-byte for other architectures. */ .vec_size 16 .align 4 +#endif .weak _nds32_vector_72 .type _nds32_vector_72, @function _nds32_vector_72: diff --git a/libgcc/config/nds32/t-nds32-isr b/libgcc/config/nds32/t-nds32-isr index 4f86f90..abfd82b 100644 --- a/libgcc/config/nds32/t-nds32-isr +++ b/libgcc/config/nds32/t-nds32-isr @@ -23,11 +23,11 @@ # Makfile fragment rules for libnds32_isr.a to support ISR attribute extension ############################################################################### -# basic flags setting +# Basic flags setting. ISR_CFLAGS = $(CFLAGS) -c -# the object files we would like to create -LIBNDS32_ISR_16B_OBJS = \ +# The object files we would like to create. +LIBNDS32_ISR_VEC_OBJS = \ vec_vid00.o vec_vid01.o vec_vid02.o vec_vid03.o \ vec_vid04.o vec_vid05.o vec_vid06.o vec_vid07.o \ vec_vid08.o vec_vid09.o vec_vid10.o vec_vid11.o \ @@ -46,40 +46,9 @@ LIBNDS32_ISR_16B_OBJS = \ vec_vid60.o vec_vid61.o vec_vid62.o vec_vid63.o \ vec_vid64.o vec_vid65.o vec_vid66.o vec_vid67.o \ vec_vid68.o vec_vid69.o vec_vid70.o vec_vid71.o \ - vec_vid72.o \ - excp_isr_ps_nn.o excp_isr_ps_ns.o excp_isr_ps_nr.o \ - excp_isr_sa_nn.o excp_isr_sa_ns.o excp_isr_sa_nr.o \ - intr_isr_ps_nn.o intr_isr_ps_ns.o intr_isr_ps_nr.o \ - intr_isr_sa_nn.o intr_isr_sa_ns.o intr_isr_sa_nr.o \ - reset.o - -LIBNDS32_ISR_4B_OBJS = \ - vec_vid00_4b.o vec_vid01_4b.o vec_vid02_4b.o vec_vid03_4b.o \ - vec_vid04_4b.o vec_vid05_4b.o vec_vid06_4b.o vec_vid07_4b.o \ - vec_vid08_4b.o vec_vid09_4b.o vec_vid10_4b.o vec_vid11_4b.o \ - vec_vid12_4b.o vec_vid13_4b.o vec_vid14_4b.o vec_vid15_4b.o \ - vec_vid16_4b.o vec_vid17_4b.o vec_vid18_4b.o vec_vid19_4b.o \ - vec_vid20_4b.o vec_vid21_4b.o vec_vid22_4b.o vec_vid23_4b.o \ - vec_vid24_4b.o vec_vid25_4b.o vec_vid26_4b.o vec_vid27_4b.o \ - vec_vid28_4b.o vec_vid29_4b.o vec_vid30_4b.o vec_vid31_4b.o \ - vec_vid32_4b.o vec_vid33_4b.o vec_vid34_4b.o vec_vid35_4b.o \ - vec_vid36_4b.o vec_vid37_4b.o vec_vid38_4b.o vec_vid39_4b.o \ - vec_vid40_4b.o vec_vid41_4b.o vec_vid42_4b.o vec_vid43_4b.o \ - vec_vid44_4b.o vec_vid45_4b.o vec_vid46_4b.o vec_vid47_4b.o \ - vec_vid48_4b.o vec_vid49_4b.o vec_vid50_4b.o vec_vid51_4b.o \ - vec_vid52_4b.o vec_vid53_4b.o vec_vid54_4b.o vec_vid55_4b.o \ - vec_vid56_4b.o vec_vid57_4b.o vec_vid58_4b.o vec_vid59_4b.o \ - vec_vid60_4b.o vec_vid61_4b.o vec_vid62_4b.o vec_vid63_4b.o \ - vec_vid64_4b.o vec_vid65_4b.o vec_vid66_4b.o vec_vid67_4b.o \ - vec_vid68_4b.o vec_vid69_4b.o vec_vid70_4b.o vec_vid71_4b.o \ - vec_vid72_4b.o \ - excp_isr_ps_nn_4b.o excp_isr_ps_ns_4b.o excp_isr_ps_nr_4b.o \ - excp_isr_sa_nn_4b.o excp_isr_sa_ns_4b.o excp_isr_sa_nr_4b.o \ - intr_isr_ps_nn_4b.o intr_isr_ps_ns_4b.o intr_isr_ps_nr_4b.o \ - intr_isr_sa_nn_4b.o intr_isr_sa_ns_4b.o intr_isr_sa_nr_4b.o \ - reset_4b.o + vec_vid72.o -LIBNDS32_ISR_COMMON_OBJS = \ +LIBNDS32_ISR_JMP_OBJS = \ jmptbl_vid00.o jmptbl_vid01.o jmptbl_vid02.o jmptbl_vid03.o \ jmptbl_vid04.o jmptbl_vid05.o jmptbl_vid06.o jmptbl_vid07.o \ jmptbl_vid08.o jmptbl_vid09.o jmptbl_vid10.o jmptbl_vid11.o \ @@ -98,29 +67,32 @@ LIBNDS32_ISR_COMMON_OBJS = \ jmptbl_vid60.o jmptbl_vid61.o jmptbl_vid62.o jmptbl_vid63.o \ jmptbl_vid64.o jmptbl_vid65.o jmptbl_vid66.o jmptbl_vid67.o \ jmptbl_vid68.o jmptbl_vid69.o jmptbl_vid70.o jmptbl_vid71.o \ - jmptbl_vid72.o \ + jmptbl_vid72.o + +LIBNDS32_ISR_COMMON_OBJS = \ + excp_isr_ps_nn.o excp_isr_ps_ns.o excp_isr_ps_nr.o \ + excp_isr_sa_nn.o excp_isr_sa_ns.o excp_isr_sa_nr.o \ + intr_isr_ps_nn.o intr_isr_ps_ns.o intr_isr_ps_nr.o \ + intr_isr_sa_nn.o intr_isr_sa_ns.o intr_isr_sa_nr.o \ + reset.o \ nmih.o \ wrh.o -LIBNDS32_ISR_COMPLETE_OBJS = $(LIBNDS32_ISR_16B_OBJS) $(LIBNDS32_ISR_4B_OBJS) $(LIBNDS32_ISR_COMMON_OBJS) +LIBNDS32_ISR_COMPLETE_OBJS = $(LIBNDS32_ISR_VEC_OBJS) $(LIBNDS32_ISR_JMP_OBJS) $(LIBNDS32_ISR_COMMON_OBJS) -# Build common objects for ISR library -nmih.o: $(srcdir)/config/nds32/isr-library/nmih.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/nmih.S -o nmih.o -wrh.o: $(srcdir)/config/nds32/isr-library/wrh.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/wrh.S -o wrh.o - -jmptbl_vid%.o: $(srcdir)/config/nds32/isr-library/jmptbl_vid%.S +# Build vector vid objects for ISR library. +vec_vid%.o: $(srcdir)/config/nds32/isr-library/vec_vid%.S $(GCC_FOR_TARGET) $(ISR_CFLAGS) $< -o $@ - -# Build 16b version objects for ISR library. (no "_4b" postfix string) -vec_vid%.o: $(srcdir)/config/nds32/isr-library/vec_vid%.S +# Build jump table objects for ISR library. +jmptbl_vid%.o: $(srcdir)/config/nds32/isr-library/jmptbl_vid%.S $(GCC_FOR_TARGET) $(ISR_CFLAGS) $< -o $@ + +# Build commen objects for ISR library. excp_isr_ps_nn.o: $(srcdir)/config/nds32/isr-library/excp_isr.S $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_ps_nn.o @@ -160,48 +132,12 @@ intr_isr_sa_nr.o: $(srcdir)/config/nds32/isr-library/intr_isr.S reset.o: $(srcdir)/config/nds32/isr-library/reset.S $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/reset.S -o reset.o -# Build 4b version objects for ISR library. -vec_vid%_4b.o: $(srcdir)/config/nds32/isr-library/vec_vid%_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $< -o $@ - -excp_isr_ps_nn_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_ps_nn_4b.o - -excp_isr_ps_ns_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_ps_ns_4b.o - -excp_isr_ps_nr_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_ps_nr_4b.o - -excp_isr_sa_nn_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_sa_nn_4b.o - -excp_isr_sa_ns_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_sa_ns_4b.o - -excp_isr_sa_nr_4b.o: $(srcdir)/config/nds32/isr-library/excp_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/excp_isr_4b.S -o excp_isr_sa_nr_4b.o - -intr_isr_ps_nn_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_ps_nn_4b.o - -intr_isr_ps_ns_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_ps_ns_4b.o - -intr_isr_ps_nr_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_ps_nr_4b.o - -intr_isr_sa_nn_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_sa_nn_4b.o - -intr_isr_sa_ns_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_sa_ns_4b.o +nmih.o: $(srcdir)/config/nds32/isr-library/nmih.S + $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/nmih.S -o nmih.o -intr_isr_sa_nr_4b.o: $(srcdir)/config/nds32/isr-library/intr_isr_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/intr_isr_4b.S -o intr_isr_sa_nr_4b.o +wrh.o: $(srcdir)/config/nds32/isr-library/wrh.S + $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/wrh.S -o wrh.o -reset_4b.o: $(srcdir)/config/nds32/isr-library/reset_4b.S - $(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/reset_4b.S -o reset_4b.o # The rule to create libnds32_isr.a file -- cgit v1.1 From 4cd0bc3b696fd8ea70f8e3d80d4eb4440e01f554 Mon Sep 17 00:00:00 2001 From: Jojo Date: Fri, 17 Aug 2018 19:08:27 +0000 Subject: C-SKY port: libgcc 2018-08-17 Jojo Huibin Wang Sandra Loosemore Chung-Lin Tang C-SKY port: libgcc libgcc/ * config.host: Add C-SKY support. * config/csky/*: New. Co-Authored-By: Chung-Lin Tang Co-Authored-By: Huibin Wang Co-Authored-By: Sandra Loosemore From-SVN: r263631 --- libgcc/ChangeLog | 10 + libgcc/config.host | 12 + libgcc/config/csky/crti.S | 140 ++++++++ libgcc/config/csky/crtn.S | 55 ++++ libgcc/config/csky/lib1funcs.S | 675 ++++++++++++++++++++++++++++++++++++++ libgcc/config/csky/linux-atomic.c | 299 +++++++++++++++++ libgcc/config/csky/linux-unwind.h | 131 ++++++++ libgcc/config/csky/t-csky | 28 ++ libgcc/config/csky/t-linux-csky | 21 ++ 9 files changed, 1371 insertions(+) create mode 100644 libgcc/config/csky/crti.S create mode 100644 libgcc/config/csky/crtn.S create mode 100644 libgcc/config/csky/lib1funcs.S create mode 100644 libgcc/config/csky/linux-atomic.c create mode 100644 libgcc/config/csky/linux-unwind.h create mode 100644 libgcc/config/csky/t-csky create mode 100644 libgcc/config/csky/t-linux-csky (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d499020..e800b36 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2018-08-17 Jojo + Huibin Wang + Sandra Loosemore + Chung-Lin Tang + + C-SKY port: libgcc + + * config.host: Add C-SKY support. + * config/csky/*: New. + 2018-08-12 Chung-Ju Wu * config/nds32/t-nds32-isr: Rearrange object dependency. diff --git a/libgcc/config.host b/libgcc/config.host index 18cabaf..bd4ef1e 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -108,6 +108,9 @@ cr16-*-*) crisv32-*-*) cpu_type=cris ;; +csky*-*-*) + cpu_type=csky + ;; fido-*-*) cpu_type=m68k ;; @@ -507,6 +510,15 @@ cris-*-elf) cris-*-linux* | crisv32-*-linux*) tmake_file="$tmake_file cris/t-cris t-softfp-sfdf t-softfp cris/t-linux" ;; +csky-*-elf*) + tmake_file="csky/t-csky t-fdpbit" + extra_parts="$extra_parts crti.o crtn.o" + ;; +csky-*-linux*) + tmake_file="$tmake_file csky/t-csky t-slibgcc-libgcc t-fdpbit csky/t-linux-csky" + extra_parts="$extra_parts crti.o crtn.o" + md_unwind_header=csky/linux-unwind.h + ;; epiphany-*-elf* | epiphany-*-rtems*) tmake_file="$tmake_file epiphany/t-epiphany t-fdpbit epiphany/t-custom-eqsf" extra_parts="$extra_parts crti.o crtint.o crtrunc.o crtm1reg-r43.o crtm1reg-r63.o crtn.o" diff --git a/libgcc/config/csky/crti.S b/libgcc/config/csky/crti.S new file mode 100644 index 0000000..3e4beb9 --- /dev/null +++ b/libgcc/config/csky/crti.S @@ -0,0 +1,140 @@ +# Define _init and _fini entry points for C-SKY. +# Copyright (C) 2018 Free Software Foundation, Inc. +# Contributed by C-SKY Microsystems and Mentor Graphics. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3, or (at your option) any +# later version. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# Under Section 7 of GPL version 3, you are granted additional +# permissions described in the GCC Runtime Library Exception, version +# 3.1, as published by the Free Software Foundation. +# +# You should have received a copy of the GNU General Public License and +# a copy of the GCC Runtime Library Exception along with this program; +# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +# . + + +# This file just makes a stack frame for the contents of the .fini and +# .init sections. Users may put any desired instructions in those +# sections. + + .file "crti.S" + +/* We use more complicated versions of this code with GLIBC. */ +#if defined(__gnu_linux__) + +#ifndef PREINIT_FUNCTION +# define PREINIT_FUNCTION __gmon_start__ +#endif + +#ifndef PREINIT_FUNCTION_WEAK +# define PREINIT_FUNCTION_WEAK 1 +#endif + +#if PREINIT_FUNCTION_WEAK + .global PREINIT_FUNCTION + .weak PREINIT_FUNCTION + .align 4 + .type call_weak_fn, %function +call_weak_fn: + // push lr + subi sp, 4 + stw lr, (sp) +#ifdef __PIC__ + lrw a2, PREINIT_FUNCTION@GOT + addu a2, gb + ldw a2, (a2) +#else + lrw a2, PREINIT_FUNCTION +#endif + cmpnei a2, 0 + bf 1f + jsr a2 +1: + // pop lr + ldw lr, (sp) + addi sp, 4 + rts + + .align 4 +#else + .hidden PREINIT_FUNCTION +#endif /* PREINIT_FUNCTION_WEAK */ + + .section .init,"ax",@progbits + .align 4 + .globl _init + .type _init, @function +_init: + subi sp, 8 + stw lr, (sp, 0) +#ifdef __PIC__ + // stw gb, (sp, 4) + bsr .Lgetpc +.Lgetpc: + lrw gb, .Lgetpc@GOTPC + add gb, lr +#endif +#if PREINIT_FUNCTION_WEAK +#ifdef __PIC__ + lrw a2, call_weak_fn@GOTOFF + add a2, gb + jsr a2 +#else + jsri call_weak_fn +#endif +#else /* !PREINIT_FUNCTION_WEAK */ +#ifdef __PIC__ + lrw a2, PREINIT_FUNCTION@PLT + addu a2, gb + ldw a2, (a2) + jsr a2 +#else + jsri PREINIT_FUNCTION +#endif +#endif /* PREINIT_FUNCTION_WEAK */ + + br 2f + .literals + .align 4 +2: + .section .fini,"ax",@progbits + .align 4 + .globl _fini + .type _fini, @function +_fini: + subi sp,8 + stw lr, (sp, 0) + br 2f + .literals + .align 4 +2: + +/* These are the non-GLIBC versions. */ +#else /* !defined(__gnu_linux__) */ + .section ".init" + .global _init + .type _init,@function + .align 2 +_init: + subi sp, 16 + st.w lr, (sp, 12) + mov r0, r0 + + .section ".fini" + .global _fini + .type _fini,@function + .align 2 +_fini: + subi sp, 16 + st.w lr, (sp, 12) + mov r0, r0 +#endif /* defined(__gnu_linux__) */ diff --git a/libgcc/config/csky/crtn.S b/libgcc/config/csky/crtn.S new file mode 100644 index 0000000..8bef996 --- /dev/null +++ b/libgcc/config/csky/crtn.S @@ -0,0 +1,55 @@ +# Terminate C-SKY .init and .fini sections. +# Copyright (C) 2018 Free Software Foundation, Inc. +# Contributed by C-SKY Microsystems and Mentor Graphics. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3, or (at your option) any +# later version. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# Under Section 7 of GPL version 3, you are granted additional +# permissions described in the GCC Runtime Library Exception, version +# 3.1, as published by the Free Software Foundation. +# +# You should have received a copy of the GNU General Public License and +# a copy of the GCC Runtime Library Exception along with this program; +# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +# . + + +# This file just makes sure that the .fini and .init sections do in +# fact return. Users may put any desired instructions in those sections. +# This file is the last thing linked into any executable. + + .file "crtn.S" + +# Is this the GLIBC version? +#if defined(__gnu_linux__) + .section .init,"ax",@progbits + ldw lr, (sp, 0) + addi sp, 8 + rts + + .section .fini,"ax",@progbits + ldw lr, (sp, 0) + addi sp, 8 + rts + +#else /* !defined(__gnu_linux__) */ + .section ".init" + ldw lr, (sp, 12) + addi sp, 16 + jmp lr + + .section ".fini" + ldw lr, (sp, 12) + addi sp, 16 + jmp lr + +# Th-th-th-that is all folks! +#endif /* defined(__gnu_linux__) */ diff --git a/libgcc/config/csky/lib1funcs.S b/libgcc/config/csky/lib1funcs.S new file mode 100644 index 0000000..a0a3c73 --- /dev/null +++ b/libgcc/config/csky/lib1funcs.S @@ -0,0 +1,675 @@ +/* libgcc routines for C-SKY. + Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by C-SKY Microsystems and Mentor Graphics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + + +/* Use the right prefix for global labels. */ +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b +#define SYM(x) CONCAT1 (__, x) + +#ifndef __CSKYBE__ +#define xl r0 +#define xh r1 +#define yl r2 +#define yh r3 +#else +#define xh r0 +#define xl r1 +#define yh r2 +#define yl r3 +#endif + + +#ifdef __ELF__ +#define TYPE(x) .type SYM (x),@function +#define SIZE(x) .size SYM (x), . - SYM (x) +#else +#define TYPE(x) +#define SIZE(x) +#endif + +.macro FUNC_START name + .text + .align 2 + .globl SYM (\name) + TYPE (\name) +SYM (\name): +.endm + +.macro FUNC_END name + SIZE (\name) +.endm + + +/* Emulate FF1 ("fast find 1") instruction on ck801. + Result goes in rx, clobbering ry. */ +#if defined(__CK801__) +.macro FF1_M rx, ry + movi \rx, 32 +10: + cmphsi \ry, 1 + bf 11f + subi \rx, \rx, 1 + lsri \ry, \ry, 1 + br 10b +11: +.endm +#else +.macro FF1_M rx, ry + ff1 \rx, \ry +.endm +#endif + +/* Likewise emulate lslc instruction ("logical left shift to C") on CK801. */ +#if defined(__CK801__) +.macro LSLC_M rx + cmpne \rx, \rx + addc \rx, \rx +.endm +#else +.macro LSLC_M rx + lslc \rx +.endm +#endif + +/* Emulate the abs instruction. */ +#if defined(__CK802__) +.macro ABS_M rx + btsti \rx, 31 + bf 10f + not \rx + addi \rx, 1 +10: +.endm +#elif defined(__CK801__) +.macro ABS_M rx + cmplti \rx, 1 + bf 10f + not \rx + addi \rx, 1 +10: +.endm +#else +.macro ABS_M rx + abs \rx +.endm +#endif + +/* Emulate the ld.hs ("load signed halfword and extend") instruction + on ck801 and ck802. */ +#if defined(__CK801__) +.macro LDBS_M rx, ry + ld.b \rx, (\ry, 0x0) + sextb \rx, \rx +.endm +#else +.macro LDBS_M rx, ry + ld.bs \rx, (\ry, 0x0) +.endm +#endif + +#if defined(__CK801__) +.macro LDHS_M rx, ry + ld.h \rx, (\ry, 0x0) + sexth \rx, \rx +.endm +#else +.macro LDHS_M rx, ry + ld.hs \rx, (\ry, 0x0) +.endm +#endif + + +/* Signed and unsigned div/mod/rem functions. */ + +#ifdef L_udivsi3 +FUNC_START udiv32 +FUNC_START udivsi3 + cmpnei a1, 0 // look for 0 divisor + bt 9f + trap 3 // divide by 0 +9: + // control iterations, skip across high order 0 bits in dividend + cmpnei a0, 0 + bt 8f + jmp lr // 0 dividend quick return +8: + push l0 + movi a2, 1 // a2 is quotient (1 for a sentinel) + mov a3, a0 + FF1_M l0, a3 // figure distance to skip + lsl a2, l0 // move the sentinel along (with 0's behind) + lsl a0, l0 // and the low 32 bits of numerator + + // FIXME: Is this correct? + mov a3, a1 // looking at divisor + FF1_M l0, a3 // I can move 32-l0 more bits to left. + addi l0, 1 // ok, one short of that... + mov a3, a0 + lsr a3, l0 // bits that came from low order... + not l0 // l0 == "32-n" == LEFT distance + addi l0, 33 // this is (32-n) + lsl a2,l0 // fixes the high 32 (quotient) + lsl a0,l0 + cmpnei a2,0 + bf 4f // the sentinel went away... + + // run the remaining bits +1: + LSLC_M a0 // 1 bit left shift of a3-a0 + addc a3, a3 + cmphs a3, a1 // upper 32 of dividend >= divisor? + bf 2f + subu a3, a1 // if yes, subtract divisor +2: + addc a2, a2 // shift by 1 and count subtracts + bf 1b // if sentinel falls out of quotient, stop + +4: + mov a0, a2 // return quotient + mov a1, a3 // and piggyback the remainder + pop l0 +FUNC_END udiv32 +FUNC_END udivsi3 +#endif + +#ifdef L_umodsi3 +FUNC_START urem32 +FUNC_START umodsi3 + cmpnei a1, 0 // look for 0 divisor + bt 9f + trap 3 // divide by 0 +9: + // control iterations, skip across high order 0 bits in dividend + cmpnei a0, 0 + bt 8f + jmp lr // 0 dividend quick return +8: + mov a2, a0 + FF1_M a3, a2 // figure distance to skip + movi a2, 1 // a2 is quotient (1 for a sentinel) + lsl a2, a3 // move the sentinel along (with 0's behind) + lsl a0, a3 // and the low 32 bits of numerator + movi a3, 0 + +1: + LSLC_M a0 // 1 bit left shift of a3-a0 + addc a3, a3 + cmphs a3, a1 // upper 32 of dividend >= divisor? + bf 2f + subu a3, a1 // if yes, subtract divisor +2: + addc a2, a2 // shift by 1 and count subtracts + bf 1b // if sentinel falls out of quotient, stop + +4: + mov a0, a3 // and piggyback the remainder + jmp lr +FUNC_END urem32 +FUNC_END umodsi3 +#endif + + +#ifdef L_divsi3 +FUNC_START div32 +FUNC_START divsi3 + cmpnei a1, 0 // look for 0 divisor + bt 9f + trap 3 // divide by 0 +9: + // control iterations, skip across high order 0 bits in dividend + cmpnei a0, 0 + bt 8f + jmp lr // 0 dividend quick return +8: + push l0, l1 + mov l1, a0 + xor l1, a1 // calc sign of quotient + ABS_M a0 + ABS_M a1 + movi a2, 1 // a2 is quotient (1 for a sentinel) + mov a3, a0 + FF1_M l0, a3 // figure distance to skip + lsl a2, l0 // move the sentinel along (with 0's behind) + lsl a0, l0 // and the low 32 bits of numerator + + // FIXME: is this correct? + mov a3, a1 // looking at divisor + FF1_M l0, a3 // I can move 32-l0 more bits to left. + addi l0, 1 // ok, one short of that... + mov a3, a0 + lsr a3, l0 // bits that came from low order... + not l0 // l0 == "32-n" == LEFT distance + addi l0, 33 // this is (32-n) + lsl a2,l0 // fixes the high 32 (quotient) + lsl a0,l0 + cmpnei a2,0 + bf 4f // the sentinel went away... + + // run the remaining bits +1: + LSLC_M a0 // 1 bit left shift of a3-a0 + addc a3, a3 + cmphs a3, a1 // upper 32 of dividend >= divisor? + bf 2f + subu a3, a1 // if yes, subtract divisor +2: + addc a2, a2 // shift by 1 and count subtracts + bf 1b // if sentinel falls out of quotient, stop + +4: + mov a0, a2 // return quotient + mov a1, a3 // and piggyback the remainder + LSLC_M l1 // after adjusting for sign + bf 3f + not a0 + addi a0, 1 + not a1 + addi a1, 1 +3: + pop l0, l1 +FUNC_END div32 +FUNC_END divsi3 +#endif + +#ifdef L_modsi3 +FUNC_START rem32 +FUNC_START modsi3 + push l0 + cmpnei a1, 0 // look for 0 divisor + bt 9f + trap 3 // divide by 0 +9: + // control iterations, skip across high order 0 bits in dividend + cmpnei a0, 0 + bt 8f + pop l0 // 0 dividend quick return +8: + mov l0, a0 + ABS_M a0 + ABS_M a1 + mov a2, a0 + FF1_M a3, a2 // figure distance to skip + movi a2, 1 // a2 is quotient (1 for a sentinel) + lsl a2, a3 // move the sentinel along (with 0's behind) + lsl a0, a3 // and the low 32 bits of numerator + movi a3, 0 + + // run the remaining bits +1: + LSLC_M a0 // 1 bit left shift of a3-a0 + addc a3, a3 + cmphs a3, a1 // upper 32 of dividend >= divisor? + bf 2f + subu a3, a1 // if yes, subtract divisor +2: + addc a2, a2 // shift by 1 and count subtracts + bf 1b // if sentinel falls out of quotient, stop + +4: + mov a0, a3 // and piggyback the remainder + LSLC_M l0 // after adjusting for sign + bf 3f + not a0 + addi a0, 1 +3: + pop l0 +FUNC_END rem32 +FUNC_END modsi3 +#endif + +/* Unordered comparisons for single and double float. */ + +#ifdef L_unordsf2 +FUNC_START unordsf2 +#if defined(__CK801__) + subi sp, 4 + st.w r4, (sp, 0x0) + lsli r2, r0, 1 + lsli r3, r1, 1 + asri r4, r2, 24 + not r4 + cmpnei r4, 0 + bt 1f + lsli r4, r0, 9 + cmpnei r4, 0 + bt 3f +1: + asri r4, r3, 24 + not r4 + cmpnei r4, 0 + bt 2f + lsli r4, r1, 9 + cmpnei r4, 0 + bt 3f +2: + ld.w r4, (sp, 0x0) + addi sp, 4 + movi r0, 0 + rts +3: + ld.w r4, (sp, 0x0) + addi sp, 4 + movi r0, 1 + rts +#elif defined(__CK802__) + lsli r2, r0, 1 + lsli r3, r1, 1 + asri r2, r2, 24 + not r13, r2 + cmpnei r13, 0 + bt 1f + lsli r13, r0, 9 + cmpnei r13, 0 + bt 3f +1: + asri r3, r3, 24 + not r13, r3 + cmpnei r13, 0 + bt 2f + lsli r13, r1, 9 + cmpnei r13, 0 + bt 3f +2: + movi r0, 0 + rts +3: + movi r0, 1 + rts +#else + lsli r2, r0, 1 + lsli r3, r1, 1 + asri r2, r2, 24 + not r13, r2 + bnez r13, 1f + lsli r13, r0, 9 + bnez r13, 3f +1: + asri r3, r3, 24 + not r13, r3 + bnez r13, 2f + lsli r13, r1, 9 + bnez r13, 3f +2: + movi r0, 0 + rts +3: + movi r0, 1 + rts +#endif +FUNC_END unordsf2 +#endif + +#ifdef L_unorddf2 +FUNC_START unorddf2 +#if defined(__CK801__) + subi sp, 8 + st.w r4, (sp, 0x0) + st.w r5, (sp, 0x4) + lsli r4, xh, 1 + asri r4, r4, 21 + not r4 + cmpnei r4, 0 + bt 1f + mov r4, xl + lsli r5, xh, 12 + or r4, r5 + cmpnei r4, 0 + bt 3f +1: + lsli r4, yh, 1 + asri r4, r4, 21 + not r4 + cmpnei r4, 0 + bt 2f + mov r4,yl + lsli r5, yh, 12 + or r4, r5 + cmpnei r4, 0 + bt 3f +2: + ld.w r4, (sp, 0x0) + ld.w r5, (sp, 0x4) + addi sp, 8 + movi r0, 0 + rts +3: + ld.w r4, (sp, 0x0) + ld.w r5, (sp, 0x4) + addi sp, 8 + movi r0, 1 + rts +#elif defined(__CK802__) + lsli r13, xh, 1 + asri r13, r13, 21 + not r13 + cmpnei r13, 0 + bt 1f + lsli xh, xh, 12 + or r13, xl, xh + cmpnei r13, 0 + bt 3f +1: + lsli r13, yh, 1 + asri r13, r13, 21 + not r13 + cmpnei r13, 0 + bt 2f + lsli yh, yh, 12 + or r13, yl, yh + cmpnei r13, 0 + bt 3f +2: + movi r0, 0 + rts +3: + movi r0, 1 + rts +#else + lsli r13, xh, 1 + asri r13, r13, 21 + not r13 + bnez r13, 1f + lsli xh, xh, 12 + or r13, xl, xh + bnez r13, 3f +1: + lsli r13, yh, 1 + asri r13, r13, 21 + not r13 + bnez r13, 2f + lsli yh, yh, 12 + or r13, yl, yh + bnez r13, 3f +2: + movi r0, 0 + rts +3: + movi r0, 1 + rts +#endif +FUNC_END unorddf2 +#endif + +/* When optimizing for size on ck801 and ck802, GCC emits calls to the + following helper functions when expanding casesi, instead of emitting + the table lookup and jump inline. Note that in these functions the + jump is handled by tweaking the value of lr before rts. */ +#ifdef L_csky_case_sqi +FUNC_START _gnu_csky_case_sqi + subi sp, 4 + st.w a1, (sp, 0x0) + mov a1, lr + add a1, a1, a0 + LDBS_M a1, a1 + lsli a1, a1, 1 + add lr, lr, a1 + ld.w a1, (sp, 0x0) + addi sp, 4 + rts +FUNC_END _gnu_csky_case_sqi +#endif + +#ifdef L_csky_case_uqi +FUNC_START _gnu_csky_case_uqi + subi sp, 4 + st.w a1, (sp, 0x0) + mov a1, lr + add a1, a1, a0 + ld.b a1, (a1, 0x0) + lsli a1, a1, 1 + add lr, lr, a1 + ld.w a1, (sp, 0x0) + addi sp, 4 + rts +FUNC_END _gnu_csky_case_uqi +#endif + +#ifdef L_csky_case_shi +FUNC_START _gnu_csky_case_shi + subi sp, 8 + st.w a0, (sp, 0x4) + st.w a1, (sp, 0x0) + mov a1, lr + lsli a0, a0, 1 + add a1, a1, a0 + LDHS_M a1, a1 + lsli a1, a1, 1 + add lr, lr, a1 + ld.w a0, (sp, 0x4) + ld.w a1, (sp, 0x0) + addi sp, 8 + rts +FUNC_END _gnu_csky_case_shi +#endif + +#ifdef L_csky_case_uhi +FUNC_START _gnu_csky_case_uhi + subi sp, 8 + st.w a0, (sp, 0x4) + st.w a1, (sp, 0x0) + mov a1, lr + lsli a0, a0, 1 + add a1, a1, a0 + ld.h a1, (a1, 0x0) + lsli a1, a1, 1 + add lr, lr, a1 + ld.w a0, (sp, 0x4) + ld.w a1, (sp, 0x0) + addi sp, 8 + rts +FUNC_END _gnu_csky_case_uhi +#endif + +#ifdef L_csky_case_si +FUNC_START _gnu_csky_case_si + subi sp, 8 + st.w a0, (sp, 0x4) + st.w a1, (sp, 0x0) + mov a1, lr + addi a1, a1, 2 // Align to word. + bclri a1, a1, 1 + mov lr, a1 + lsli a0, a0, 2 + add a1, a1, a0 + ld.w a0, (a1, 0x0) + add lr, lr, a0 + ld.w a0, (sp, 0x4) + ld.w a1, (sp, 0x0) + addi sp, 8 + rts +FUNC_END _gnu_csky_case_si +#endif + +/* GCC expects that {__eq,__ne,__gt,__ge,__le,__lt}{df2,sf2} + will behave as __cmpdf2. So, we stub the implementations to + jump on to __cmpdf2 and __cmpsf2. + + All of these short-circuit the return path so that __cmp{sd}f2 + will go directly back to the caller. */ + +.macro COMPARE_DF_JUMP name + .import SYM (cmpdf2) +FUNC_START \name + jmpi SYM (cmpdf2) +FUNC_END \name +.endm + +#ifdef L_eqdf2 +COMPARE_DF_JUMP eqdf2 +#endif /* L_eqdf2 */ + +#ifdef L_nedf2 +COMPARE_DF_JUMP nedf2 +#endif /* L_nedf2 */ + +#ifdef L_gtdf2 +COMPARE_DF_JUMP gtdf2 +#endif /* L_gtdf2 */ + +#ifdef L_gedf2 +COMPARE_DF_JUMP gedf2 +#endif /* L_gedf2 */ + +#ifdef L_ltdf2 +COMPARE_DF_JUMP ltdf2 +#endif /* L_ltdf2 */ + +#ifdef L_ledf2 +COMPARE_DF_JUMP ledf2 +#endif /* L_ledf2 */ + +/* Single-precision floating point stubs. */ + +.macro COMPARE_SF_JUMP name + .import SYM (cmpsf2) +FUNC_START \name + jmpi SYM (cmpsf2) +FUNC_END \name +.endm + +#ifdef L_eqsf2 +COMPARE_SF_JUMP eqsf2 +#endif /* L_eqsf2 */ + +#ifdef L_nesf2 +COMPARE_SF_JUMP nesf2 +#endif /* L_nesf2 */ + +#ifdef L_gtsf2 +COMPARE_SF_JUMP gtsf2 +#endif /* L_gtsf2 */ + +#ifdef L_gesf2 +COMPARE_SF_JUMP __gesf2 +#endif /* L_gesf2 */ + +#ifdef L_ltsf2 +COMPARE_SF_JUMP __ltsf2 +#endif /* L_ltsf2 */ + +#ifdef L_lesf2 +COMPARE_SF_JUMP lesf2 +#endif /* L_lesf2 */ diff --git a/libgcc/config/csky/linux-atomic.c b/libgcc/config/csky/linux-atomic.c new file mode 100644 index 0000000..03cf2c0 --- /dev/null +++ b/libgcc/config/csky/linux-atomic.c @@ -0,0 +1,299 @@ +/* Linux-specific atomic operations for C-SKY. + Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by C-SKY Microsystems and Mentor Graphics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3, or (at your option) any later + version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +/* Kernel helper for compare-and-exchange. */ +inline int +__kernel_cmpxchg (int oldval, int newval, volatile int *ptr) +{ + register int _a0 asm ("a0") = oldval; + register int _a1 asm ("a1") = newval; + register volatile int *_a2 asm ("a2") = ptr; + __asm__ __volatile__ ("trap 2\n" \ + :"+r" (_a0) :"r" (_a1) , "r" (_a2) \ + : "a3", "memory"); \ + return _a0; +} + + +/* Kernel helper for memory barrier. */ +inline void __kernel_dmb (void) +{ + asm ("sync":::"memory"); +} + +/* Note: we implement byte, short and int versions of atomic operations using + the above kernel helpers, but there is no support for "long long" (64-bit) + operations as yet. */ + +#define HIDDEN __attribute__ ((visibility ("hidden"))) + +#ifdef __CSKYLE__ +#define INVERT_MASK_1 0 +#define INVERT_MASK_2 0 +#else +#define INVERT_MASK_1 24 +#define INVERT_MASK_2 16 +#endif + +#define MASK_1 0xffu +#define MASK_2 0xffffu + +#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \ + int HIDDEN \ + __sync_fetch_and_##OP##_4 (int *ptr, int val) \ + { \ + int failure, tmp; \ + \ + do \ + { \ + tmp = *ptr; \ + failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \ + } \ + while (failure != 0); \ + \ + return tmp; \ + } + +FETCH_AND_OP_WORD (add, , +) +FETCH_AND_OP_WORD (sub, , -) +FETCH_AND_OP_WORD (or, , |) +FETCH_AND_OP_WORD (and, , &) +FETCH_AND_OP_WORD (xor, , ^) +FETCH_AND_OP_WORD (nand, ~, &) + +#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH +#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH + +/* Implement both __sync__and_fetch and __sync_fetch_and_ for + subword-sized quantities. */ + +#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \ + TYPE HIDDEN \ + NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE val) \ + { \ + int *wordptr = (int *) ((unsigned int) ptr & ~3); \ + unsigned int mask, shift, oldval, newval; \ + int failure; \ + \ + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ + mask = MASK_##WIDTH << shift; \ + \ + do \ + { \ + oldval = *wordptr; \ + newval = ((PFX_OP (((oldval & mask) >> shift) \ + INF_OP (unsigned int) val)) << shift) & mask; \ + newval |= oldval & ~mask; \ + failure = __kernel_cmpxchg (oldval, newval, wordptr); \ + } \ + while (failure != 0); \ + \ + return (RETURN & mask) >> shift; \ + } + +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval) + +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval) + +#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \ + int HIDDEN \ + __sync_##OP##_and_fetch_4 (int *ptr, int val) \ + { \ + int tmp, failure; \ + \ + do \ + { \ + tmp = *ptr; \ + failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \ + } \ + while (failure != 0); \ + \ + return PFX_OP tmp INF_OP val; \ + } + +OP_AND_FETCH_WORD (add, , +) +OP_AND_FETCH_WORD (sub, , -) +OP_AND_FETCH_WORD (or, , |) +OP_AND_FETCH_WORD (and, , &) +OP_AND_FETCH_WORD (xor, , ^) +OP_AND_FETCH_WORD (nand, ~, &) + +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval) +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval) +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval) +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval) +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval) + +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval) +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval) +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval) +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval) +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval) + +int HIDDEN +__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) +{ + int actual_oldval, fail; + + while (1) + { + actual_oldval = *ptr; + + if (oldval != actual_oldval) + return actual_oldval; + + fail = __kernel_cmpxchg (actual_oldval, newval, ptr); + + if (!fail) + return oldval; + } +} + +#define SUBWORD_VAL_CAS(TYPE, WIDTH) \ + TYPE HIDDEN \ + __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ + TYPE newval) \ + { \ + int *wordptr = (int *)((unsigned int) ptr & ~3), fail; \ + unsigned int mask, shift, actual_oldval, actual_newval; \ + \ + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ + mask = MASK_##WIDTH << shift; \ + \ + while (1) \ + { \ + actual_oldval = *wordptr; \ + \ + if (((actual_oldval & mask) >> shift) != (unsigned int) oldval) \ + return (actual_oldval & mask) >> shift; \ + \ + actual_newval = (actual_oldval & ~mask) \ + | (((unsigned int) newval << shift) & mask); \ + \ + fail = __kernel_cmpxchg (actual_oldval, actual_newval, \ + wordptr); \ + \ + if (!fail) \ + return oldval; \ + } \ + } + +SUBWORD_VAL_CAS (unsigned short, 2) +SUBWORD_VAL_CAS (unsigned char, 1) + +typedef unsigned char bool; + +bool HIDDEN +__sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval) +{ + int failure = __kernel_cmpxchg (oldval, newval, ptr); + return (failure == 0); +} + +#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \ + bool HIDDEN \ + __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ + TYPE newval) \ + { \ + TYPE actual_oldval \ + = __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \ + return (oldval == actual_oldval); \ + } + +SUBWORD_BOOL_CAS (unsigned short, 2) +SUBWORD_BOOL_CAS (unsigned char, 1) + +void HIDDEN +__sync_synchronize (void) +{ + __kernel_dmb (); +} + +int HIDDEN +__sync_lock_test_and_set_4 (int *ptr, int val) +{ + int failure, oldval; + + do + { + oldval = *ptr; + failure = __kernel_cmpxchg (oldval, val, ptr); + } + while (failure != 0); + + return oldval; +} + +#define SUBWORD_TEST_AND_SET(TYPE, WIDTH) \ + TYPE HIDDEN \ + __sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \ + { \ + int failure; \ + unsigned int oldval, newval, shift, mask; \ + int *wordptr = (int *) ((unsigned int) ptr & ~3); \ + \ + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ + mask = MASK_##WIDTH << shift; \ + \ + do \ + { \ + oldval = *wordptr; \ + newval = ((oldval & ~mask) \ + | (((unsigned int) val << shift) & mask)); \ + failure = __kernel_cmpxchg (oldval, newval, wordptr); \ + } \ + while (failure != 0); \ + \ + return (oldval & mask) >> shift; \ + } + +SUBWORD_TEST_AND_SET (unsigned short, 2) +SUBWORD_TEST_AND_SET (unsigned char, 1) + +#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \ + void HIDDEN \ + __sync_lock_release_##WIDTH (TYPE *ptr) \ + { \ + /* All writes before this point must be seen before we release \ + the lock itself. */ \ + __kernel_dmb (); \ + *ptr = 0; \ + } + +SYNC_LOCK_RELEASE (int, 4) +SYNC_LOCK_RELEASE (short, 2) +SYNC_LOCK_RELEASE (char, 1) diff --git a/libgcc/config/csky/linux-unwind.h b/libgcc/config/csky/linux-unwind.h new file mode 100644 index 0000000..24638de --- /dev/null +++ b/libgcc/config/csky/linux-unwind.h @@ -0,0 +1,131 @@ +/* DWARF2 EH unwinding support for C-SKY Linux. + Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by C-SKY Microsystems and Mentor Graphics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +#ifndef inhibit_libc + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +#include +#include + +/* The third parameter to the signal handler points to something with + this structure defined in asm/ucontext.h, but the name clashes with + struct ucontext from sys/ucontext.h so this private copy is used. */ +typedef struct _sig_ucontext { + unsigned long uc_flags; + struct _sig_ucontext *uc_link; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; +} _sig_ucontext_t; + +#define MD_FALLBACK_FRAME_STATE_FOR csky_fallback_frame_state + +static _Unwind_Reason_Code +csky_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + u_int16_t *pc = (u_int16_t *) context->ra; + struct sigcontext *sc; + _Unwind_Ptr new_cfa; + int i; + + /* movi r7, __NR_rt_sigreturn; trap 0 */ + if ((*(pc+0) == 0xea07) && (*(pc+1) == 119) + && (*(pc+2) == 0xc000) && (*(pc+3) == 0x2020)) + { + struct sigframe + { + int sig; + int code; + struct sigcontext *psc; + unsigned long extramask[2]; /* _NSIG_WORDS */ + struct sigcontext sc; + } *_rt = context->cfa; + sc = _rt->psc; // &(_rt->sc); + } + /* movi r7, __NR_rt_sigreturn; trap 0 */ + else if ((*(pc+0) == 0xea07) && (*(pc+1) == 173) + && (*(pc+2) == 0xc000) && (*(pc+3) == 0x2020)) + { + struct rt_sigframe + { + int sig; + struct siginfo *pinfo; + void* puc; + siginfo_t info; + struct ucontext uc; + } *_rt = context->cfa; + sc = &(_rt->uc.uc_mcontext); + } + else + return _URC_END_OF_STACK; + + new_cfa = (_Unwind_Ptr) sc->sc_usp; + fs->regs.cfa_how = CFA_REG_OFFSET; + fs->regs.cfa_reg = STACK_POINTER_REGNUM; + fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa; + + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = (_Unwind_Ptr)&(sc->sc_a0) - new_cfa; + + fs->regs.reg[1].how = REG_SAVED_OFFSET; + fs->regs.reg[1].loc.offset = (_Unwind_Ptr)&(sc->sc_a1) - new_cfa; + + fs->regs.reg[2].how = REG_SAVED_OFFSET; + fs->regs.reg[2].loc.offset = (_Unwind_Ptr)&(sc->sc_a2) - new_cfa; + + fs->regs.reg[3].how = REG_SAVED_OFFSET; + fs->regs.reg[3].loc.offset = (_Unwind_Ptr)&(sc->sc_a3) - new_cfa; + + for (i = 4; i < 14; i++) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = ((_Unwind_Ptr)&(sc->sc_regs[i - 4]) + - new_cfa); + } + + for (i = 16; i < 32; i++) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = ((_Unwind_Ptr)&(sc->sc_exregs[i - 16]) + - new_cfa); + } + + /* FIXME : hi lo ? */ + fs->regs.reg[15].how = REG_SAVED_OFFSET; + fs->regs.reg[15].loc.offset = (_Unwind_Ptr)&(sc->sc_r15) - new_cfa; + + fs->regs.reg[56].how = REG_SAVED_OFFSET; + fs->regs.reg[56].loc.offset = (_Unwind_Ptr)&(sc->sc_pc) - new_cfa; + fs->retaddr_column = 56; + fs->signal_frame = 1; + + return _URC_NO_REASON; +} + + +#endif diff --git a/libgcc/config/csky/t-csky b/libgcc/config/csky/t-csky new file mode 100644 index 0000000..06aa1c1 --- /dev/null +++ b/libgcc/config/csky/t-csky @@ -0,0 +1,28 @@ +# Makefile fragment for all C-SKY targets. +# Copyright (C) 2018 Free Software Foundation, Inc. +# Contributed by C-SKY Microsystems and Mentor Graphics. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +LIB1ASMSRC = csky/lib1funcs.S +LIB1ASMFUNCS = _divsi3 _udivsi3 _modsi3 _umodsi3 _unorddf2 _unordsf2 \ + _csky_case_sqi _csky_case_uqi _csky_case_shi _csky_case_uhi _csky_case_si + +LIB2FUNCS_EXCLUDE += _unord_df +LIB2FUNCS_EXCLUDE += _unord_sf + +TARGET_LIBGCC2_CFLAGS=-O3 -DNO_FLOATLIB_FIXUNSDFSI diff --git a/libgcc/config/csky/t-linux-csky b/libgcc/config/csky/t-linux-csky new file mode 100644 index 0000000..1f5c4ce --- /dev/null +++ b/libgcc/config/csky/t-linux-csky @@ -0,0 +1,21 @@ +# Makefile fragment for C-SKY targets running Linux. +# Copyright (C) 2018 Free Software Foundation, Inc. +# Contributed by C-SKY Microsystems and Mentor Graphics. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +LIB2ADD_ST += $(srcdir)/config/csky/linux-atomic.c -- cgit v1.1 From 9a5b8df7007b350015509ee8f809fd7d2c8fa963 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 21 Aug 2018 10:49:15 +0200 Subject: libgcc: add crt{begin,end} for powerpc-wrs-vxworks target In order to allow ZCX on VxWorks, we need the frame_dummy function to do the register_frame_info(). So make sure crtbegin.o and crtend.o are available for use with a custom spec file. From-SVN: r263690 --- libgcc/ChangeLog | 5 +++++ libgcc/config.host | 1 + 2 files changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e800b36..1cfba4c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-08-21 Rasmus Villemoes + + * config.host: Add crtbegin.o and crtend.o for + powerpc-wrs-vxworks target. + 2018-08-17 Jojo Huibin Wang Sandra Loosemore diff --git a/libgcc/config.host b/libgcc/config.host index bd4ef1e..d4ae944 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1141,6 +1141,7 @@ powerpc*-*-linux*) ;; powerpc-wrs-vxworks*) tmake_file="$tmake_file rs6000/t-ppccomm rs6000/t-savresfgpr t-fdpbit" + extra_parts="$extra_parts crtbegin.o crtend.o" ;; powerpc-*-lynxos*) tmake_file="$tmake_file rs6000/t-lynx t-fdpbit" -- cgit v1.1 From a49c064e407df3d39776241f2c08b14e6affde1e Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 22 Aug 2018 11:58:43 +0000 Subject: Move Darwin10 unwinder fix to a crt shim. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc/ * config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the Darwin10-specific unwinder-shim. * config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove. * config/rs6000/darwin.h (DARWIN_CRT1_SPEC, DARWIN_DYLIB1_SPEC): New to cater for Darwin10 Rosetta. libgcc/ * config/unwind-dw2-fde-darwin.c (_darwin10_Unwind_FindEnclosingFunction): move from here ... * config/darwin10-unwind-find-enc-func.c: … to here. * config/t-darwin: Build Darwin10 unwinder shim crt. * libgcc/config.host: Add the Darwin10 unwinder shim. From-SVN: r263765 --- libgcc/ChangeLog | 8 ++++++++ libgcc/config/darwin10-unwind-find-enc-func.c | 13 +++++++++++++ libgcc/config/t-darwin | 4 ++++ libgcc/config/unwind-dw2-fde-darwin.c | 13 ------------- 4 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 libgcc/config/darwin10-unwind-find-enc-func.c (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 1cfba4c..d003fd5 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2018-08-22 Iain Sandoe + + * config/unwind-dw2-fde-darwin.c + (_darwin10_Unwind_FindEnclosingFunction): move from here ... + * config/darwin10-unwind-find-enc-func.c: … to here. + * config/t-darwin: Build Darwin10 unwinder shim crt. + * libgcc/config.host: Add the Darwin10 unwinder shim. + 2018-08-21 Rasmus Villemoes * config.host: Add crtbegin.o and crtend.o for diff --git a/libgcc/config/darwin10-unwind-find-enc-func.c b/libgcc/config/darwin10-unwind-find-enc-func.c new file mode 100644 index 0000000..67c4375 --- /dev/null +++ b/libgcc/config/darwin10-unwind-find-enc-func.c @@ -0,0 +1,13 @@ +#include "tconfig.h" +#include "tsystem.h" +#include "unwind-dw2-fde.h" + +void * +_darwin10_Unwind_FindEnclosingFunction (void *pc) +{ + struct dwarf_eh_bases bases; + const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases); + if (fde) + return bases.func; + return NULL; +} diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin index 13ca6ed..8340ea2 100644 --- a/libgcc/config/t-darwin +++ b/libgcc/config/t-darwin @@ -20,3 +20,7 @@ HOST_LIBGCC2_CFLAGS += -pipe # Use unwind-dw2-fde-darwin LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + +# Patch to __Unwind_Find_Enclosing_Function for Darwin10. +d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c + $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -mmacosx-version-min=10.6 -c $< diff --git a/libgcc/config/unwind-dw2-fde-darwin.c b/libgcc/config/unwind-dw2-fde-darwin.c index 6e2d0d6..c919de9 100644 --- a/libgcc/config/unwind-dw2-fde-darwin.c +++ b/libgcc/config/unwind-dw2-fde-darwin.c @@ -273,16 +273,3 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) the_obj_info); return ret; } - -void * -_darwin10_Unwind_FindEnclosingFunction (void *pc ATTRIBUTE_UNUSED) -{ -#if __MACH__ && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060) - struct dwarf_eh_bases bases; - const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases); - if (fde) - return bases.func; -#endif - return NULL; -} - -- cgit v1.1 From 88350fd97ea9c15587f40260941a134948490b8c Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 22 Aug 2018 12:05:45 +0000 Subject: commit missed change from r263764 From-SVN: r263766 --- libgcc/config.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/config.host b/libgcc/config.host index d4ae944..029f656 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -208,7 +208,7 @@ case ${host} in *-*-darwin*) asm_hidden_op=.private_extern tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin" - extra_parts="crt3.o crttms.o crttme.o" + extra_parts="crt3.o d10-uwfef.o crttms.o crttme.o" ;; *-*-dragonfly*) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip" -- cgit v1.1 From ebdb6f237772df251378d2c08350d345135bcb9e Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Thu, 23 Aug 2018 09:47:34 +0000 Subject: PR target/86951 arm - Handle speculation barriers on pre-armv7 CPUs The AArch32 instruction sets prior to Armv7 do not define the ISB and DSB instructions that are needed to form a speculation barrier. While I do not know of any instances of cores based on those instruction sets being vulnerable to speculative side channel attacks it is possible to run code built for those ISAs on more recent hardware where they would become vulnerable. This patch works around this by using a library call added to libgcc. That code can then take any platform-specific actions necessary to ensure safety. For the moment I've only handled two cases: the library code being built for armv7 or later anyway and running on Linux. On Linux we can handle this by calling the kernel function that will flush a small amount of cache. Such a sequence ends with a ISB+DSB sequence if running on an Armv7 or later CPU. gcc: PR target/86951 * config/arm/arm-protos.h (arm_emit_speculation_barrier): New prototype. * config/arm/arm.c (speculation_barrier_libfunc): New static variable. (arm_init_libfuncs): Initialize it. (arm_emit_speculation_barrier): New function. * config/arm/arm.md (speculation_barrier): Call arm_emit_speculation_barrier for architectures that do not have DSB or ISB. (speculation_barrier_insn): Only match on Armv7 or later. libgcc: PR target/86951 * config/arm/lib1funcs.asm (speculation_barrier): New function. * config/arm/t-arm (LIB1ASMFUNCS): Add it to list of functions to build. From-SVN: r263806 --- libgcc/ChangeLog | 7 +++++++ libgcc/config/arm/lib1funcs.S | 44 +++++++++++++++++++++++++++++++++++++++++++ libgcc/config/arm/t-arm | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d003fd5..280bd10 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2018-08-23 Richard Earnshaw + + PR target/86951 + * config/arm/lib1funcs.asm (speculation_barrier): New function. + * config/arm/t-arm (LIB1ASMFUNCS): Add it to list of functions + to build. + 2018-08-22 Iain Sandoe * config/unwind-dw2-fde-darwin.c diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S index b9919aa..ff06d50 100644 --- a/libgcc/config/arm/lib1funcs.S +++ b/libgcc/config/arm/lib1funcs.S @@ -1533,6 +1533,50 @@ LSYM(Lover12): #error "This is only for ARM EABI GNU/Linux" #endif #endif /* L_clear_cache */ + +#ifdef L_speculation_barrier + FUNC_START speculation_barrier +#if __ARM_ARCH >= 7 + isb + dsb sy +#elif defined __ARM_EABI__ && defined __linux__ + /* We don't have a speculation barrier directly for this + platform/architecture variant. But we can use a kernel + clear_cache service routine which will emit such instructions + if run on a later version of the architecture. We don't + really want to flush the cache, but we must give it a valid + address, so just clear pc..pc+1. */ +#if defined __thumb__ && !defined __thumb2__ + push {r7} + mov r7, #0xf + lsl r7, #16 + add r7, #2 + adr r0, . + 4 + add r1, r0, #1 + mov r2, #0 + svc 0 + pop {r7} +#else + do_push {r7} +#ifdef __ARM_ARCH_6T2__ + movw r7, #2 + movt r7, #0xf +#else + mov r7, #0xf0000 + add r7, r7, #2 +#endif + add r0, pc, #0 /* ADR. */ + add r1, r0, #1 + mov r2, #0 + svc 0 + do_pop {r7} +#endif /* Thumb1 only */ +#else +#warning "No speculation barrier defined for this platform" +#endif + RET + FUNC_END speculation_barrier +#endif /* ------------------------------------------------------------------------ */ /* Dword shift operations. */ /* All the following Dword shift variants rely on the fact that diff --git a/libgcc/config/arm/t-arm b/libgcc/config/arm/t-arm index 9e85ac0..274bf2a 100644 --- a/libgcc/config/arm/t-arm +++ b/libgcc/config/arm/t-arm @@ -1,6 +1,6 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi \ - _thumb1_case_uhi _thumb1_case_si + _thumb1_case_uhi _thumb1_case_si _speculation_barrier HAVE_CMSE:=$(findstring __ARM_FEATURE_CMSE,$(shell $(gcc_compile_bare) -dM -E - /dev/null),) -- cgit v1.1 From 92a285c1a7bad310d7223a7aa5d70e6a5fc3e644 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 27 Aug 2018 14:04:23 +0000 Subject: Replace 8 spaces with a tabular in ChangeLog files. From-SVN: r263886 --- libgcc/ChangeLog | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 280bd10..8a350e1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -69,7 +69,7 @@ 2018-08-01 Martin Liska * libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not - check that __gcov_indirect_call_callee is non-null. + check that __gcov_indirect_call_callee is non-null. 2018-07-30 Christophe Lyon @@ -143,30 +143,30 @@ 2018-06-07 Martin Liska * libgcov-driver.c: Rename cs_all to all and assign it from - all_prg. + all_prg. 2018-06-07 Martin Liska - PR bootstrap/86057 + PR bootstrap/86057 * libgcov-driver-system.c (replace_filename_variables): Use - memcpy instead of mempcpy. + memcpy instead of mempcpy. (allocate_filename_struct): Do not allocate filename, allocate - prefix and set it. + prefix and set it. (gcov_exit_open_gcda_file): Allocate memory for gf->filename - here and properly copy content into it. + here and properly copy content into it. * libgcov-driver.c (struct gcov_filename): Remove max_length - field, change prefix from size_t into char *. + field, change prefix from size_t into char *. (compute_summary): Do not calculate longest filename. (gcov_do_dump): Release memory of gf.filename after each file. * libgcov-util.c (compute_summary): Use new signature of - compute_summary. + compute_summary. (calculate_overlap): Likewise. 2018-06-05 Martin Liska PR gcov-profile/47618 * libgcov-driver-system.c (replace_filename_variables): New - function. + function. (gcov_exit_open_gcda_file): Use it. 2018-06-05 Martin Liska @@ -197,15 +197,15 @@ 2018-05-30 Rasmus Villemoes - * crtstuff.c: Remove declaration of _Jv_RegisterClasses. + * crtstuff.c: Remove declaration of _Jv_RegisterClasses. 2018-05-29 Martin Liska - PR gcov-profile/85759 + PR gcov-profile/85759 * libgcov-driver-system.c (gcov_error): Introduce usage of - GCOV_EXIT_AT_ERROR env. variable. + GCOV_EXIT_AT_ERROR env. variable. * libgcov-driver.c (merge_one_data): Print error that we - overwrite a gcov file with a different timestamp. + overwrite a gcov file with a different timestamp. 2018-05-23 Kalamatee @@ -789,8 +789,8 @@ config/i386/enable-execute-stack-mingw32.c 2017-08-01 Jerome Lambourg - Doug Rupp - Olivier Hainque + Doug Rupp + Olivier Hainque * config.host (arm-wrs-vxworks*): Rework to handle arm-wrs-vxworks7 as well as arm-wrs-vxworks. @@ -926,10 +926,10 @@ Matthieu Sarter David Edelsohn - * config/rs6000/aix-unwind.h (MD_FALLBACK_FRAME_STATE_FOR): Define - unconditionally. - (ucontext_for): Add 64-bit AIX 6.1, 7.1, 7.2 support. Add 32-bit - AIX 7.2 support. + * config/rs6000/aix-unwind.h (MD_FALLBACK_FRAME_STATE_FOR): Define + unconditionally. + (ucontext_for): Add 64-bit AIX 6.1, 7.1, 7.2 support. Add 32-bit + AIX 7.2 support. 2017-06-02 Olivier Hainque -- cgit v1.1 From 53c6feb2b2621bdfe3415dd6f664283917817491 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 18 Sep 2018 07:04:15 +0000 Subject: Use v2 map syntax in libgcc-unwind.map if Solaris ld supports it * configure.ac (solaris_ld_v2_maps): New test. * configure: Regenerate. * Makefile.in (solaris_ld_v2_maps): New variable. * config/t-slibgcc-sld (libgcc-unwind.map): Emit v2 mapfile syntax if supported. From-SVN: r264382 --- libgcc/ChangeLog | 8 ++++++++ libgcc/Makefile.in | 1 + libgcc/config/t-slibgcc-sld | 11 +++++++++++ libgcc/configure | 21 +++++++++++++++++++++ libgcc/configure.ac | 15 +++++++++++++++ 5 files changed, 56 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 8a350e1..3a7602f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-18 Rainer Orth + + * configure.ac (solaris_ld_v2_maps): New test. + * configure: Regenerate. + * Makefile.in (solaris_ld_v2_maps): New variable. + * config/t-slibgcc-sld (libgcc-unwind.map): Emit v2 mapfile syntax + if supported. + 2018-08-23 Richard Earnshaw PR target/86951 diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 0c5b264..0766de5 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -44,6 +44,7 @@ enable_vtable_verify = @enable_vtable_verify@ enable_decimal_float = @enable_decimal_float@ fixed_point = @fixed_point@ with_aix_soname = @with_aix_soname@ +solaris_ld_v2_maps = @solaris_ld_v2_maps@ enable_execute_stack = @enable_execute_stack@ unwind_header = @unwind_header@ md_unwind_header = @md_unwind_header@ diff --git a/libgcc/config/t-slibgcc-sld b/libgcc/config/t-slibgcc-sld index 0b95391..03c6a65 100644 --- a/libgcc/config/t-slibgcc-sld +++ b/libgcc/config/t-slibgcc-sld @@ -8,12 +8,23 @@ ifeq ($(enable_shared),yes) # Linker mapfile to enforce direct binding to libgcc_s unwinder # (PR target/59788). +# Emit v2 mapfile syntax if possible, otherwise ld -z guidance complains +# every time the mapfile is used. libgcc-unwind.map: libgcc-std.ver +ifeq ($(solaris_ld_v2_maps),yes) + @(echo '$$mapfile_version 2'; \ + echo "SYMBOL_SCOPE {"; \ + for f in `grep _Unwind_ $< | sort`; do \ + echo " $$f { FLAGS = EXTERN DIRECT };"; \ + done; \ + echo "};" ) > $@ +else @(echo "{"; \ for f in `grep _Unwind_ $< | sort`; do \ echo " $$f = EXTERN DIRECT;"; \ done; \ echo "};" ) > $@ +endif # Copy libgcc-unwind.map to the place where gcc will look for it at build-time. install-libgcc-unwind-map-forbuild: libgcc-unwind.map diff --git a/libgcc/configure b/libgcc/configure index 090e548..f0b6116 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -570,6 +570,7 @@ sfp_machine_header set_use_emutls set_have_cc_tls vis_hide +solaris_ld_v2_maps real_host_noncanonical accel_dir_suffix force_explicit_eh_registry @@ -5176,6 +5177,26 @@ EOF ;; esac +# Check if Solaris linker support v2 linker mapfile syntax. +# Link with -nostartfiles -nodefaultlibs since neither are present while +# building libgcc. +case ${host} in +*-*-solaris2*) + solaris_ld_v2_maps=no + echo 'int main(void) {return 0;}' > conftest.c + echo '$mapfile_version 2' > conftest.map + if { ac_try='${CC-cc} -nostartfiles -nodefaultlibs -Wl,-M,conftest.map -o conftest conftest.c 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + solaris_ld_v2_maps=yes + fi + ;; +esac + + # Check if xtensa target is configured for windowed ABI and thus needs to use # custom unwind code. # This is after config.host so we can augment tmake_file. diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 9d0bbca..5fcbac6 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -459,6 +459,21 @@ EOF ;; esac +# Check if Solaris linker support v2 linker mapfile syntax. +# Link with -nostartfiles -nodefaultlibs since neither are present while +# building libgcc. +case ${host} in +*-*-solaris2*) + solaris_ld_v2_maps=no + echo 'int main(void) {return 0;}' > conftest.c + echo '$mapfile_version 2' > conftest.map + if AC_TRY_COMMAND([${CC-cc} -nostartfiles -nodefaultlibs -Wl,-M,conftest.map -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then + solaris_ld_v2_maps=yes + fi + ;; +esac +AC_SUBST(solaris_ld_v2_maps) + # Check if xtensa target is configured for windowed ABI and thus needs to use # custom unwind code. # This is after config.host so we can augment tmake_file. -- cgit v1.1 From 229a033dac95e5a40960b77fb8c5a5cd74239c48 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Fri, 21 Sep 2018 08:11:40 +0000 Subject: [NDS32] Add t-nds32-glibc file. libgcc/ * config/nds32/t-nds32-glibc: New file. From-SVN: r264460 --- libgcc/ChangeLog | 4 ++++ libgcc/config/nds32/t-nds32-glibc | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 libgcc/config/nds32/t-nds32-glibc (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 3a7602f..7fdee61 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-09-21 Kito Cheng + + * config/nds32/t-nds32-glibc: New file. + 2018-09-18 Rainer Orth * configure.ac (solaris_ld_v2_maps): New test. diff --git a/libgcc/config/nds32/t-nds32-glibc b/libgcc/config/nds32/t-nds32-glibc new file mode 100644 index 0000000..4e22931 --- /dev/null +++ b/libgcc/config/nds32/t-nds32-glibc @@ -0,0 +1,34 @@ +# Rules of glibc library makefile of Andes NDS32 cpu for GNU compiler +# Copyright (C) 2012-2015 Free Software Foundation, Inc. +# Contributed by Andes Technology Corporation. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 3, or (at your +# option) any later version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Compiler flags to use when compiling 'libgcc2.c' +HOST_LIBGCC2_CFLAGS = -O2 -fPIC -fwrapv +LIB2ADD += $(srcdir)/config/nds32/linux-atomic.c + +#LIB1ASMSRC = nds32/lib1asmsrc-newlib.S +#LIB1ASMFUNCS = _divsi3 _modsi3 _udivsi3 _umodsi3 + +# List of functions not to build from libgcc2.c. +#LIB2FUNCS_EXCLUDE = _clzsi2 + +# List of extra C and assembler files(*.S) to add to static libgcc2. +#LIB2ADD_ST += $(srcdir)/config/nds32/lib2csrc-newlib/_clzsi2.c + +# ------------------------------------------------------------------------ -- cgit v1.1 From 36ff254bf63f21dd8fc7a353c8b8f3aa08018654 Mon Sep 17 00:00:00 2001 From: Monk Chiang Date: Fri, 21 Sep 2018 08:39:35 +0000 Subject: [NDS32] Sync glibc and kernel structure, all use _rt_sigframe. libgcc/ * config/nds32/linux-unwind.h (struct _rt_sigframe): Use struct ucontext_t type instead. (nds32_fallback_frame_state): Remove struct _sigframe statement. From-SVN: r264461 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/nds32/linux-unwind.h | 18 ++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7fdee61..8d3f440 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-21 Monk Chiang + + * config/nds32/linux-unwind.h (struct _rt_sigframe): Use struct + ucontext_t type instead. + (nds32_fallback_frame_state): Remove struct _sigframe statement. + 2018-09-21 Kito Cheng * config/nds32/t-nds32-glibc: New file. diff --git a/libgcc/config/nds32/linux-unwind.h b/libgcc/config/nds32/linux-unwind.h index 921edf9..c8f5983 100644 --- a/libgcc/config/nds32/linux-unwind.h +++ b/libgcc/config/nds32/linux-unwind.h @@ -32,19 +32,16 @@ #include #include +#include /* Exactly the same layout as the kernel structures, unique names. */ /* arch/nds32/kernel/signal.c */ -struct _sigframe { - struct ucontext uc; - unsigned long retcode; -}; - struct _rt_sigframe { siginfo_t info; - struct _sigframe sig; + struct ucontext_t uc; }; + #define SIGRETURN 0xeb0e0a64 #define RT_SIGRETURN 0xab150a64 @@ -80,17 +77,10 @@ nds32_fallback_frame_state (struct _Unwind_Context *context, SWI_SYS_SIGRETURN -> (0xeb0e0a64) SWI_SYS_RT_SIGRETURN -> (0xab150a64) FIXME: Currently we only handle little endian (EL) case. */ - if (pc[0] == SIGRETURN) + if (pc[0] == SIGRETURN || pc[0] == RT_SIGRETURN) { /* Using '_sigfame' memory address to locate kernal's sigcontext. The sigcontext structures in arch/nds32/include/asm/sigcontext.h. */ - struct _sigframe *rt_; - rt_ = context->cfa; - sc_ = &rt_->uc.uc_mcontext; - } - else if (pc[0] == RT_SIGRETURN) - { - /* Using '_sigfame' memory address to locate kernal's sigcontext. */ struct _rt_sigframe *rt_; rt_ = context->cfa; sc_ = &rt_->sig.uc.uc_mcontext; -- cgit v1.1 From 512cc0151207de4c7ff3a84f040f730fe0d52458 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 21 Sep 2018 10:41:17 +0200 Subject: Remove arc profile histogram in non-LTO mode. 2018-09-21 Martin Liska * auto-profile.c (autofdo_source_profile::read): Do not set sum_all. (read_profile): Do not add working sets. (read_autofdo_file): Remove sum_all. (afdo_callsite_hot_enough_for_early_inline): Remove const qualifier. * coverage.c (struct counts_entry): Remove gcov_summary. (read_counts_file): Read new GCOV_TAG_OBJECT_SUMMARY, do not support GCOV_TAG_PROGRAM_SUMMARY. (get_coverage_counts): Remove summary and expected arguments. * coverage.h (get_coverage_counts): Likewise. * doc/gcov-dump.texi: Remove -w option. * gcov-dump.c (dump_working_sets): Remove. (main): Do not support '-w' option. (print_usage): Likewise. (tag_summary): Likewise. * gcov-io.c (gcov_write_summary): Do not dump histogram. (gcov_read_summary): Likewise. (gcov_histo_index): Remove. (gcov_histogram_merge): Likewise. (compute_working_sets): Likewise. * gcov-io.h (GCOV_TAG_OBJECT_SUMMARY): Mark it not obsolete. (GCOV_TAG_PROGRAM_SUMMARY): Mark it obsolete. (GCOV_TAG_SUMMARY_LENGTH): Adjust. (GCOV_HISTOGRAM_SIZE): Remove. (GCOV_HISTOGRAM_BITVECTOR_SIZE): Likewise. (struct gcov_summary): Simplify rapidly just to runs and sum_max fields. (gcov_histo_index): Remove. (NUM_GCOV_WORKING_SETS): Likewise. (compute_working_sets): Likewise. * gcov-tool.c (print_overlap_usage_message): Remove trailing empty line. * gcov.c (read_count_file): Read GCOV_TAG_OBJECT_SUMMARY. (output_lines): Remove program related line. * ipa-profile.c (ipa_profile): Do not consider GCOV histogram. * lto-cgraph.c (output_profile_summary): Do not stream GCOV histogram. (input_profile_summary): Do not read it. (merge_profile_summaries): And do not merge it. (input_symtab): Do not call removed function. * modulo-sched.c (sms_schedule): Do not print sum_max. * params.def (HOT_BB_COUNT_FRACTION): Reincarnate param that was removed when histogram method was invented. (HOT_BB_COUNT_WS_PERMILLE): Mention that it's used only in LTO mode. * postreload-gcse.c (eliminate_partially_redundant_load): Fix GCOV coding style. * predict.c (get_hot_bb_threshold): Use HOT_BB_COUNT_FRACTION and dump selected value. * profile.c (add_working_set): Remove. (get_working_sets): Likewise. (find_working_set): Likewise. (get_exec_counts): Do not work with working sets. (read_profile_edge_counts): Do not inform as sum_max is removed. (compute_branch_probabilities): Likewise. (compute_value_histograms): Remove argument for call of get_coverage_counts. * profile.h: Do not make gcov_summary const. 2018-09-21 Martin Liska * libgcov-driver.c (crc32_unsigned): Remove. (gcov_histogram_insert): Likewise. (gcov_compute_histogram): Likewise. (compute_summary): Simplify rapidly. (merge_one_data): Do not handle PROGRAM_SUMMARY tag. (merge_summary): Rapidly simplify. (dump_one_gcov): Ignore gcov_summary. (gcov_do_dump): Do not handle program summary, it's not used. * libgcov-util.c (tag_summary): Remove. (read_gcda_finalize): Fix coding style. (read_gcda_file): Initialize curr_object_summary. (compute_summary): Remove. (calculate_overlap): Remove settings of run_max. From-SVN: r264462 --- libgcc/ChangeLog | 17 +++ libgcc/libgcov-driver.c | 324 ++++++------------------------------------------ libgcc/libgcov-util.c | 39 ++---- 3 files changed, 63 insertions(+), 317 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 8d3f440..b172d71 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,20 @@ +2018-09-21 Martin Liska + + * libgcov-driver.c (crc32_unsigned): Remove. + (gcov_histogram_insert): Likewise. + (gcov_compute_histogram): Likewise. + (compute_summary): Simplify rapidly. + (merge_one_data): Do not handle PROGRAM_SUMMARY tag. + (merge_summary): Rapidly simplify. + (dump_one_gcov): Ignore gcov_summary. + (gcov_do_dump): Do not handle program summary, it's not + used. + * libgcov-util.c (tag_summary): Remove. + (read_gcda_finalize): Fix coding style. + (read_gcda_file): Initialize curr_object_summary. + (compute_summary): Remove. + (calculate_overlap): Remove settings of run_max. + 2018-09-21 Monk Chiang * config/nds32/linux-unwind.h (struct _rt_sigframe): Use struct diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index 1f2c4a7..cdebb74 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -24,6 +24,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #include "libgcov.h" +#include "gcov-io.h" #if defined(inhibit_libc) /* If libc and its header files are not available, provide dummy functions. */ @@ -156,25 +157,6 @@ fail: return (struct gcov_fn_buffer **)free_fn_data (gi_ptr, fn_buffer, ix); } -/* Add an unsigned value to the current crc */ - -static gcov_unsigned_t -crc32_unsigned (gcov_unsigned_t crc32, gcov_unsigned_t value) -{ - unsigned ix; - - for (ix = 32; ix--; value <<= 1) - { - unsigned feedback; - - feedback = (value ^ crc32) & 0x80000000 ? 0x04c11db7 : 0; - crc32 <<= 1; - crc32 ^= feedback; - } - - return crc32; -} - /* Check if VERSION of the info block PTR matches libgcov one. Return 1 on success, or zero in case of versions mismatch. If FILENAME is not NULL, its value used for reporting purposes @@ -198,117 +180,8 @@ gcov_version (struct gcov_info *ptr, gcov_unsigned_t version, return 1; } -/* Insert counter VALUE into HISTOGRAM. */ - -static void -gcov_histogram_insert(gcov_bucket_type *histogram, gcov_type value) -{ - unsigned i; - - i = gcov_histo_index(value); - histogram[i].num_counters++; - histogram[i].cum_value += value; - if (value < histogram[i].min_value) - histogram[i].min_value = value; -} - -/* Computes a histogram of the arc counters to place in the summary SUM. */ - -static void -gcov_compute_histogram (struct gcov_info *list, struct gcov_summary *sum) -{ - struct gcov_info *gi_ptr; - const struct gcov_fn_info *gfi_ptr; - const struct gcov_ctr_info *ci_ptr; - unsigned f_ix, ix; - int h_ix; - - /* First check if there are any counts recorded for this counter. */ - if (!sum->num) - return; - - for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++) - { - sum->histogram[h_ix].num_counters = 0; - sum->histogram[h_ix].min_value = sum->run_max; - sum->histogram[h_ix].cum_value = 0; - } - - /* Walk through all the per-object structures and record each of - the count values in histogram. */ - for (gi_ptr = list; gi_ptr; gi_ptr = gi_ptr->next) - { - for (f_ix = 0; f_ix != gi_ptr->n_functions; f_ix++) - { - gfi_ptr = gi_ptr->functions[f_ix]; - - if (!gfi_ptr || gfi_ptr->key != gi_ptr) - continue; - - ci_ptr = &gfi_ptr->ctrs[0]; - for (ix = 0; ix < ci_ptr->num; ix++) - gcov_histogram_insert (sum->histogram, ci_ptr->values[ix]); - } - } -} - /* buffer for the fn_data from another program. */ static struct gcov_fn_buffer *fn_buffer; -/* buffer for summary from other programs to be written out. */ -static struct gcov_summary_buffer *sum_buffer; - -/* This function computes the program level summary and the histo-gram. - It computes and returns CRC32 and stored summary in THIS_PRG. */ - -#if !IN_GCOV_TOOL -static -#endif -gcov_unsigned_t -compute_summary (struct gcov_info *list, struct gcov_summary *this_prg) -{ - struct gcov_info *gi_ptr; - const struct gcov_fn_info *gfi_ptr; - const struct gcov_ctr_info *ci_ptr; - int f_ix; - gcov_unsigned_t c_num; - gcov_unsigned_t crc32 = 0; - - /* Find the totals for this execution. */ - memset (this_prg, 0, sizeof (*this_prg)); - for (gi_ptr = list; gi_ptr; gi_ptr = gi_ptr->next) - { - crc32 = crc32_unsigned (crc32, gi_ptr->stamp); - crc32 = crc32_unsigned (crc32, gi_ptr->n_functions); - - for (f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions; f_ix++) - { - gfi_ptr = gi_ptr->functions[f_ix]; - - if (gfi_ptr && gfi_ptr->key != gi_ptr) - gfi_ptr = 0; - - crc32 = crc32_unsigned (crc32, gfi_ptr ? gfi_ptr->cfg_checksum : 0); - crc32 = crc32_unsigned (crc32, - gfi_ptr ? gfi_ptr->lineno_checksum : 0); - if (!gfi_ptr) - continue; - - ci_ptr = gfi_ptr->ctrs; - this_prg->num += ci_ptr->num; - crc32 = crc32_unsigned (crc32, ci_ptr->num); - - for (c_num = 0; c_num < ci_ptr->num; c_num++) - { - this_prg->sum_all += ci_ptr->values[c_num]; - if (this_prg->run_max < ci_ptr->values[c_num]) - this_prg->run_max = ci_ptr->values[c_num]; - } - ci_ptr++; - } - } - gcov_compute_histogram (list, this_prg); - return crc32; -} /* Including system dependent components. */ #include "libgcov-driver-system.c" @@ -320,18 +193,13 @@ compute_summary (struct gcov_info *list, struct gcov_summary *this_prg) static int merge_one_data (const char *filename, struct gcov_info *gi_ptr, - struct gcov_summary *prg_p, - struct gcov_summary *this_prg, - gcov_position_t *summary_pos_p, - gcov_position_t *eof_pos_p, - gcov_unsigned_t crc32) + struct gcov_summary *summary) { gcov_unsigned_t tag, length; unsigned t_ix; - int f_ix; + int f_ix = -1; int error = 0; struct gcov_fn_buffer **fn_tail = &fn_buffer; - struct gcov_summary_buffer **sum_tail = &sum_buffer; length = gcov_read_unsigned (); if (!gcov_version (gi_ptr, length, filename)) @@ -346,46 +214,14 @@ merge_one_data (const char *filename, return 0; } - /* Look for program summary. */ - for (f_ix = 0;;) - { - struct gcov_summary tmp; - - *eof_pos_p = gcov_position (); - tag = gcov_read_unsigned (); - if (tag != GCOV_TAG_PROGRAM_SUMMARY) - break; - - f_ix--; - length = gcov_read_unsigned (); - gcov_read_summary (&tmp); - if ((error = gcov_is_error ())) - goto read_error; - if (*summary_pos_p) - { - /* Save all summaries after the one that will be - merged into below. These will need to be rewritten - as histogram merging may change the number of non-zero - histogram entries that will be emitted, and thus the - size of the merged summary. */ - (*sum_tail) = (struct gcov_summary_buffer *) - xmalloc (sizeof(struct gcov_summary_buffer)); - (*sum_tail)->summary = tmp; - (*sum_tail)->next = 0; - sum_tail = &((*sum_tail)->next); - goto next_summary; - } - if (tmp.checksum != crc32) - goto next_summary; - - if (tmp.num != this_prg->num) - goto next_summary; - *prg_p = tmp; - *summary_pos_p = *eof_pos_p; - - next_summary:; - } + tag = gcov_read_unsigned (); + if (tag != GCOV_TAG_OBJECT_SUMMARY) + goto read_mismatch; + length = gcov_read_unsigned (); + gcc_assert (length > 0); + gcov_read_summary (summary); + tag = gcov_read_unsigned (); /* Merge execution counts for each function. */ for (f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions; f_ix++, tag = gcov_read_unsigned ()) @@ -472,38 +308,15 @@ read_error: static void write_one_data (const struct gcov_info *gi_ptr, - const struct gcov_summary *prg_p, - const gcov_position_t eof_pos, - const gcov_position_t summary_pos) + const struct gcov_summary *prg_p) { unsigned f_ix; - struct gcov_summary_buffer *next_sum_buffer; - /* Write out the data. */ - if (!eof_pos) - { - gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION); - gcov_write_unsigned (gi_ptr->stamp); - } - - if (summary_pos) - gcov_seek (summary_pos); + gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION); + gcov_write_unsigned (gi_ptr->stamp); /* Generate whole program statistics. */ - gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, prg_p); - - /* Rewrite all the summaries that were after the summary we merged - into. This is necessary as the merged summary may have a different - size due to the number of non-zero histogram entries changing after - merging. */ - - while (sum_buffer) - { - gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &sum_buffer->summary); - next_sum_buffer = sum_buffer->next; - free (sum_buffer); - sum_buffer = next_sum_buffer; - } + gcov_write_summary (GCOV_TAG_OBJECT_SUMMARY, prg_p); /* Write execution counts for each function. */ for (f_ix = 0; f_ix != gi_ptr->n_functions; f_ix++) @@ -562,70 +375,19 @@ write_one_data (const struct gcov_info *gi_ptr, gcov_write_unsigned (0); } -/* Helper function for merging summary. - Return -1 on error. Return 0 on success. */ +/* Helper function for merging summary. */ -static int -merge_summary (const char *filename __attribute__ ((unused)), int run_counted, - struct gcov_summary *prg, - struct gcov_summary *this_prg, gcov_unsigned_t crc32, - struct gcov_summary *all_prg __attribute__ ((unused))) +static void +merge_summary (int run_counted, struct gcov_summary *summary, + gcov_type run_max) { -#if !GCOV_LOCKED - /* summary for all instances of program. */ - struct gcov_summary *all; -#endif - - /* Merge the summary. */ - int first = !prg->runs; - if (!run_counted) - prg->runs++; - if (first) - prg->num = this_prg->num; - prg->sum_all += this_prg->sum_all; - if (prg->run_max < this_prg->run_max) - prg->run_max = this_prg->run_max; - prg->sum_max += this_prg->run_max; - if (first) - memcpy (prg->histogram, this_prg->histogram, - sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE); - else - gcov_histogram_merge (prg->histogram, this_prg->histogram); -#if !GCOV_LOCKED - all = all_prg; - if (!all->runs && prg->runs) - { - all->num = prg->num; - all->runs = prg->runs; - all->sum_all = prg->sum_all; - all->run_max = prg->run_max; - all->sum_max = prg->sum_max; - } - else if (!all_prg->checksum - /* Don't compare the histograms, which may have slight - variations depending on the order they were updated - due to the truncating integer divides used in the - merge. */ - && (all->num != prg->num - || all->runs != prg->runs - || all->sum_all != prg->sum_all - || all->run_max != prg->run_max - || all->sum_max != prg->sum_max)) { - gcov_error ("profiling:%s:Data file mismatch - some " - "data files may have been concurrently " - "updated without locking support\n", filename); - all_prg->checksum = ~0u; + summary->runs++; + summary->sum_max += run_max; } -#endif - - prg->checksum = crc32; - - return 0; } - /* Sort N entries in VALUE_ARRAY in descending order. Each entry in VALUE_ARRAY has two values. The sorting is based on the second value. */ @@ -713,18 +475,13 @@ gcov_sort_topn_counter_arrays (const struct gcov_info *gi_ptr) static void dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, - unsigned run_counted, - gcov_unsigned_t crc32, struct gcov_summary *all_prg, - struct gcov_summary *this_prg) + unsigned run_counted, gcov_type run_max) { - struct gcov_summary prg; /* summary for this object over all program. */ + struct gcov_summary summary = {}; int error; gcov_unsigned_t tag; - gcov_position_t summary_pos = 0; - gcov_position_t eof_pos = 0; fn_buffer = 0; - sum_buffer = 0; gcov_sort_topn_counter_arrays (gi_ptr); @@ -741,26 +498,16 @@ dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, gcov_error ("profiling:%s:Not a gcov data file\n", gf->filename); goto read_fatal; } - error = merge_one_data (gf->filename, gi_ptr, &prg, this_prg, - &summary_pos, &eof_pos, crc32); + error = merge_one_data (gf->filename, gi_ptr, &summary); if (error == -1) goto read_fatal; } gcov_rewrite (); - if (!summary_pos) - { - memset (&prg, 0, sizeof (prg)); - summary_pos = eof_pos; - } - - error = merge_summary (gf->filename, run_counted, &prg, this_prg, - crc32, all_prg); - if (error == -1) - goto read_fatal; + merge_summary (run_counted, &summary, run_max); - write_one_data (gi_ptr, &prg, eof_pos, summary_pos); + write_one_data (gi_ptr, &summary); /* fall through */ read_fatal:; @@ -787,21 +534,26 @@ gcov_do_dump (struct gcov_info *list, int run_counted) { struct gcov_info *gi_ptr; struct gcov_filename gf; - gcov_unsigned_t crc32; - struct gcov_summary all_prg; - struct gcov_summary this_prg; - crc32 = compute_summary (list, &this_prg); + /* Compute run_max of this program run. */ + gcov_type run_max = 0; + for (gi_ptr = list; gi_ptr; gi_ptr = gi_ptr->next) + for (unsigned f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions; f_ix++) + { + const struct gcov_ctr_info *cinfo + = &gi_ptr->functions[f_ix]->ctrs[GCOV_COUNTER_ARCS]; + + for (unsigned i = 0; i < cinfo->num; i++) + if (run_max < cinfo->values[i]) + run_max = cinfo->values[i]; + } allocate_filename_struct (&gf); -#if !GCOV_LOCKED - memset (&all_prg, 0, sizeof (all_prg)); -#endif /* Now merge each file. */ for (gi_ptr = list; gi_ptr; gi_ptr = gi_ptr->next) { - dump_one_gcov (gi_ptr, &gf, run_counted, crc32, &all_prg, &this_prg); + dump_one_gcov (gi_ptr, &gf, run_counted, run_max); free (gf.filename); } diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 37dd186..408bda8 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -32,6 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "diagnostic.h" #include "version.h" #include "demangle.h" +#include "gcov-io.h" /* Borrowed from basic-block.h. */ #define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) @@ -79,6 +80,8 @@ static int k_ctrs_mask[GCOV_COUNTERS]; static struct gcov_ctr_info k_ctrs[GCOV_COUNTERS]; /* Number of kind of counters that have been seen. */ static int k_ctrs_types; +/* The object summary being processed. */ +static struct gcov_summary *curr_object_summary; /* Merge functions for counters. */ #define DEF_GCOV_COUNTER(COUNTER, NAME, FN_TYPE) __gcov_merge ## FN_TYPE, @@ -131,7 +134,6 @@ static const tag_format_t tag_table[] = {GCOV_TAG_ARCS, "ARCS", tag_arcs}, {GCOV_TAG_LINES, "LINES", tag_lines}, {GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary}, - {GCOV_TAG_PROGRAM_SUMMARY, "PROGRAM_SUMMARY", tag_summary}, {0, NULL, NULL} }; @@ -223,9 +225,8 @@ tag_counters (unsigned tag, unsigned length) static void tag_summary (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) { - struct gcov_summary summary; - - gcov_read_summary (&summary); + curr_object_summary = (gcov_summary *) xcalloc (sizeof (gcov_summary), 1); + gcov_read_summary (curr_object_summary); } /* This function is called at the end of reading a gcda file. @@ -239,7 +240,8 @@ read_gcda_finalize (struct gcov_info *obj_info) set_fn_ctrs (curr_fn_info); obstack_ptr_grow (&fn_info, curr_fn_info); - /* We set the following fields: merge, n_functions, and functions. */ + /* We set the following fields: merge, n_functions, functions + and summary. */ obj_info->n_functions = num_fn_info; obj_info->functions = (const struct gcov_fn_info**) obstack_finish (&fn_info); @@ -299,6 +301,7 @@ read_gcda_file (const char *filename) obstack_init (&fn_info); num_fn_info = 0; curr_fn_info = 0; + curr_object_summary = NULL; { size_t len = strlen (filename) + 1; char *str_dup = (char*) xmalloc (len); @@ -892,8 +895,6 @@ calculate_2_entries (const unsigned long v1, const unsigned long v2, } /* Compute the overlap score between GCOV_INFO1 and GCOV_INFO2. - SUM_1 is the sum_all for profile1 where GCOV_INFO1 belongs. - SUM_2 is the sum_all for profile2 where GCOV_INFO2 belongs. This function also updates cumulative score CUM_1_RESULT and CUM_2_RESULT. */ @@ -1048,12 +1049,6 @@ struct overlap_t { /* Cumlative overlap dscore for profile1 and profile2. */ static double overlap_sum_1, overlap_sum_2; -/* sum_all for profile1 and profile2. */ -static gcov_type p1_sum_all, p2_sum_all; - -/* run_max for profile1 and profile2. */ -static gcov_type p1_run_max, p2_run_max; - /* The number of gcda files in the profiles. */ static unsigned gcda_files[2]; @@ -1200,10 +1195,6 @@ matched_gcov_info (const struct gcov_info *info1, const struct gcov_info *info2) return 1; } -/* Defined in libgcov-driver.c. */ -extern gcov_unsigned_t compute_summary (struct gcov_info *, - struct gcov_summary *); - /* Compute the overlap score of two profiles with the head of GCOV_LIST1 and GCOV_LIST1. Return a number ranging from [0.0, 1.0], with 0.0 meaning no match and 1.0 meaning a perfect match. */ @@ -1212,21 +1203,11 @@ static double calculate_overlap (struct gcov_info *gcov_list1, struct gcov_info *gcov_list2) { - struct gcov_summary this_prg; unsigned list1_cnt = 0, list2_cnt= 0, all_cnt; unsigned int i, j; const struct gcov_info *gi_ptr; struct overlap_t *all_infos; - compute_summary (gcov_list1, &this_prg); - overlap_sum_1 = (double) (this_prg.sum_all); - p1_sum_all = this_prg.sum_all; - p1_run_max = this_prg.run_max; - compute_summary (gcov_list2, &this_prg); - overlap_sum_2 = (double) (this_prg.sum_all); - p2_sum_all = this_prg.sum_all; - p2_run_max = this_prg.run_max; - for (gi_ptr = gcov_list1; gi_ptr; gi_ptr = gi_ptr->next) list1_cnt++; for (gi_ptr = gcov_list2; gi_ptr; gi_ptr = gi_ptr->next) @@ -1334,10 +1315,6 @@ calculate_overlap (struct gcov_info *gcov_list1, cold_gcda_files[1], both_cold_cnt); printf (" zero files: %12u\t%12u\t%12u\n", zero_gcda_files[0], zero_gcda_files[1], both_zero_cnt); - printf (" sum_all: %12" PRId64 "\t%12" PRId64 "\n", - p1_sum_all, p2_sum_all); - printf (" run_max: %12" PRId64 "\t%12" PRId64 "\n", - p1_run_max, p2_run_max); return prg_val; } -- cgit v1.1 From 5244089f1518bed96b73dfd52bbdc436f180696d Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Fri, 21 Sep 2018 13:09:51 +0000 Subject: Leverage cacheTextUpdate for __clear_cache on VxWorks 2018-09-21 Alexandre Oliva libgcc/ * config/vxcache.c: New file. Provide __clear_cache, based on the cacheTextUpdate VxWorks service. * config/t-vxworks (LIB2ADD): Add vxcache.c. (LIB2FUNCS_EXCLUDE): Add _clear_cache. * config/t-vxwoks7: Likewise. gcc/ * config/vxworks.h (CLEAR_INSN_CACHE): #define to 1. From-SVN: r264479 --- libgcc/ChangeLog | 8 ++++++++ libgcc/config/t-vxworks | 5 +++++ libgcc/config/t-vxworks7 | 5 +++++ libgcc/config/vxcache.c | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 libgcc/config/vxcache.c (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b172d71..928b5a8 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-21 Alexandre Oliva + + * config/vxcache.c: New file. Provide __clear_cache, based on + the cacheTextUpdate VxWorks service. + * config/t-vxworks (LIB2ADD): Add vxcache.c. + (LIB2FUNCS_EXCLUDE): Add _clear_cache. + * config/t-vxwoks7: Likewise. + 2018-09-21 Martin Liska * libgcov-driver.c (crc32_unsigned): Remove. diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks index df70fee..2db8e05 100644 --- a/libgcc/config/t-vxworks +++ b/libgcc/config/t-vxworks @@ -1,6 +1,11 @@ # Don't build libgcc.a with debug info LIBGCC2_DEBUG_CFLAGS = +# We provide our own implementation for __clear_cache, using a +# VxWorks specific entry point. +LIB2FUNCS_EXCLUDE += _clear_cache +LIB2ADD += $(srcdir)/config/vxcache.c + # Extra libgcc2 modules used by gthr-vxworks.h functions LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7 index f0293fe..054ab7c 100644 --- a/libgcc/config/t-vxworks7 +++ b/libgcc/config/t-vxworks7 @@ -1,6 +1,11 @@ # Don't build libgcc.a with debug info LIBGCC2_DEBUG_CFLAGS = +# We provide our own implementation for __clear_cache, using a +# VxWorks specific entry point. +LIB2FUNCS_EXCLUDE += _clear_cache +LIB2ADD += $(srcdir)/config/vxcache.c + # Extra libgcc2 modules used by gthr-vxworks.h functions LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c diff --git a/libgcc/config/vxcache.c b/libgcc/config/vxcache.c new file mode 100644 index 0000000..23c72fb --- /dev/null +++ b/libgcc/config/vxcache.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by Alexandre Oliva + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +/* Instruction cache invalidation routine using VxWorks' cacheLib. */ + +#include +#include + +void +__clear_cache (char *beg __attribute__((__unused__)), + char *end __attribute__((__unused__))) +{ + cacheTextUpdate (beg, end - beg); +} -- cgit v1.1 From 0a76bba487f54f1036b4b11f1cdc54582191e836 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 26 Sep 2018 17:25:15 +0200 Subject: crtprec.c (set_precision): Use fnstcw instead of fstcw. * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. From-SVN: r264649 --- libgcc/ChangeLog | 4 ++++ libgcc/config/i386/crtprec.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 928b5a8..e08168c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Uros Bizjak + + * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. + 2018-09-21 Alexandre Oliva * config/vxcache.c: New file. Provide __clear_cache, based on diff --git a/libgcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c index a397799..241e355 100644 --- a/libgcc/config/i386/crtprec.c +++ b/libgcc/config/i386/crtprec.c @@ -39,7 +39,7 @@ set_precision (void) { unsigned short int cwd; - asm volatile ("fstcw\t%0" : "=m" (cwd)); + asm volatile ("fnstcw\t%0" : "=m" (cwd)); cwd &= ~X87CW_PCMASK; cwd |= X87CW; -- cgit v1.1 From af8096fc2b6ee76426b021a2657291dfc62ca933 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 3 Oct 2018 22:29:10 +0200 Subject: libgcc2.c (isnan): Use __builtin_isnan. * libgcc2.c (isnan): Use __builtin_isnan. (isfinite): Use __builtin_isfinite. (isinf): Use __builtin_isinf. From-SVN: r264823 --- libgcc/ChangeLog | 18 ++++++++++++------ libgcc/libgcc2.c | 12 +++--------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e08168c..d4abb3b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-03 Uros Bizjak + + * libgcc2.c (isnan): Use __builtin_isnan. + (isfinite): Use __builtin_isfinite. + (isinf): Use __builtin_isinf. + 2018-09-26 Uros Bizjak * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. @@ -105,7 +111,7 @@ unordered store to release lock. (__sync_lock_release_8): Likewise. (SYNC_LOCK_RELEASE_2): Remove define. - + 2018-08-02 Nicolas Pitre PR libgcc/86512 @@ -416,7 +422,7 @@ * config/pa/fptr.c (_dl_read_access_allowed): New. (__canonicalize_funcptr_for_compare): Use it. - + 2018-02-28 Jakub Jelinek PR debug/83917 @@ -513,21 +519,21 @@ * config/rl78/t-rl78: Added smindi3.S to LIB2ADD. 2018-01-22 Sebastian Perta - + * config/rl78/smaxdi3.S: New assembly file. * config/rl78/t-rl78: Added smaxdi3.S to LIB2ADD. 2018-01-22 Sebastian Perta - + * config/rl78/umaxdi3.S: New assembly file. * config/rl78/t-rl78: Added umaxdi3.S to LIB2ADD. - + 2018-01-21 John David Anglin PR lto/83452 * config/pa/stublib.c (L_gnu_lto_v1): New stub definition. * config/pa/t-stublib (gnu_lto_v1-stub.o): Add make fragment. - + 2018-01-13 Richard Sandiford * config/aarch64/value-unwind.h (aarch64_vg): New function. diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index f418f3a..8ac2025 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1939,15 +1939,9 @@ NAME (TYPE x, int m) #define CONCAT2(A,B) _CONCAT2(A,B) #define _CONCAT2(A,B) A##B -/* All of these would be present in a full C99 implementation of - and . Our problem is that only a few systems have such full - implementations. Further, libgcc_s.so isn't currently linked against - libm.so, and even for systems that do provide full C99, the extra overhead - of all programs using libgcc having to link against libm. So avoid it. */ - -#define isnan(x) __builtin_expect ((x) != (x), 0) -#define isfinite(x) __builtin_expect (!isnan((x) - (x)), 1) -#define isinf(x) __builtin_expect (!isnan(x) & !isfinite(x), 0) +#define isnan(x) __builtin_isnan (x) +#define isfinite(x) __builtin_isfinite (x) +#define isinf(x) __builtin_isinf (x) #define INFINITY CONCAT2(__builtin_huge_val, CEXT) () #define I 1i -- cgit v1.1 From 3edbcdbead288664d874dd3a2e0d8ada4c565af0 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 4 Oct 2018 14:41:14 +0200 Subject: Fix divergence in indirect profiling (PR gcov-profile/84107). 2018-10-04 Martin Liska PR gcov-profile/84107 * tree-profile.c (init_ic_make_global_vars): Remove ic_void_ptr_var and ic_gcov_type_ptr_var. Come up with new ic_tuple* variables. Emit __gcov_indirect_call{,_topn} variables. (gimple_gen_ic_profiler): Access the variable and emit gimple. (gimple_gen_ic_func_profiler): Access __gcov_indirect_call.callee field. (gimple_init_gcov_profiler): Use ptr_type_node. * value-prof.c (gimple_ic): Use ptr_type_node. 2018-10-04 Martin Liska PR gcov-profile/84107 * libgcov-profiler.c (__gcov_indirect_call): Change type to indirect_call_tuple. (struct indirect_call_tuple): New struct. (__gcov_indirect_call_topn_profiler): Change type. (__gcov_indirect_call_profiler_v2): Use the new variables. * libgcov.h (struct indirect_call_tuple): New struct definition. From-SVN: r264840 --- libgcc/ChangeLog | 12 ++++++++++++ libgcc/libgcov-profiler.c | 25 ++++++++----------------- libgcc/libgcov.h | 9 +++++++++ 3 files changed, 29 insertions(+), 17 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d4abb3b..7987129 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,15 @@ +2018-10-04 Martin Liska + + PR gcov-profile/84107 + * libgcov-profiler.c (__gcov_indirect_call): + Change type to indirect_call_tuple. + (struct indirect_call_tuple): New struct. + (__gcov_indirect_call_topn_profiler): Change type. + (__gcov_indirect_call_profiler_v2): Use the new + variables. + * libgcov.h (struct indirect_call_tuple): New struct + definition. + 2018-10-03 Uros Bizjak * libgcc2.c (isnan): Use __builtin_isnan. diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 7e208d7..7a5e500 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -271,12 +271,7 @@ __gcov_topn_value_profiler_body (gcov_type *counters, gcov_type value) #if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif -gcov_type *__gcov_indirect_call_topn_counters ATTRIBUTE_HIDDEN; - -#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) -__thread -#endif -void *__gcov_indirect_call_topn_callee ATTRIBUTE_HIDDEN; +struct indirect_call_tuple __gcov_indirect_call_topn; #ifdef TARGET_VTABLE_USES_DESCRIPTORS #define VTABLE_USES_DESCRIPTORS 1 @@ -290,14 +285,14 @@ void *__gcov_indirect_call_topn_callee ATTRIBUTE_HIDDEN; void __gcov_indirect_call_topn_profiler (gcov_type value, void* cur_func) { - void *callee_func = __gcov_indirect_call_topn_callee; + void *callee_func = __gcov_indirect_call_topn.callee; /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ if (cur_func == callee_func || (VTABLE_USES_DESCRIPTORS && callee_func && *(void **) cur_func == *(void **) callee_func)) - __gcov_topn_value_profiler_body (__gcov_indirect_call_topn_counters, value); + __gcov_topn_value_profiler_body (__gcov_indirect_call_topn.counters, value); } #endif @@ -311,11 +306,7 @@ __gcov_indirect_call_topn_profiler (gcov_type value, void* cur_func) #if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif -void * __gcov_indirect_call_callee; -#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) -__thread -#endif -gcov_type * __gcov_indirect_call_counters; +struct indirect_call_tuple __gcov_indirect_call; /* By default, the C++ compiler will use function addresses in the vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero @@ -332,12 +323,12 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ - if (cur_func == __gcov_indirect_call_callee + if (cur_func == __gcov_indirect_call.callee || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ - && *(void **) cur_func == *(void **) __gcov_indirect_call_callee)) - __gcov_one_value_profiler_body (__gcov_indirect_call_counters, value, 0); + && *(void **) cur_func == *(void **) __gcov_indirect_call.callee)) + __gcov_one_value_profiler_body (__gcov_indirect_call.counters, value, 0); - __gcov_indirect_call_callee = NULL; + __gcov_indirect_call.callee = NULL; } #endif diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 2142287..ee05a68 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -226,6 +226,15 @@ struct gcov_master gcov_unsigned_t version; struct gcov_root *root; }; + +struct indirect_call_tuple +{ + /* Callee function. */ + void *callee; + + /* Pointer to counters. */ + gcov_type *counters; +}; /* Exactly one of these will be active in the process. */ extern struct gcov_master __gcov_master; -- cgit v1.1 From be86efa7cc3ff3f4cd99da34a7fb73b5043cb4d9 Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Mon, 8 Oct 2018 12:49:48 -0400 Subject: * config/pdp11/t-pdp11: Remove -mfloat32 switch. From-SVN: r264939 --- libgcc/ChangeLog | 4 ++++ libgcc/config/pdp11/t-pdp11 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7987129..bfdefb6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-10-08 Paul Koning + + * config/pdp11/t-pdp11: Remove -mfloat32 switch. + 2018-10-04 Martin Liska PR gcov-profile/84107 diff --git a/libgcc/config/pdp11/t-pdp11 b/libgcc/config/pdp11/t-pdp11 index 7cadae1..e6ba981 100644 --- a/libgcc/config/pdp11/t-pdp11 +++ b/libgcc/config/pdp11/t-pdp11 @@ -5,4 +5,4 @@ LIB2ADD = $(srcdir)/udivmod.c \ $(srcdir)/memmove.c \ $(srcdir)/memset.c -HOST_LIBGCC2_CFLAGS += -O2 -mfloat32 +HOST_LIBGCC2_CFLAGS += -O2 -- cgit v1.1 From 87f918e3803ff83d672b4b5272dcb1264409ad7c Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Fri, 12 Oct 2018 21:25:46 +0000 Subject: tighten the toplevel guard on ibm-ldouble.c 2018-10-12 Olivier Hainque * config/rs6000/ibm-ldouble.c: Augment the toplevel guard with defined (__FLOAT128_TYPE__) || defined (__LONG_DOUBLE_128__). From-SVN: r265135 --- libgcc/ChangeLog | 5 +++++ libgcc/config/rs6000/ibm-ldouble.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index bfdefb6..1883640 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-12 Olivier Hainque + + * config/rs6000/ibm-ldouble.c: Augment the toplevel guard with + defined (__FLOAT128_TYPE__) || defined (__LONG_DOUBLE_128__). + 2018-10-08 Paul Koning * config/pdp11/t-pdp11: Remove -mfloat32 switch. diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 9b9e94c..29f26c0 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -46,7 +46,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see the lower numbered register or lower addressed memory. */ #if (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)) \ - && !defined (__rtems__) + && !defined (__rtems__) \ + && (defined (__LONG_DOUBLE_128__) || defined (__FLOAT128_TYPE__)) #define fabs(x) __builtin_fabs(x) #define isless(x, y) __builtin_isless (x, y) -- cgit v1.1 From fc8abc466071bb3d8997e9fe7f0ae3faddcf50b8 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Wed, 17 Oct 2018 20:39:48 +0200 Subject: libgcc: apply LIB2FUNCS_EXCLUDE logic to LIB2FUNCS_ST One target file (config/c6x/t-elf) lists _printf and _gcc_bcmp in LIB2FUNCS_EXCLUDE, but that does not have any effect, since those are not filtered away from LIB2FUNCS_ST. Another option is to do as in config/rl78/t-rl78, which explicitly sets LIB2FUNCS_ST # Remove __gcc_bcmp from LIB2FUNCS_ST LIB2FUNCS_ST = _eprintf but honouring LIB2FUNCS_EXCLUDE also for LIB2FUNCS_ST seems more natural. From-SVN: r265246 --- libgcc/ChangeLog | 4 ++++ libgcc/Makefile.in | 2 ++ 2 files changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 1883640..0a69914 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-10-17 Rasmus Villemoes + + * Makefile.in (LIB2FUNCS_ST): Filter out LIB2FUNCS_EXCLUDE. + 2018-10-12 Olivier Hainque * config/rs6000/ibm-ldouble.c: Augment the toplevel guard with diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 0766de5..aeb96c4 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -472,6 +472,8 @@ lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs)) LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \ $(LIB2_DIVMOD_FUNCS)) +LIB2FUNCS_ST := $(filter-out $(LIB2FUNCS_EXCLUDE),$(LIB2FUNCS_ST)) + # Build "libgcc1" (assembly) components. lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS)) -- cgit v1.1 From a9a2fddbf2a93b8427478954d4efe9e02080454f Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Thu, 18 Oct 2018 14:01:15 -0400 Subject: udivmodsi4.c (__udivmodsi4): Rename to conform to coding standard. * udivmodsi4.c (__udivmodsi4): Rename to conform to coding standard. * divmod.c: Update references to __udivmodsi4. * udivmod.c: Ditto. * udivhi3.c: New file. * udivmodhi4.c: New file. * config/pdp11/t-pdp11 (LIB2ADD): Add the new files. From-SVN: r265277 --- libgcc/ChangeLog | 10 ++++++++++ libgcc/config/pdp11/t-pdp11 | 2 ++ libgcc/divmod.c | 7 ++++--- libgcc/udivhi3.c | 38 ++++++++++++++++++++++++++++++++++++ libgcc/udivmod.c | 7 ++++--- libgcc/udivmodhi4.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ libgcc/udivmodsi4.c | 2 +- 7 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 libgcc/udivhi3.c create mode 100644 libgcc/udivmodhi4.c (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 0a69914..722cf48 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2018-10-18 Paul Koning + + * udivmodsi4.c (__udivmodsi4): Rename to conform to coding + standard. + * divmod.c: Update references to __udivmodsi4. + * udivmod.c: Ditto. + * udivhi3.c: New file. + * udivmodhi4.c: New file. + * config/pdp11/t-pdp11 (LIB2ADD): Add the new files. + 2018-10-17 Rasmus Villemoes * Makefile.in (LIB2FUNCS_ST): Filter out LIB2FUNCS_EXCLUDE. diff --git a/libgcc/config/pdp11/t-pdp11 b/libgcc/config/pdp11/t-pdp11 index e6ba981..1363d09 100644 --- a/libgcc/config/pdp11/t-pdp11 +++ b/libgcc/config/pdp11/t-pdp11 @@ -1,5 +1,7 @@ LIB2ADD = $(srcdir)/udivmod.c \ $(srcdir)/udivmodsi4.c \ + $(srcdir)/udivhi3.c \ + $(srcdir)/udivmodhi4.c \ $(srcdir)/memcmp.c \ $(srcdir)/memcpy.c \ $(srcdir)/memmove.c \ diff --git a/libgcc/divmod.c b/libgcc/divmod.c index a67cc87..17261db 100644 --- a/libgcc/divmod.c +++ b/libgcc/divmod.c @@ -21,7 +21,8 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -long udivmodsi4 (); +extern unsigned long __udivmodsi4(unsigned long num, unsigned long den, + int modwanted); long __divsi3 (long a, long b) @@ -41,7 +42,7 @@ __divsi3 (long a, long b) neg = !neg; } - res = udivmodsi4 (a, b, 0); + res = __udivmodsi4 (a, b, 0); if (neg) res = -res; @@ -64,7 +65,7 @@ __modsi3 (long a, long b) if (b < 0) b = -b; - res = udivmodsi4 (a, b, 1); + res = __udivmodsi4 (a, b, 1); if (neg) res = -res; diff --git a/libgcc/udivhi3.c b/libgcc/udivhi3.c new file mode 100644 index 0000000..5f2dc12 --- /dev/null +++ b/libgcc/udivhi3.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +extern unsigned short __udivmodhi4(unsigned short num, unsigned short den, + int modwanted); + +unsigned short +__udivhi3 (unsigned short a, unsigned short b) +{ + return __udivmodhi4 (a, b, 0); +} + +unsigned short +__umodhi3 (unsigned short a, unsigned short b) +{ + return __udivmodhi4 (a, b, 1); +} + diff --git a/libgcc/udivmod.c b/libgcc/udivmod.c index dc1e76a..9dbcce4 100644 --- a/libgcc/udivmod.c +++ b/libgcc/udivmod.c @@ -21,17 +21,18 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -long udivmodsi4 (); +extern unsigned long __udivmodsi4(unsigned long num, unsigned long den, + int modwanted); long __udivsi3 (long a, long b) { - return udivmodsi4 (a, b, 0); + return __udivmodsi4 (a, b, 0); } long __umodsi3 (long a, long b) { - return udivmodsi4 (a, b, 1); + return __udivmodsi4 (a, b, 1); } diff --git a/libgcc/udivmodhi4.c b/libgcc/udivmodhi4.c new file mode 100644 index 0000000..551a135 --- /dev/null +++ b/libgcc/udivmodhi4.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +unsigned short +__udivmodhi4(unsigned short num, unsigned short den, int modwanted) +{ + unsigned short bit = 1; + unsigned short res = 0; + + while (den < num && bit && !(den & (1L<<31))) + { + den <<=1; + bit <<=1; + } + while (bit) + { + if (num >= den) + { + num -= den; + res |= bit; + } + bit >>=1; + den >>=1; + } + if (modwanted) return num; + return res; +} diff --git a/libgcc/udivmodsi4.c b/libgcc/udivmodsi4.c index 69e0349..b7dabb1 100644 --- a/libgcc/udivmodsi4.c +++ b/libgcc/udivmodsi4.c @@ -22,7 +22,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ unsigned long -udivmodsi4(unsigned long num, unsigned long den, int modwanted) +__udivmodsi4(unsigned long num, unsigned long den, int modwanted) { unsigned long bit = 1; unsigned long res = 0; -- cgit v1.1 From 19b5595858162b8a77b84db93b21b39a48dc2d0e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 24 Oct 2018 10:47:59 +0200 Subject: Remove reduntant dumps and make tp_first_run dump more compact. 2018-10-24 Martin Liska * cgraph.c (cgraph_node::dump): Remove reduntant dumps and make tp_first_run dump more compact. 2018-10-24 Martin Liska * libgcov-profiler.c: Start from 1 in order to distinguish functions which were seen and these that were not. From-SVN: r265454 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-profiler.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 722cf48..73c6f59 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-24 Martin Liska + + * libgcov-profiler.c: Start from 1 in order to distinguish + functions which were seen and these that were not. + 2018-10-18 Paul Koning * udivmodsi4.c (__udivmodsi4): Rename to conform to coding diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 7a5e500..47c00ee 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -335,7 +335,7 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) #ifdef L_gcov_time_profiler /* Counter for first visit of each function. */ -gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN; +gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN = 1; #endif -- cgit v1.1 From 3239d72683c6ebd12d002a73ba8de539403c3cd6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 25 Oct 2018 17:36:12 +0200 Subject: Revert partially changes from r265454 (PR other/87735). 2018-10-25 Martin Liska PR other/87735 * gcc.dg/tree-prof/time-profiler-1.c: Revert. * gcc.dg/tree-prof/time-profiler-2.c: Likewise. * gcc.dg/tree-prof/time-profiler-3.c: Likewise. 2018-10-25 Martin Liska PR other/87735 * libgcov-profiler.c: Revert. From-SVN: r265494 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-profiler.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 73c6f59..44fe732 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-25 Martin Liska + + PR other/87735 + * libgcov-profiler.c: Revert. + 2018-10-24 Martin Liska * libgcov-profiler.c: Start from 1 in order to distinguish diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 47c00ee..7a5e500 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -335,7 +335,7 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) #ifdef L_gcov_time_profiler /* Counter for first visit of each function. */ -gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN = 1; +gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN; #endif -- cgit v1.1 From be7b071e9e99c4958acfa0f9c8dab79cd30d2176 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 30 Oct 2018 09:33:04 +0100 Subject: libgcc: properly destroy mutexes on VxWorks Just as one needs run-time initialization of mutexes, one needs to destroy them properly to allow the OS to release resources associated with the semaphore. From-SVN: r265616 --- libgcc/ChangeLog | 4 ++++ libgcc/config/gthr-vxworks.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 44fe732..1be4f87 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-10-30 Rasmus Villemoes + + * config/gthr-vxworks.h (__gthread_mutex_destroy): Call semDelete. + 2018-10-25 Martin Liska PR other/87735 diff --git a/libgcc/config/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h index e43253b..e974aa7 100644 --- a/libgcc/config/gthr-vxworks.h +++ b/libgcc/config/gthr-vxworks.h @@ -63,8 +63,9 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex) } static inline int -__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex)) +__gthread_mutex_destroy (__gthread_mutex_t *mutex) { + semDelete(*mutex); return 0; } -- cgit v1.1 From 8180cde0fb12e1aa10a74319d24cfa9619a60261 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Wed, 31 Oct 2018 12:27:07 +0100 Subject: [ARC] Remove non standard funcions calls. Replace all custom "library" calls with compiler known patterns. gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.md (mulsi3): Remove call to mulsi_600_lib. (mulsi3_600_lib): Remove pattern. (umulsi3_highpart_600_lib_le): Likewise. (umulsi3_highpart): Remove call to umulsi3_highpart_600_lib_le. (umulsidi3): Remove call to umulsidi3_600_lib. (umulsidi3_600_lib): Remove pattern. (peephole2): Remove peephole using the above deprecated patterns. testsuite/ xxxx-xx-xx Claudiu Zissulescu * gcc.target/arc/mulsi3_highpart-2.c: Update test. libgcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/lib1funcs.S (_muldi3): New function. * config/arc/t-arc (LIB1ASMFUNCS): Add _muldi3. From-SVN: r265672 --- libgcc/ChangeLog | 5 ++++ libgcc/config/arc/lib1funcs.S | 54 +++++++++++++++++++++++++++++++++++++++++++ libgcc/config/arc/t-arc | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 1be4f87..d3edd5c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-31 Claudiu Zissulescu + + * config/arc/lib1funcs.S (_muldi3): New function. + * config/arc/t-arc (LIB1ASMFUNCS): Add _muldi3. + 2018-10-30 Rasmus Villemoes * config/gthr-vxworks.h (__gthread_mutex_destroy): Call semDelete. diff --git a/libgcc/config/arc/lib1funcs.S b/libgcc/config/arc/lib1funcs.S index 9a62602..249dd7a 100644 --- a/libgcc/config/arc/lib1funcs.S +++ b/libgcc/config/arc/lib1funcs.S @@ -232,6 +232,60 @@ SYM(__umulsi3_highpart): #endif #endif /* L_umulsidi3 */ +#ifdef L_muldi3 + .section .text + .align 4 + .global SYM(__muldi3) +SYM(__muldi3): +#ifdef __LITTLE_ENDIAN__ + push_s blink + mov_s r4,r3 ;4 + mov_s r5,r2 ;4 + mov_s r9,r0 ;4 + mov_s r8,r1 ;4 + bl.d @__umulsidi3 + mov_s r1,r2 ;4 + mov_s r6,r0 ;4 + mov_s r7,r1 ;4 + mov_s r0,r9 ;4 + bl.d @__mulsi3 + mov_s r1,r4 ;4 + mov_s r4,r0 ;4 + mov_s r1,r8 ;4 + bl.d @__mulsi3 + mov_s r0,r5 ;4 + pop_s blink + add_s r0,r0,r4 ;2 + add r1,r0,r7 + j_s.d [blink] + mov_s r0,r6 ;4 +#else + push_s blink + mov_s r5,r3 + mov_s r9,r2 + mov_s r4,r1 + mov_s r8,r0 + mov_s r0,r1 + bl.d @__umulsidi3 + mov_s r1,r3 + mov_s r7,r0 + mov_s r6,r1 + mov_s r0,r4 + bl.d @__mulsi3 + mov_s r1,r9 + mov_s r4,r0 + mov_s r1,r8 + bl.d @__mulsi3 + mov_s r0,r5 + pop_s blink + add_s r0,r0,r4 + add_s r0,r0,r7 + j_s.d [blink] + mov_s r1,r6 +#endif /* __LITTLE_ENDIAN__ */ +ENDFUNC(__muldi3) +#endif /* L_muldi3 */ + #ifdef L_umulsi3_highpart #include "ieee-754/arc-ieee-754.h" /* For use without a barrel shifter, and for ARC700 / ARC_MUL64, the diff --git a/libgcc/config/arc/t-arc b/libgcc/config/arc/t-arc index ad30fdb..c79bc1c 100644 --- a/libgcc/config/arc/t-arc +++ b/libgcc/config/arc/t-arc @@ -21,7 +21,7 @@ CROSS_LIBGCC1 = libgcc1-asm.a LIB1ASMSRC = arc/lib1funcs.S -LIB1ASMFUNCS = _mulsi3 _umulsidi3 _umulsi3_highpart \ +LIB1ASMFUNCS = _mulsi3 _umulsidi3 _umulsi3_highpart _muldi3 \ _udivsi3 _divsi3 _umodsi3 _modsi3 \ _divmod_tools _clzsi2 \ _millicodethunk_st _millicodethunk_ld _millicodethunk_ret \ -- cgit v1.1 From 22e052725189a472e4e86ebb6595278a49f4bcdd Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 31 Oct 2018 17:03:16 +0000 Subject: Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). This patch updates GCC to use autoconf 2.69 and automake 1.15.1. (That's not the latest automake version, but it's the one used by binutils-gdb, with which consistency is desirable, and in any case seems a useful incremental update that should make a future update to 1.16.1 easier.) The changes are generally similar to the binutils-gdb ones, and are copied from there where shared files and directories are involved (there are some further changes to such shared directories, however, which I'd expect to apply to binutils-gdb once this patch is in GCC). Largely, obsolete AC_PREREQ calls are removed, while many AC_LANG_SOURCE calls are added to avoid warnings from aclocal and autoconf. Multilib support is no longer included in core automake, meaning that multilib.am needs copying from automake's contrib directory into the GCC source tree. Autoconf 2.69 has Go support, so local copies of that support are removed. I hope the D support will soon be submitted to upstream autoconf so the local copy of that can be removed in a future update. Changes to how automake generates runtest calls mean quotes are removed from RUNTEST definitions in five lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm, libphobos, libvtv; some others have RUNTEST definitions without quotes, which are still OK); libgo and libphobos also get -Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST do not generate automake warnings. Note that the regeneration did not include regeneration of fixincludes/config.h.in (attempting such regeneration resulted in all the USED_FOR_TARGET conditionals disappearing; and I don't see anything in the fixincludes/ directory that would result in such conditionals being generated, unlike in the gcc/ directory). Also note that libvtv/testsuite/other-tests/Makefile.in was not regenerated; that directory is not listed as a subdirectory for which Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm not sure how it's meant to be regenerated. While I mostly fixed warnings should running aclocal / automake / autoconf, there were various such warnings from automake in the libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos directories that I did not fix, preferring to leave those to the relevant subsystem maintainers. Specifically, most of those warnings were of the following form (example from libgfortran): Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory, Makefile.am:48: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. I think it's best for the relevant maintainers to add subdir-objects and do any other associated Makefile.am changes needed. In some cases the paths in the warnings involved ../; I don't know if that adds any extra complications to the use of subdir-objects. I've tested this with native, cross and Canadian cross builds. The risk of any OS-specific issues should I hope be rather lower than if a libtool upgrade were included (we *should* do such an upgrade at some point, but it's more complicated - it involves identifying all our local libtool changes to see if any aren't included in the upstream version we update to, and reverting an upstream libtool patch that's inappropriate for use in GCC); I think it would be better to get this update into GCC so that people can test in different configurations and we can fix any issues found, rather than to try to get more and more testing done before it goes in. top level: 2018-10-31 Joseph Myers PR bootstrap/82856 * multilib.am: New file. From automake. Merge from binutils-gdb: 2018-06-19 Simon Marchi * libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE. * ar-lib: New file. * test-driver: New file. * configure: Re-generate. config: 2018-10-31 Joseph Myers PR bootstrap/82856 * math.m4, tls.m4: Use AC_LANG_SOURCE. Merge from binutils-gdb: 2018-06-19 Simon Marchi * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. fixincludes: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * aclocal.m4, configure: Regenerate. gcc: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use single line for second argument of AC_DEFINE_UNQUOTED. * doc/install.texi (Tools/packages necessary for modifying GCC): Update to autoconf 2.69 and automake 1.15.1. * aclocal.m4, config.in, configure: Regenerate. gnattools: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * configure: Regenerate. gotools: 2018-10-31 Joseph Myers PR bootstrap/82856 * config/go.m4: Remove file. * Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config. * configure.ac: Remove AC_PREREQ. Do not include config/go.m4. * Makefile.in, aclocal.m4, configure: Regenerate. intl: 2018-10-31 Joseph Myers PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ. * configure: Re-generate. * config.h.in: Re-generate. * aclocal.m4: Re-generate. libada: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * configure: Regenerate. libatomic: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * acinclude.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libbacktrace: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libcc1: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure: Regenerate. libcpp: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * aclocal.m4, config.in, configure: Regenerate. libdecnumber: 2018-10-31 Joseph Myers PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * aclocal.m4. libffi: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove doc/libffi.info. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, fficonfig.h.in, include/Makefile.in, man/Makefile.in, testsuite/Makefile.in: Regenerate. libgcc: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * configure: Regenerate. libgfortran: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libgo [logically part of this change but omitted from the commit]: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * config/go.m4: Remove file. * config/libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use -Wno-override in AM_INIT_AUTOMAKE call. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libgomp: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove libgomp.info. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libhsail-rt: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure: Regenerate. libiberty: 2018-10-31 Joseph Myers PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * config.in: Re-generate. libitm: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove libitm.info. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libobjc: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * aclocal.m4, config.h.in, configure: Regenerate. liboffloadmic: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * plugin/Makefile.am: Include multilib.am. * plugin/configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, plugin/Makefile.in, plugin/aclocal.m4, plugin/configure: Regenerate. libphobos: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use -Wno-override in AM_INIT_AUTOMAKE call. * m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call. * m4/druntime/os.m4: Use AC_LANG_SOURCE. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in, src/Makefile.in, testsuite/Makefile.in: Regenerate. libquadmath: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Remove 1.8. Add info-in-builddir. (all-local): Define outside conditional code. (CLEANFILES): Remove libquadmath.info. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libsanitizer: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, asan/Makefile.in, configure, interception/Makefile.in, libbacktrace/Makefile.in, lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in, ubsan/Makefile.in: Regenerate. libssp: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Remove 1.9.5. * configure.ac: Remove AC_PREREQ. Quote argument to AC_RUN_IFELSE. * Makefile.in, aclocal.m4, configure: Regenerate. libstdc++-v3: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, doc/Makefile.in, include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in, src/c++17/Makefile.in, src/c++98/Makefile.in, src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate. libvtv: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. lto-plugin: 2018-10-31 Joseph Myers PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. zlib: 2018-10-31 Joseph Myers PR bootstrap/82856 * Makefile.am: Include multilib.am. Merge from binutils-gdb: 2018-06-19 Simon Marchi * configure.ac: Modernize AC_INIT call, remove AC_PREREQ. * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. From-SVN: r265695 --- libgcc/ChangeLog | 6 + libgcc/configure | 856 +++++++++++++++++++++++++++++----------------------- libgcc/configure.ac | 19 +- 3 files changed, 488 insertions(+), 393 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d3edd5c..aadd45c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-31 Joseph Myers + + PR bootstrap/82856 + * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. + * configure: Regenerate. + 2018-10-31 Claudiu Zissulescu * config/arc/lib1funcs.S (_muldi3): New function. diff --git a/libgcc/configure b/libgcc/configure index f0b6116..36dbbc1 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -1,10 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for GNU C Runtime Library 1.0. +# Generated by GNU Autoconf 2.69 for GNU C Runtime Library 1.0. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -87,6 +87,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -131,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -164,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -209,14 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -314,10 +352,18 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -354,19 +400,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -439,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -473,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -494,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -524,10 +554,11 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -756,8 +787,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -802,7 +834,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -828,7 +860,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1032,7 +1064,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1048,7 +1080,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1078,8 +1110,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1087,7 +1119,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1097,7 +1129,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1105,13 +1137,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1134,7 +1166,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1148,8 +1180,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1164,9 +1194,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1205,11 +1235,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1249,7 +1279,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1350,7 +1380,7 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor @@ -1423,9 +1453,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GNU C Runtime Library configure 1.0 -generated by GNU Autoconf 2.64 +generated by GNU Autoconf 2.69 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1469,8 +1499,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1495,7 +1525,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1506,8 +1536,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1548,8 +1578,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1570,7 +1600,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1586,7 +1617,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1612,7 +1644,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1628,7 +1661,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1662,7 +1696,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1726,8 +1761,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -1739,7 +1774,7 @@ ac_fn_c_check_header_preproc () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1751,12 +1786,12 @@ if ac_fn_c_try_cpp "$LINENO"; then : else eval "$3=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_preproc cat >config.log <<_ACEOF @@ -1764,7 +1799,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU C Runtime Library $as_me 1.0, which was -generated by GNU Autoconf 2.64. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1874,11 +1909,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1912,11 +1945,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1929,11 +1960,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1947,11 +1976,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2006,7 +2033,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2017,18 +2049,22 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in @@ -2097,7 +2133,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2156,16 +2192,22 @@ fi ac_aux_dir= for ac_dir in $libgcc_topdir "$srcdir"/$libgcc_topdir; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in $libgcc_topdir \"$srcdir\"/$libgcc_topdir" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in $libgcc_topdir \"$srcdir\"/$libgcc_topdir" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2234,7 +2276,7 @@ if test "${with_aix_soname+set}" = set; then : $as_echo_n "checking which variant of shared library versioning to provide for shared libgcc... " >&6; } case ${withval} in aix|svr4|both) ;; - *) as_fn_error "Unknown argument to --with-aix-soname" "$LINENO" 5;; + *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 $as_echo "$withval" >&6; } @@ -2250,27 +2292,27 @@ fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2288,14 +2330,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -2303,7 +2345,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2409,7 +2451,7 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : enableval=$enable_version_specific_runtime_libs; case "$enableval" in yes) version_specific_libs=yes ;; no) version_specific_libs=no ;; - *) as_fn_error "Unknown argument to enable/disable version-specific libs" "$LINENO" 5;; + *) as_fn_error $? "Unknown argument to enable/disable version-specific libs" "$LINENO" 5;; esac else version_specific_libs=no @@ -2441,7 +2483,7 @@ if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; case ${enable_maintainer_mode} in yes) MAINT='' ;; no) MAINT='#' ;; - *) as_fn_error "--enable-maintainer-mode must be yes or no" "$LINENO" 5 ;; + *) as_fn_error $? "--enable-maintainer-mode must be yes or no" "$LINENO" 5 ;; esac maintainer_mode=${enableval} else @@ -2466,7 +2508,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2486,7 +2528,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2549,7 +2591,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2561,7 +2603,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2587,7 +2629,7 @@ done # We need awk; bail out if it's missing. case ${AWK} in - "") as_fn_error "can't build without awk, bailing out" "$LINENO" 5 ;; + "") as_fn_error $? "can't build without awk, bailing out" "$LINENO" 5 ;; esac @@ -2676,7 +2718,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -2688,7 +2730,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2716,7 +2758,7 @@ if test -z "$ac_cv_prog_AR"; then set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -2728,7 +2770,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2768,7 +2810,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -2780,7 +2822,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2808,7 +2850,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -2820,7 +2862,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2860,7 +2902,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NM+set}" = set; then : +if ${ac_cv_prog_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -2872,7 +2914,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2900,7 +2942,7 @@ if test -z "$ac_cv_prog_NM"; then set dummy nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then : +if ${ac_cv_prog_ac_ct_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then @@ -2912,7 +2954,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2952,7 +2994,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -2964,7 +3006,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2992,7 +3034,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -3004,7 +3046,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3044,7 +3086,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -3056,7 +3098,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3084,7 +3126,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -3096,7 +3138,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3154,7 +3196,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3166,7 +3208,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3194,7 +3236,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3206,7 +3248,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3247,7 +3289,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3259,7 +3301,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3287,7 +3329,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3300,7 +3342,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3346,7 +3388,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3358,7 +3400,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3390,7 +3432,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3402,7 +3444,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3444,8 +3486,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3466,8 +3508,8 @@ $as_echo "$ac_try_echo"; } >&5 ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err fi + rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3512,12 +3554,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -3579,62 +3621,28 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" @@ -3664,20 +3672,79 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi -rm -f conftest$ac_cv_exeext +rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3717,8 +3784,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3728,7 +3795,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3765,7 +3832,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3843,7 +3910,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3852,8 +3919,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3950,7 +4016,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3980,7 +4046,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3996,11 +4062,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4039,7 +4105,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4055,18 +4121,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4088,7 +4154,7 @@ if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -4139,7 +4205,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -4208,7 +4274,7 @@ rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -4275,6 +4341,8 @@ _ACEOF esac rm -rf conftest* fi + + fi @@ -4285,7 +4353,7 @@ fi # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } -if test "${ac_cv_sizeof_double+set}" = set; then : +if ${ac_cv_sizeof_double+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : @@ -4294,9 +4362,8 @@ else if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (double) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double=0 fi @@ -4319,7 +4386,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 $as_echo_n "checking size of long double... " >&6; } -if test "${ac_cv_sizeof_long_double+set}" = set; then : +if ${ac_cv_sizeof_long_double+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : @@ -4328,9 +4395,8 @@ else if test "$ac_cv_type_long_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long double) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long double) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_double=0 fi @@ -4359,8 +4425,7 @@ for ac_header in inttypes.h stdint.h stdlib.h ftw.h \ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4370,7 +4435,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4384,7 +4449,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4419,7 +4484,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4433,7 +4498,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4450,7 +4515,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4485,7 +4550,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4500,7 +4565,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4614,7 +4679,7 @@ fi # Check for decimal float support. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether decimal floating point is supported" >&5 $as_echo_n "checking whether decimal floating point is supported... " >&6; } -if test "${libgcc_cv_dfp+set}" = set; then : +if ${libgcc_cv_dfp+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4652,7 +4717,7 @@ if test "${enable_decimal_float+set}" = set; then : enableval=$enable_decimal_float; case $enable_decimal_float in yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;; - *) as_fn_error "'$enable_decimal_float' is an invalid value for --enable-decimal-float. + *) as_fn_error $? "'$enable_decimal_float' is an invalid value for --enable-decimal-float. Valid choices are 'yes', 'bid', 'dpd', and 'no'." "$LINENO" 5 ;; esac @@ -4701,7 +4766,7 @@ esac # Check for fixed-point support. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fixed-point is supported" >&5 $as_echo_n "checking whether fixed-point is supported... " >&6; } -if test "${libgcc_cv_fixed_point+set}" = set; then : +if ${libgcc_cv_fixed_point+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4763,7 +4828,7 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h # Check if the compiler is configured for setjmp/longjmp exceptions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is configured for setjmp/longjmp exceptions" >&5 $as_echo_n "checking whether the compiler is configured for setjmp/longjmp exceptions... " >&6; } -if test "${ac_cv_sjlj_exceptions+set}" = set; then : +if ${ac_cv_sjlj_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4794,7 +4859,7 @@ if test "${enable_cet+set}" = set; then : enableval=$enable_cet; case "$enableval" in yes|no|auto) ;; - *) as_fn_error "Unknown argument to enable/disable cet" "$LINENO" 5 ;; + *) as_fn_error $? "Unknown argument to enable/disable cet" "$LINENO" 5 ;; esac else @@ -4851,7 +4916,7 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else - as_fn_error "assembler with CET support is required for --enable-cet" "$LINENO" 5 + as_fn_error $? "assembler with CET support is required for --enable-cet" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; @@ -4878,7 +4943,7 @@ if test "${enable_explicit_exception_frame_registration+set}" = set; then : force_explicit_eh_registry= if test "$enable_explicit_exception_frame_registration" = yes; then if test $ac_cv_sjlj_exceptions = yes; then - as_fn_error "Can't --enable-explicit-exception-frame-registration + as_fn_error $? "Can't --enable-explicit-exception-frame-registration with setjmp/longjmp exceptions" "$LINENO" 5 fi force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS @@ -4890,7 +4955,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${acl_cv_prog_gnu_ld+set}" = set; then : +if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. @@ -4914,7 +4979,7 @@ $as_echo "$target_thread_file" >&6; } # Check for assembler CFI support. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports CFI directives" >&5 $as_echo_n "checking whether assembler supports CFI directives... " >&6; } -if test "${libgcc_cv_cfi+set}" = set; then : +if ${libgcc_cv_cfi+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4952,7 +5017,7 @@ case ${host} in mips*-*-*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target is hard-float" >&5 $as_echo_n "checking whether the target is hard-float... " >&6; } -if test "${libgcc_cv_mips_hard_float+set}" = set; then : +if ${libgcc_cv_mips_hard_float+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4960,6 +5025,7 @@ else #ifndef __mips_hard_float #error FOO #endif + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libgcc_cv_mips_hard_float=yes @@ -4977,7 +5043,7 @@ case ${host} in # Check for system-provided CRTs on Solaris 11.4. { $as_echo "$as_me:${as_lineno-$LINENO}: checking system-provided CRTs on Solaris" >&5 $as_echo_n "checking system-provided CRTs on Solaris... " >&6; } -if test "${libgcc_cv_solaris_crts+set}" = set; then : +if ${libgcc_cv_solaris_crts+:} false; then : $as_echo_n "(cached) " >&6 else libgcc_cv_solaris_crts=no @@ -5015,7 +5081,7 @@ if echo "$with_glibc_version" | grep '^[0-9][0-9]*\.[0-9][0-9]*$'; then glibc_version_major=`echo "$with_glibc_version" | sed -e 's/\..*//'` glibc_version_minor=`echo "$with_glibc_version" | sed -e 's/.*\.//'` else - as_fn_error "option --with-glibc-version requires a version number M.N" "$LINENO" 5 + as_fn_error $? "option --with-glibc-version requires a version number M.N" "$LINENO" 5 fi else @@ -5083,7 +5149,7 @@ powerpc*-*-linux*) CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; } -if test "${libgcc_cv_powerpc_float128+set}" = set; then : +if ${libgcc_cv_powerpc_float128+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5103,7 +5169,7 @@ $as_echo "$libgcc_cv_powerpc_float128" >&6; } CFLAGS="$CFLAGS -mpower9-vector -mfloat128-hardware" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 3.0 to build hardware __float128 libraries" >&5 $as_echo_n "checking for PowerPC ISA 3.0 to build hardware __float128 libraries... " >&6; } -if test "${libgcc_cv_powerpc_float128_hw+set}" = set; then : +if ${libgcc_cv_powerpc_float128_hw+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5222,7 +5288,7 @@ esac # we can check for asm_hidden_op. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5 $as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; } -if test "${libgcc_cv_hidden_visibility_attribute+set}" = set; then : +if ${libgcc_cv_hidden_visibility_attribute+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5259,7 +5325,7 @@ fi # Check for .cfi_sections .debug_frame support. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for .cfi_sections .debug_frame" >&5 $as_echo_n "checking for .cfi_sections .debug_frame... " >&6; } -if test "${libgcc_cv_cfi_sections_directive+set}" = set; then : +if ${libgcc_cv_cfi_sections_directive+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5297,7 +5363,7 @@ if test "${enable_tls+set}" = set; then : enableval=$enable_tls; case "$enableval" in yes|no) ;; - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;; + *) as_fn_error $? "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;; esac else @@ -5307,7 +5373,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target assembler supports thread-local storage" >&5 $as_echo_n "checking whether the target assembler supports thread-local storage... " >&6; } -if test "${gcc_cv_have_cc_tls+set}" = set; then : +if ${gcc_cv_have_cc_tls+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5335,7 +5401,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the thread-local storage support is from emutls" >&5 $as_echo_n "checking whether the thread-local storage support is from emutls... " >&6; } -if test "${gcc_cv_use_emutls+set}" = set; then : +if ${gcc_cv_use_emutls+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5373,7 +5439,7 @@ case "${target}" in i[34567]86-*-* | x86_64-*-*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports AVX" >&5 $as_echo_n "checking if the assembler supports AVX... " >&6; } -if test "${libgcc_cv_as_avx+set}" = set; then : +if ${libgcc_cv_as_avx+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5408,7 +5474,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for init priority support" >&5 $as_echo_n "checking for init priority support... " >&6; } -if test "${libgcc_cv_init_priority+set}" = set; then : +if ${libgcc_cv_init_priority+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5582,10 +5648,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -5601,6 +5678,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -5616,7 +5694,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -5717,6 +5795,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5762,19 +5841,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -5912,16 +5991,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5970,7 +6049,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -5981,28 +6060,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -6024,7 +6091,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by GNU C Runtime Library $as_me 1.0, which was -generated by GNU Autoconf 2.64. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6064,6 +6131,7 @@ Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -6088,12 +6156,13 @@ General help using GNU software: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ GNU C Runtime Library config.status 1.0 -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6110,11 +6179,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -6128,12 +6202,15 @@ do ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -6146,7 +6223,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -6155,7 +6232,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -6175,7 +6252,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -6221,7 +6298,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -6244,9 +6321,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -6254,12 +6332,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -6276,12 +6355,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -6290,18 +6369,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6309,7 +6388,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -6323,7 +6402,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -6337,7 +6416,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -6357,7 +6436,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -6389,21 +6468,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -6415,7 +6502,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -6427,11 +6514,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6516,7 +6603,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -6529,7 +6616,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6548,7 +6635,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -6557,7 +6644,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -6583,8 +6670,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -6714,23 +6801,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -6739,21 +6827,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -6780,7 +6868,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -6801,7 +6889,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 5fcbac6..8e96caf 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -13,7 +13,6 @@ sinclude(../config/gthr.m4) sinclude(../config/sjlj.m4) sinclude(../config/cet.m4) -AC_PREREQ(2.64) AC_INIT([GNU C Runtime Library], 1.0,,[libgcc]) AC_CONFIG_SRCDIR([static-object.mk]) @@ -229,7 +228,8 @@ GCC_AC_ENABLE_DECIMAL_FLOAT([$host]) # Check for fixed-point support. AC_CACHE_CHECK([whether fixed-point is supported], [libgcc_cv_fixed_point], - [AC_COMPILE_IFELSE([_Sat _Fract x;], [libgcc_cv_fixed_point=yes], + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Sat _Fract x;])], + [libgcc_cv_fixed_point=yes], [libgcc_cv_fixed_point=no])]) fixed_point=$libgcc_cv_fixed_point AC_SUBST(fixed_point) @@ -270,11 +270,11 @@ AC_MSG_RESULT([$target_thread_file]) # Check for assembler CFI support. AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi], [AC_COMPILE_IFELSE( -[asm("\n\ +[AC_LANG_SOURCE([asm("\n\ .text\n\ .cfi_startproc\n\ .cfi_personality 0, symbol\n\ - .cfi_endproc");], + .cfi_endproc");])], [libgcc_cv_cfi=yes], [libgcc_cv_cfi=no])]) @@ -296,9 +296,10 @@ mips*-*-*) AC_CACHE_CHECK([whether the target is hard-float], [libgcc_cv_mips_hard_float], [AC_COMPILE_IFELSE( - [#ifndef __mips_hard_float + [AC_LANG_SOURCE([#ifndef __mips_hard_float #error FOO - #endif], + #endif + ])], [libgcc_cv_mips_hard_float=yes], [libgcc_cv_mips_hard_float=no])]) esac @@ -395,7 +396,7 @@ powerpc*-*-linux*) AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], [libgcc_cv_powerpc_float128], [AC_COMPILE_IFELSE( - [vector double dadd (vector double a, vector double b) { return a + b; }], + [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])], [libgcc_cv_powerpc_float128=yes], [libgcc_cv_powerpc_float128=no])]) @@ -403,7 +404,7 @@ powerpc*-*-linux*) AC_CACHE_CHECK([for PowerPC ISA 3.0 to build hardware __float128 libraries], [libgcc_cv_powerpc_float128_hw], [AC_COMPILE_IFELSE( - [#include + [AC_LANG_SOURCE([#include #ifndef AT_PLATFORM #error "AT_PLATFORM is not defined" #endif @@ -418,7 +419,7 @@ powerpc*-*-linux*) } void *add_resolver (void) { return (void *) add; } __float128 add_ifunc (__float128, __float128) - __attribute__ ((__ifunc__ ("add_resolver")));], + __attribute__ ((__ifunc__ ("add_resolver")));])], [libgcc_cv_powerpc_float128_hw=yes], [libgcc_cv_powerpc_float128_hw=no])]) CFLAGS="$saved_CFLAGS" -- cgit v1.1 From 4310ca662ab30f0bf73cd71d9a89f0779189c00d Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Thu, 1 Nov 2018 14:36:52 -0400 Subject: t-pdp11 (LIB2ADD): Add divmod.c. * config/pdp11/t-pdp11 (LIB2ADD): Add divmod.c. (HOST_LIBGCC2_CFLAGS): Change to optimize for size. From-SVN: r265726 --- libgcc/ChangeLog | 5 +++++ libgcc/config/pdp11/t-pdp11 | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index aadd45c..6da80c1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-01 Paul Koning + + * config/pdp11/t-pdp11 (LIB2ADD): Add divmod.c. + (HOST_LIBGCC2_CFLAGS): Change to optimize for size. + 2018-10-31 Joseph Myers PR bootstrap/82856 diff --git a/libgcc/config/pdp11/t-pdp11 b/libgcc/config/pdp11/t-pdp11 index 1363d09..a2e4287 100644 --- a/libgcc/config/pdp11/t-pdp11 +++ b/libgcc/config/pdp11/t-pdp11 @@ -1,4 +1,5 @@ -LIB2ADD = $(srcdir)/udivmod.c \ +LIB2ADD = $(srcdir)/divmod.c \ + $(srcdir)/udivmod.c \ $(srcdir)/udivmodsi4.c \ $(srcdir)/udivhi3.c \ $(srcdir)/udivmodhi4.c \ @@ -7,4 +8,5 @@ LIB2ADD = $(srcdir)/udivmod.c \ $(srcdir)/memmove.c \ $(srcdir)/memset.c -HOST_LIBGCC2_CFLAGS += -O2 +# Small machine, optimize for size +HOST_LIBGCC2_CFLAGS += -Os -- cgit v1.1 From 2901f42f4bd75cf7f3fd00efc1b4f0719bc9b728 Mon Sep 17 00:00:00 2001 From: Venkataramanan Kumar Date: Sun, 4 Nov 2018 11:17:54 +0000 Subject: Enable support for next generation AMD Zen CPU, via -march=znver2. gcc/ChangeLog: * common/config/i386/i386-common.c (processor_alias_table): Add znver2 entry. * config.gcc (i[34567]86-*-linux* | ...): Add znver2. (case ${target}): Add znver2. * config/i386/driver-i386.c: (host_detect_local_cpu): Let -march=native recognize znver2 processors. * config/i386/i386-c.c (ix86_target_macros_internal): Add znver2. * config/i386/i386.c (m_znver2): New definition. (m_ZNVER): New definition. (m_AMD_MULTIPLE): Includes m_znver2. (processor_cost_table): Add znver2 entry. (processor_target_table): Add znver2 entry. (get_builtin_code_for_version): Set priority for PROCESSOR_ZNVER2. (processor_model): Add M_AMDFAM17H_ZNVER2. (arch_names_table): Ditto. (ix86_reassociation_width): Include znver2. * config/i386/i386.h (TARGET_znver2): New definition. (struct ix86_size_cost): Add TARGET_ZNVER2. (enum processor_type): Add PROCESSOR_ZNVER2. * config/i386/i386.md (define_attr "cpu"): Add znver2. * config/i386/x86-tune-costs.h: (processor_costs) Add znver2 costs. * config/i386/x86-tune-sched.c: (ix86_issue_rate): Add znver2. (ix86_adjust_cost): Add znver2. * config/i386/x86-tune.def: Replace m_ZNVER1 by m_ZNVER * gcc/doc/extend.texi: Add details about znver2. * gcc/doc/invoke.texi: Add details about znver2. libgcc/ChangeLog * config/i386/cpuinfo.c: (get_amd_cpu): Add znver2. * config/i386/cpuinfo.h(processor_subtypes): Ditto. From-SVN: r265775 --- libgcc/ChangeLog | 5 +++++ libgcc/config/i386/cpuinfo.c | 2 ++ libgcc/config/i386/cpuinfo.h | 1 + 3 files changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 6da80c1..72f24d2 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-04 Venkataramanan Kumar + + * config/i386/cpuinfo.c: (get_amd_cpu): Add znver2. + * config/i386/cpuinfo.h (processor_types): Add znver2. + 2018-11-01 Paul Koning * config/pdp11/t-pdp11 (LIB2ADD): Add divmod.c. diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index a7bb9da..09f4d6f 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -108,6 +108,8 @@ get_amd_cpu (unsigned int family, unsigned int model) /* AMD family 17h version 1. */ if (model <= 0x1f) __cpu_model.__cpu_subtype = AMDFAM17H_ZNVER1; + if (model >= 0x30) + __cpu_model.__cpu_subtype = AMDFAM17H_ZNVER2; break; default: break; diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index 0aa887b..ac9c348 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -75,6 +75,7 @@ enum processor_subtypes INTEL_COREI7_CANNONLAKE, INTEL_COREI7_ICELAKE_CLIENT, INTEL_COREI7_ICELAKE_SERVER, + AMDFAM17H_ZNVER2, CPU_SUBTYPE_MAX }; -- cgit v1.1