Date: Sat, 22 Feb 2020 08:26:40 -0700 From: Warner Losh <imp@bsdimp.com> To: Kristof Provost <kp@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r358247 - in head/sys: conf riscv/include Message-ID: <CANCZdfoJ-e9DGxOTH4PBjR77t0x6VZ_DSns4nBV3aLrP%2BEftgQ@mail.gmail.com> In-Reply-To: <CANCZdfos40g8FbwUx80ZWhj=EWP6kwf_Nws18bGgvKRN4uqkmg@mail.gmail.com> References: <202002221323.01MDNSX9063377@repo.freebsd.org> <CANCZdfos40g8FbwUx80ZWhj=EWP6kwf_Nws18bGgvKRN4uqkmg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 22, 2020 at 7:51 AM Warner Losh <imp@bsdimp.com> wrote: > > > On Sat, Feb 22, 2020, 6:23 AM Kristof Provost <kp@freebsd.org> wrote: > >> Author: kp >> Date: Sat Feb 22 13:23:27 2020 >> New Revision: 358247 >> URL: https://svnweb.freebsd.org/changeset/base/358247 >> >> Log: >> riscv: Set MACHINE_ARCH correctly >> >> MACHINE_ARCH sets the hw.machine_arch sysctl in the kernel. In userspace >> it sets MACHINE_ARCH in bmake, which bsd.cpu.mk uses to configure the >> target ABI for ports. >> >> For riscv64sf builds (i.e. soft-float) that needs to be riscv64sf, but >> the sysctl didn't reflect that. It is static. >> >> Set the define from the riscv makefile so that we correctly reflect our >> actual build (i.e. riscv64 or riscv64sf), depending on what TARGET_ARCH >> we were built with. >> >> That still doesn't satisfy userspace builds (e.g. bmake), so check if >> we're building with a software-floating point toolchain there. That >> check doesn't work in the kernel, because it never uses floating point. >> >> Reviewed by: philip (previous version), mhorne >> Sponsored by: Axiado >> Differential Revision: https://reviews.freebsd.org/D23741 >> >> Modified: >> head/sys/conf/Makefile.riscv >> head/sys/riscv/include/param.h >> >> Modified: head/sys/conf/Makefile.riscv >> >> ============================================================================== >> --- head/sys/conf/Makefile.riscv Sat Feb 22 12:10:41 2020 >> (r358246) >> +++ head/sys/conf/Makefile.riscv Sat Feb 22 13:23:27 2020 >> (r358247) >> @@ -46,6 +46,8 @@ SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T $ >> CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls >> .endif >> >> +CFLAGS += -DMACHINE_ARCH=\"${TARGET_ARCH}\" >> > > This is bogus. It should be removed. TARGET_ARCH may not be defined here > and Makefile.inc1 should already set it for cross builds. Please remove it. > Err, I mean use MACHINE_ARCH. I suspect the real right answer here is to get the arch right so that the test you use in param.h is right. But if not, then you gotta use MACHINE_ARCH here. Warner > > Warnet > > > + >> # hack because genassym.c includes sys/bus.h which includes these. >> genassym.o: bus_if.h device_if.h >> >> >> Modified: head/sys/riscv/include/param.h >> >> ============================================================================== >> --- head/sys/riscv/include/param.h Sat Feb 22 12:10:41 2020 >> (r358246) >> +++ head/sys/riscv/include/param.h Sat Feb 22 13:23:27 2020 >> (r358247) >> @@ -46,7 +46,11 @@ >> #define MACHINE "riscv" >> #endif >> #ifndef MACHINE_ARCH >> +#ifdef __riscv_float_abi_soft >> +#define MACHINE_ARCH "riscv64sf" >> +#else >> #define MACHINE_ARCH "riscv64" >> +#endif >> #endif >> >> #ifdef SMP >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoJ-e9DGxOTH4PBjR77t0x6VZ_DSns4nBV3aLrP%2BEftgQ>