Re: [PATCH] or1k: Do not clear existing FPU exceptions before updating

2023-03-18 Thread Stafford Horne via Gcc-patches
Hello, I pushed this upstream. On Sat, Mar 18, 2023 at 05:04:05PM +0900, Stafford Horne wrote: > We should always carry the exceptions forward. This bug was found when > working on testing glibc math tests, many tests were failing with > Overflow and Underflow flags not set. This was traced to

[PATCH] or1k: Do not clear existing FPU exceptions before updating

2023-03-18 Thread Stafford Horne via Gcc-patches
We should always carry the exceptions forward. This bug was found when working on testing glibc math tests, many tests were failing with Overflow and Underflow flags not set. This was traced to here. libgcc/ChangeLog: * config/or1k/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Remove st

Re: [PATCH] or1k: Only define TARGET_HAVE_TLS when HAVE_AS_TLS

2022-10-01 Thread Stafford Horne via Gcc-patches
On Thu, Sep 29, 2022 at 03:57:40PM +0100, Stafford Horne wrote: > This was found when testing buildroot with linuxthreads enabled. In > this case, the build passes --disable-tls to the toolchain during > configuration. After building the OpenRISC toolchain it was still > generating TLS code seque

[PATCH] or1k: Only define TARGET_HAVE_TLS when HAVE_AS_TLS

2022-09-29 Thread Stafford Horne via Gcc-patches
This was found when testing buildroot with linuxthreads enabled. In this case, the build passes --disable-tls to the toolchain during configuration. After building the OpenRISC toolchain it was still generating TLS code sequences and causing linker failures such as: /or1k-buildroot-linux-uc

Re: [PATCH] or1k: Add support for a little-endian target variant

2022-06-09 Thread Stafford Horne via Gcc-patches
> diff --git a/gcc/config.gcc b/gcc/config.gcc > index c5064dd37666..0c3a09dfe810 100644 > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -2866,6 +2866,11 @@ or1k*-*-*) > done > TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` > > + case ${target} in > + or1k*le*

[PATCH] gcc: define _REENTRANT for OpenRISC when -pthread is passed

2022-01-31 Thread Stafford Horne via Gcc-patches
From: Bernd Kuhls The detection of pthread support fails on OpenRISC unless _REENTRANT is defined. Added the CPP_SPEC definition to correct this. gcc/ChangeLog: PR target/94372 * config/or1k/linux.h (CPP_SPEC): Define. Signed-off-by: Bernd Kuhls --- This was brought up on the

Re: [RFC PATCH] or1k: Fix clobbering of _mcount argument if fPIC is enabled

2021-11-12 Thread Stafford Horne via Gcc-patches
I have committed this as is. -Stafford On Tue, Nov 09, 2021 at 09:13:08PM +0900, Stafford Horne wrote: > Recently we changed the PROFILE_HOOK _mcount call to pass in the link > register as an argument. This actually does not work when the _mcount > call uses a PLT because the GOT register setup

[RFC PATCH] or1k: Fix clobbering of _mcount argument if fPIC is enabled

2021-11-09 Thread Stafford Horne via Gcc-patches
Recently we changed the PROFILE_HOOK _mcount call to pass in the link register as an argument. This actually does not work when the _mcount call uses a PLT because the GOT register setup code ends up getting inserted before the PROFILE_HOOK and clobbers the link register argument. These glibc tes

[PATCH] or1k: Add return address argument to _mcount call

2021-10-27 Thread Stafford Horne via Gcc-patches
This fixes an issue in the glibc port I am working on where the build fails due to the warning: error: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Werror=frame-address] This is due to how the current implementation of _mcount in glibc uses __builtin_return_address wi

[PATCH] or1k: Update FPU to specify detect tininess before rounding

2021-10-21 Thread Stafford Horne via Gcc-patches
This was not defined in the spec and not consistent in the implementation causing incosistent behavior. After review we have updated the CPU implementations and proposed the spec be updated to specific that FPU tininess checks check for tininess before roudning. Architecture change draft:

Re: [PATCH v2 0/2] OpenRISC support for cmodel=large

2021-08-14 Thread Stafford Horne via Gcc-patches
On Sun, Aug 15, 2021 at 12:05:37AM +0200, Giulio Benetti wrote: > On 8/15/21 12:03 AM, Stafford Horne wrote: > > On Sat, Aug 14, 2021 at 11:01:16PM +0200, Giulio Benetti wrote: > > > Hi All, > > > > > > On 5/1/21 11:11 PM, Stafford Horne wrote: > > > > Changes from v1: > > > >- Added patch to

Re: [PATCH v2 0/2] OpenRISC support for cmodel=large

2021-08-14 Thread Stafford Horne via Gcc-patches
On Sat, Aug 14, 2021 at 11:01:16PM +0200, Giulio Benetti wrote: > Hi All, > > On 5/1/21 11:11 PM, Stafford Horne wrote: > > Changes from v1: > > - Added patch to enabled cmodle=large on crtstuff > > > > This series fixes some bugs found when linking large binaries, both in > > buildroot > > an

Re: [PATCH v2 0/2] OpenRISC support for cmodel=large

2021-05-04 Thread Stafford Horne via Gcc-patches
On Mon, May 03, 2021 at 12:34:22PM +0200, Giulio Benetti wrote: > Hi Stafford, All, > > I've backported this patchset for Buildroot to versions: > - 9.3.0 > - 10.3.0 > > Does it make sense to send them? I don't know if those version will have > minor versions where these backported patches can be

[PATCH v2 2/2] or1k: Use cmodel=large when building crtstuff

2021-05-01 Thread Stafford Horne via Gcc-patches
When linking gcc runtime objects into large binaries the link may fail with the below errors. This will happen even if we are building with -mcmodel=large. /home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `deregister_tm_clones':

