From owner-svn-src-all@freebsd.org Sat Feb 22 14:51:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27A8924009D for ; Sat, 22 Feb 2020 14:51:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Prqv1J2Xz46pj for ; Sat, 22 Feb 2020 14:51:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf36.google.com with SMTP id q9so2293562qvu.7 for ; Sat, 22 Feb 2020 06:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OlEJyDIQmnGGTbAMLyus5teHHnY0GMfDcFyUEMrNi7A=; b=c7oWNaJYhgPXOHQdMqw5eksOPRDuZPcDQgllxI3Y8BqNy68JVfOBcqtmEj1v/hsqQZ PDBjxxUYv7p6gUq8QuAwr9bdm/Oi4Sg8PlTEuXoGZQy9M3LcWLqjGvfAMn3Or7ru26IM ZSmiKnizwhYt0kfD4Ox4wQtNHzOhDP10COJG3mVmqWv88OcBwucGhLAhNpvIBhyjjJ2N YkV8KmuV+Izrei/WGwuLwGPinkFOTsgYGOmygo3Z0y5ktcDWdJIj1Yt//2N38GftB2Gw RjSWVWf2uVXdd1AM06zSRCukAYhOIJjePuk5BVjblwylqim0iGhGxI/+nJs1ifoeHm3a 50Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OlEJyDIQmnGGTbAMLyus5teHHnY0GMfDcFyUEMrNi7A=; b=RGEQafbeycvNqV020ThaDdi10w4YZ9JGu2r0vPOGLI6i/X9MELb+yTiYiOkb7cAa2d yXS6YmHC/sTtYIBUyPz3mrRpfstlS7WBKXhGmKaVXgR2n7Oy9tYh8AGFTE2aZvveLb2W LiKNbq3YQprIAaLoE1bVyFdzs0NTiwcxyHYnaNUyPdWzdWV+RYt6//VCQ8d1usroqTvd PJJ+rxh9pwyiY1cO2PrYeL+2xWjDouXNphvDdjgnPhzUx4duN9ow6YQooWMKmQVEIple QXIJe6AMuyoDbUso+okymFFnA92HBLch/aT0ZnlGPaTUz5bF5c5FrWjon72uLO6oH7BF AsGQ== X-Gm-Message-State: APjAAAW8Xko4Dn4P8v322QQMXUQICdb5MqxU6X1xbab7/bWaqPEmmC2+ NahoSZ4PV2ysm9cDGaIgvZfUe5sdRz6K2wLCKgv0fA== X-Google-Smtp-Source: APXvYqwIcm7OaAuGKKtBXy50WExS6v0S6ft/WRpHV+pUA8btcwzuKAj2MD2PjplqxjJme0+xq4MUHBsBnBjPE5l5+GA= X-Received: by 2002:a05:6214:1433:: with SMTP id o19mr36250986qvx.87.1582383080952; Sat, 22 Feb 2020 06:51:20 -0800 (PST) MIME-Version: 1.0 References: <202002221323.01MDNSX9063377@repo.freebsd.org> In-Reply-To: <202002221323.01MDNSX9063377@repo.freebsd.org> From: Warner Losh Date: Sat, 22 Feb 2020 07:51:09 -0700 Message-ID: Subject: Re: svn commit: r358247 - in head/sys: conf riscv/include To: Kristof Provost Cc: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 48Prqv1J2Xz46pj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=c7oWNaJY; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f36) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.76 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-1.76)[ip: (-5.21), ipnet: 2607:f8b0::/32(-1.88), asn: 15169(-1.67), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2020 14:51:24 -0000 On Sat, Feb 22, 2020, 6:23 AM Kristof Provost 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. 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 >