* Re: [PATCH] frv: fix build failure
[not found] ` <1511457437.32422.6.camel@synopsys.com>
@ 2017-11-27 18:25 ` Vineet Gupta
2017-12-03 22:32 ` Sudip Mukherjee
0 siblings, 1 reply; 4+ messages in thread
From: Vineet Gupta @ 2017-11-27 18:25 UTC (permalink / raw)
To: Alexey Brodkin, sudipm.mukherjee@gmail.com
Cc: linux-kernel@vger.kernel.org, Vineet Gupta,
akpm@linux-foundation.org, linux-snps-arc@lists.infradead.org,
linux-arch@vger.kernel.org, Arnd Bergmann
+CC linux-arch, Arnd
On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> Hi Sudip,
>
> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
>> The frv defconfig build is failing with the error:
>> lib/mpi/mpih-div.o: In function `mpihelp_divrem':
>> mpih-div.c:(.text+0x30c): undefined reference to `abort'
>>
>> The function 'abort' was never defined for the frv architecture.
>> Create 'abort' as is done in other arch like 'arm' and 'unicore32'.
>>
>> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
>> ---
>
> I'm seeing the same issue building for ARC from today's Linus' tree.
With which compiler ? Claudiu implemented __builtin_trap recently so ARC builds
should not get abort() but a trap 5 instruction instead.
> Maybe it worth implementing abort() as a weak function for every arch/platform
> that doesn't have it explicitly defined? Otherwise we'll end-up with
> useless code duplication.
I understand the case/need for adding a weak/common abort() as a quick fix for
handling such cases, but perhaps we should not and instead fix the rootcause. In
this specific case, Claudiu mentioned that gcc was generating abort due to
something like this (flagging a possible divide by zero due to
-fno-isolate-erroneous-paths-dereference.
a;
fn1() {
switch (a)
case 0:
return 1 / a;
}
Sudeep can you confirm that removing this hacking FRV build to not have this
toggle fixes the abort issue.
So the offending code needs to be fixed as in the end when that code path is taken
system is hosed.
-Vineet
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] frv: fix build failure
2017-11-27 18:25 ` [PATCH] frv: fix build failure Vineet Gupta
@ 2017-12-03 22:32 ` Sudip Mukherjee
2017-12-03 22:32 ` Sudip Mukherjee
2017-12-06 22:00 ` Vineet Gupta
0 siblings, 2 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
To: Geert Uytterhoeven, Vineet Gupta
Cc: Alexey Brodkin, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, linux-snps-arc@lists.infradead.org,
linux-arch@vger.kernel.org, Arnd Bergmann
On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
>
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
<snip>
> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
>
> a;
>
> fn1() {
> switch (a)
> case 0:
> return 1 / a;
> }
>
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
>
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.
The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
So, what should be the actual fix here?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] frv: fix build failure
2017-12-03 22:32 ` Sudip Mukherjee
@ 2017-12-03 22:32 ` Sudip Mukherjee
2017-12-06 22:00 ` Vineet Gupta
1 sibling, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw)
To: Geert Uytterhoeven, Vineet Gupta
Cc: Alexey Brodkin, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, linux-snps-arc@lists.infradead.org,
linux-arch@vger.kernel.org, Arnd Bergmann
On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
> +CC linux-arch, Arnd
>
> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
> >Hi Sudip,
> >
> >On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
<snip>
> I understand the case/need for adding a weak/common abort() as a
> quick fix for handling such cases, but perhaps we should not and
> instead fix the rootcause. In this specific case, Claudiu mentioned
> that gcc was generating abort due to something like this (flagging a
> possible divide by zero due to
> -fno-isolate-erroneous-paths-dereference.
>
> a;
>
> fn1() {
> switch (a)
> case 0:
> return 1 / a;
> }
>
> Sudeep can you confirm that removing this hacking FRV build to not
> have this toggle fixes the abort issue.
>
> So the offending code needs to be fixed as in the end when that code
> path is taken system is hosed.
The above case that you mentioned is indeed the case here.
mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
So, what should be the actual fix here?
--
Regards
Sudip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] frv: fix build failure
2017-12-03 22:32 ` Sudip Mukherjee
2017-12-03 22:32 ` Sudip Mukherjee
@ 2017-12-06 22:00 ` Vineet Gupta
1 sibling, 0 replies; 4+ messages in thread
From: Vineet Gupta @ 2017-12-06 22:00 UTC (permalink / raw)
To: Sudip Mukherjee, Geert Uytterhoeven, Vineet Gupta
Cc: Alexey Brodkin, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, linux-snps-arc@lists.infradead.org,
linux-arch@vger.kernel.org, Arnd Bergmann
On 12/03/2017 02:32 PM, Sudip Mukherjee wrote:
> On Mon, Nov 27, 2017 at 10:25:16AM -0800, Vineet Gupta wrote:
>> +CC linux-arch, Arnd
>>
>> On 11/23/2017 09:17 AM, Alexey Brodkin wrote:
>>> Hi Sudip,
>>>
>>> On Tue, 2017-11-21 at 22:10 +0000, Sudip Mukherjee wrote:
>
> <snip>
>
>> I understand the case/need for adding a weak/common abort() as a
>> quick fix for handling such cases, but perhaps we should not and
>> instead fix the rootcause. In this specific case, Claudiu mentioned
>> that gcc was generating abort due to something like this (flagging a
>> possible divide by zero due to
>> -fno-isolate-erroneous-paths-dereference.
>>
>> a;
>>
>> fn1() {
>> switch (a)
>> case 0:
>> return 1 / a;
>> }
>>
>> Sudeep can you confirm that removing this hacking FRV build to not
>> have this toggle fixes the abort issue.
>>
>> So the offending code needs to be fixed as in the end when that code
>> path is taken system is hosed.
>
> The above case that you mentioned is indeed the case here.
> mpihelp_divrem() in lib/mpi/mpih-div.c has this same divide by zero case.
>
> So, what should be the actual fix here?
To remove the divide by zero.
Or atleast have a __weak abort() defined in common code so all arches benefit from
it !
-Vineet
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-06 22:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1511302233-5008-1-git-send-email-sudipm.mukherjee@gmail.com>
[not found] ` <1511457437.32422.6.camel@synopsys.com>
2017-11-27 18:25 ` [PATCH] frv: fix build failure Vineet Gupta
2017-12-03 22:32 ` Sudip Mukherjee
2017-12-03 22:32 ` Sudip Mukherjee
2017-12-06 22:00 ` Vineet Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).