[PATCH v2 1/2] or1k: Add mcmodel option to handle large GOTs

2021-05-01 Thread Stafford Horne via Gcc-patches
When building libgeos we get an error with: linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux': crtstuff.c:(.text+0x118): relocation truncated to fit: R_OR1K_GOT16 against symbol `__cxa_finalize' defined in .text section in /home/shorne/work/openrisc/3eb9f9d0f6d8274b

[PATCH v2 0/2] OpenRISC support for cmodel=large

2021-05-01 Thread Stafford Horne via Gcc-patches
Changes from v1: - Added patch to enabled cmodle=large on crtstuff This series fixes some bugs found when linking large binaries, both in buildroot and glibc testing. Stafford Horne (2): or1k: Add mcmodel option to handle large GOTs or1k: Use cmodel=large when building crtstuff gcc/config/

Re: [PATCH] or1k: Add mcmodel option to handle large GOTs

2021-04-20 Thread Stafford Horne via Gcc-patches
On Tue, Apr 20, 2021 at 05:20:39PM -0600, Jeff Law wrote: > > On 4/18/2021 6:10 PM, Stafford Horne via Gcc-patches wrote: > > When building libgeos we get an error with: > > > > linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux': >

[PATCH] or1k: Add mcmodel option to handle large GOTs

2021-04-18 Thread Stafford Horne via Gcc-patches
When building libgeos we get an error with: linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux': crtstuff.c:(.text+0x118): relocation truncated to fit: R_OR1K_GOT16 against symbol `__cxa_finalize' defined in .text section in /home/shorne/work/openrisc/3eb9f9d0f6d8274b

[PATCH v2 5/5] or1k: Fixup exception header data encodings

2021-01-13 Thread Stafford Horne via Gcc-patches
While running glibc tests several *-textrel tests failed showing that relocations remained against read only sections. It turned out this was related to exception headers data encoding being wrong. By default pointer encoding will always use the DW_EH_PE_absptr format. This patch uses format DW_

[PATCH v2 4/5] or1k: Add note to indicate execstack

2021-01-13 Thread Stafford Horne via Gcc-patches
Define TARGET_ASM_FILE_END as file_end_indicate_exec_stack to allow generation of the ".note.GNU-stack" section note. This allows binutils to properly set PT_GNU_STACK in the program header. This fixes a glibc execstack testsuite test failure found while working on the OpenRISC glibc port. gcc/C

[PATCH v2 3/5] or1k: Support for softfloat to emulate hw exceptions

