From owner-svn-src-all@freebsd.org Sat Feb 22 15:26:53 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 CF68C2412AC for ; Sat, 22 Feb 2020 15:26:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (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 48Pscr4R1Pz49VP for ; Sat, 22 Feb 2020 15:26:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x744.google.com with SMTP id o28so4761418qkj.9 for ; Sat, 22 Feb 2020 07:26:52 -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=qFmoFNCJe4+L41G2o/Qmb87gMjtpkaoApm2sb9Ly0Ec=; b=QN69bFPwxHWuVfoEfDenxjkO50/E0rQjQaZSe1oJ+5HLhvO4B2slGROGRDCEv2kMRu oAGAxHnWnZydMxb1m/QyMCk2wMuMBeyriI/L+jic3B93+jxIMKwzUq2Z99kcUHO25shS viV4SYvwTy08s02XLPa4cC/uZFfIZZhKY1+gBN6/AghLtOc/2K5iGsSGDD/v8uq8dUsw tKmWPqwrpB60ydqqeIRfYQ0gFg4hhX+uaRZCbM1m4oWg85mfqg6ysnjOvCqIvF0OXW40 7AKPJn/SBleqj8JqDo/ZHpQX80FE4ea9Qio+OBKuAiKYT0tgrQGFeuky+Kj4/jjgdHzT Lc+A== 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=qFmoFNCJe4+L41G2o/Qmb87gMjtpkaoApm2sb9Ly0Ec=; b=WdPq8TCE1htvSX4gPyIzLh5NSs3tIklMKyy951M+z/ZmVPc5XUSo7PvBFQ/xUxS2aR 0rNM/I494YWrxUOaNcU0lxvrvbjCeFEpAi6LmBjydWbl6MgtEYtQfCalVwE/xyMoab2a 7RAD24YiFJQw2vMyL/wbY0Mk0bMfeF3k4HOlojTow/Pnq+8prMWZi4UyFxlbMQl2ojqV Rpt2UoHHeIiLQH4Jc2cQc9jf5OyXq+FTgNMBcLLZIqdh9gltBDdcvX1cCFlippZKiPgm wqXmMyeKLDlADP2ue2b9NCPiCm1XZe7qR6kSfq2hmX6Vfq+ACxFJaQIxV+L/7r2a4h61 FTmQ== X-Gm-Message-State: APjAAAWFc4nL0G8XwVwcU27KTl/AUfHLCFzK6DK414yXzHt8DYiT40iF tA+m4b5L3s1Gcpm2Eu45kVK6VZaBgZwMZZBm5EL7bw== X-Google-Smtp-Source: APXvYqxLDs4s315lkkw2s1z7OxDtDFW9JKnfgz55n/Yj+ltOjtCRLXa5j4wH+K3S0bVxAoaOwual1zCoTWUOaOyF/hc= X-Received: by 2002:a37:6785:: with SMTP id b127mr36509066qkc.240.1582385211528; Sat, 22 Feb 2020 07:26:51 -0800 (PST) MIME-Version: 1.0 References: <202002221323.01MDNSX9063377@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sat, 22 Feb 2020 08:26:40 -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 X-Rspamd-Queue-Id: 48Pscr4R1Pz49VP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=QN69bFPw; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::744) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; 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)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.39)[ip: (1.66), 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 15:26:53 -0000 On Sat, Feb 22, 2020 at 7:51 AM Warner Losh wrote: > > > 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. > 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 >> >