* [PATCH] frv: fix build failure [not found] <1511302233-5008-1-git-send-email-sudipm.mukherjee@gmail.com> @ 2017-11-23 17:17 ` Alexey Brodkin 2017-11-23 23:01 ` Sudip Mukherjee 2017-11-27 18:25 ` Vineet Gupta 0 siblings, 2 replies; 6+ messages in thread From: Alexey Brodkin @ 2017-11-23 17:17 UTC (permalink / raw) To: linux-snps-arc Hi Sudip, On Tue, 2017-11-21@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 at gmail.com> > --- I'm seeing the same issue building for ARC from today's Linus' tree. 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. -Alexey ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] frv: fix build failure 2017-11-23 17:17 ` [PATCH] frv: fix build failure Alexey Brodkin @ 2017-11-23 23:01 ` Sudip Mukherjee 2017-11-24 5:02 ` Alexey Brodkin 2017-11-27 18:25 ` Vineet Gupta 1 sibling, 1 reply; 6+ messages in thread From: Sudip Mukherjee @ 2017-11-23 23:01 UTC (permalink / raw) To: linux-snps-arc Hi Alexey, On Thu, Nov 23, 2017@05:17:19PM +0000, Alexey Brodkin wrote: > Hi Sudip, > > On Tue, 2017-11-21@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 at gmail.com> > > --- > > I'm seeing the same issue building for ARC from today's Linus' tree. > 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. Do you mean define it for every arch or define it in a common place so that all arch can use it? I did a quick try with the attached patch on two different arch, one of them (m32r) has the 'abort' defined and the other (frv) was failing due to lack of abort, and they both built without any warnings or errors. But I am not sure if 'kernel/exit.c' is the right place for it. Any suggestion? -- Regards Sudip -------------- next part -------------- A non-text attachment was scrubbed... Name: patch Type: text/x-diff Size: 242 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20171123/53be03c2/attachment.bin> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] frv: fix build failure 2017-11-23 23:01 ` Sudip Mukherjee @ 2017-11-24 5:02 ` Alexey Brodkin 0 siblings, 0 replies; 6+ messages in thread From: Alexey Brodkin @ 2017-11-24 5:02 UTC (permalink / raw) To: linux-snps-arc Hi Sudip, On Thu, 2017-11-23@23:01 +0000, Sudip Mukherjee wrote: > Hi Alexey, > > On Thu, Nov 23, 2017@05:17:19PM +0000, Alexey Brodkin wrote: > > > > Hi Sudip, > > > > On Tue, 2017-11-21@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 at gmail.com> > > > --- > > > > I'm seeing the same issue building for ARC from today's Linus' tree. > > 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. > > Do you mean define it for every arch or define it in a common place so > that all arch can use it? Essentially I'd prefer to have just 1 instance of this function. In fact I'd even remove existing implementations in ARM, Unicore32 and M32R and have a generic implementation as this function obviously has nothing arch-specific. > I did a quick try with the attached patch on two different arch, one of > them (m32r) has the 'abort' defined and the other (frv) was failing due > to lack of abort, and they both built without any warnings or errors. Well maybe add ?call to panic() there as well as it is done for ARM, unicore32?and M32R? > But I am not sure if 'kernel/exit.c' is the right place for it. > Any suggestion? I guess it should be indeed something in "kernel/" and maybe your existing choice of "kernel/exit.c" is not bad. Just send a patch to LKML and you'll get much better guidance on that I guess :) Anyways thanks for looking at this one. -Alexey ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] frv: fix build failure 2017-11-23 17:17 ` [PATCH] frv: fix build failure Alexey Brodkin 2017-11-23 23:01 ` Sudip Mukherjee @ 2017-11-27 18:25 ` Vineet Gupta 2017-12-03 22:32 ` Sudip Mukherjee 1 sibling, 1 reply; 6+ messages in thread From: Vineet Gupta @ 2017-11-27 18:25 UTC (permalink / raw) To: linux-snps-arc +CC linux-arch, Arnd On 11/23/2017 09:17 AM, Alexey Brodkin wrote: > Hi Sudip, > > On Tue, 2017-11-21@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 at 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] 6+ messages in thread
* [PATCH] frv: fix build failure 2017-11-27 18:25 ` Vineet Gupta @ 2017-12-03 22:32 ` Sudip Mukherjee 2017-12-06 22:00 ` Vineet Gupta 0 siblings, 1 reply; 6+ messages in thread From: Sudip Mukherjee @ 2017-12-03 22:32 UTC (permalink / raw) To: linux-snps-arc On Mon, Nov 27, 2017@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@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] 6+ messages in thread
* [PATCH] frv: fix build failure 2017-12-03 22:32 ` Sudip Mukherjee @ 2017-12-06 22:00 ` Vineet Gupta 0 siblings, 0 replies; 6+ messages in thread From: Vineet Gupta @ 2017-12-06 22:00 UTC (permalink / raw) To: linux-snps-arc On 12/03/2017 02:32 PM, Sudip Mukherjee wrote: > On Mon, Nov 27, 2017@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@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] 6+ messages in thread
end of thread, other threads:[~2017-12-06 22:00 UTC | newest]
Thread overview: 6+ 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>
2017-11-23 17:17 ` [PATCH] frv: fix build failure Alexey Brodkin
2017-11-23 23:01 ` Sudip Mukherjee
2017-11-24 5:02 ` Alexey Brodkin
2017-11-27 18:25 ` Vineet Gupta
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).