2021-01-13 Thread Stafford Horne via Gcc-patches
This allows the openrisc softfloat implementation to set exceptions. This also sets the correct tininess after rounding value to be consistent with hardware and simulator implementations. libgcc/ChangeLog: * config/or1k/sfp-machine.h (FP_RND_NEAREST, FP_RND_ZERO, FP_RND_PINF, FP_R

[PATCH v2 2/5] or1k: Add builtin define to detect hard float

2021-01-13 Thread Stafford Horne via Gcc-patches
This is used in libgcc and now glibc to detect when hardware floating point operations are supported by the target. gcc/ChangeLog: * config/or1k/or1k.h (TARGET_CPU_CPP_BUILTINS): Add builtin define for __or1k_hard_float__. --- gcc/config/or1k/or1k.h | 2 ++ 1 file changed, 2 in

[PATCH v2 1/5] or1k: Implement profile hook calling _mcount

2021-01-13 Thread Stafford Horne via Gcc-patches
Defining this to not abort as found when working on running tests in the glibc test suite. We implement this with a call to _mcount with no arguments. The required return address's will be pulled from the stack. Passing the LR (r9) as an argument had problems as sometimes r9 is clobbered by the

[RESEND PATCH 0/5] OpenRISC GCC Fixes for Glibc Support

2021-01-13 Thread Stafford Horne via Gcc-patches
Hello, Changes since v1: - Rebase This just a resend of v1 with no changes from when I sent it last year. I hadn't committed it because I had not completed all testing in glibc. Now that I have done that and it all seems to work I will commit it. I am currently working on the glibc port for O

Re: [PATCH 4/6] contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk

2020-05-31 Thread Stafford Horne via Gcc-patches
On Sun, May 31, 2020 at 12:19:16PM +0200, Iain Buclaw wrote: > Support for OpenRISC target was added in SVN r265963. > > The target configurations were taken from the list of supported > toolchains[1], so seems sensible to include them all. > > OK? > > Regards > Iain > > [1]: https://www.openri

[PATCH 3/5] or1k: Support for softfloat to emulate hw exceptions

2020-05-19 Thread Stafford Horne via Gcc-patches
This allows the openrisc softfloat implementation to set exceptions. This also sets the correct tininess after rounding value to be consistent with hardware and simulator implementations. libgcc/ChangeLog: * config/or1k/sfp-machine.h (FP_RND_NEAREST, FP_RND_ZERO, FP_RND_PINF, FP_R

[PATCH 1/5] or1k: Implement profile hook calling _mcount

2020-05-19 Thread Stafford Horne via Gcc-patches
Defining this to not abort as found when working on running tests in the glibc test suite. We implement this with a call to _mcount with no arguments. The required return address's will be pulled from the stack. Passing the LR (r9) as an argument had problems as sometimes r9 is clobbered by the

[PATCH 5/5] or1k: Fixup exception header data encodings

2020-05-19 Thread Stafford Horne via Gcc-patches
While running glibc tests several *-textrel tests failed showing that relocations remained against read only sections. It turned out this was related to exception headers data encoding being wrong. By default pointer encoding will always use the DW_EH_PE_absptr format. This patch uses format DW_

[PATCH 2/5] or1k: Add builtin define to detect hard float

2020-05-19 Thread Stafford Horne via Gcc-patches
This is used in libgcc and now glibc to detect when hardware floating point operations are supported by the target. gcc/ChangeLog: * config/or1k/or1k.h (TARGET_CPU_CPP_BUILTINS): Add builtin define for __or1k_hard_float__. --- gcc/config/or1k/or1k.h | 2 ++ 1 file changed, 2 in

[PATCH 0/5] OpenRISC GCC Fixes for Glibc Support

2020-05-19 Thread Stafford Horne via Gcc-patches
Hello, I am currently working on the glibc port for OpenRISC. This is a series of patches that fix issues and add features that were missing in GCC causing glibc testsuite failures. Pretty much all of these changes are just adding macros. These changes have been tested via the glibc test suite.

[PATCH 4/5] or1k: Add note to indicate execstack

2020-05-19 Thread Stafford Horne via Gcc-patches
Define TARGET_ASM_FILE_END as file_end_indicate_exec_stack to allow generation of the ".note.GNU-stack" section note. This allows binutils to properly set PT_GNU_STACK in the program header. This fixes a glibc execstack testsuite test failure found while working on the OpenRISC glibc port. gcc/C