From owner-freebsd-toolchain@freebsd.org Tue Aug 11 11:57:07 2020 Return-Path: Delivered-To: freebsd-toolchain@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 033E33ABD07 for ; Tue, 11 Aug 2020 11:57:07 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4BQrst5WQXz4QkH for ; Tue, 11 Aug 2020 11:57:06 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id BB8DB3ABD83; Tue, 11 Aug 2020 11:57:06 +0000 (UTC) Delivered-To: toolchain@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 BB5093ABD82 for ; Tue, 11 Aug 2020 11:57:06 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BQrss1d06z4Qdn; Tue, 11 Aug 2020 11:57:04 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-lj1-f178.google.com with SMTP id v12so13163049ljc.10; Tue, 11 Aug 2020 04:57:04 -0700 (PDT) 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=Lky7bT2yGeBlx3YiEeDYGeoDRYiVndgIaObFf5pCm2s=; b=O8k/ix31WNXux0o2XDYt0wvqJIqKWo+QS44oiU+ZEM6fur4sn98hoHlk34K6KWb9vC Qd11vn+xlQRRM9zTSlmRJFgoMAZ2yNl7Jc5qIOtPFN9yPoGutggKaWP6uej+xP8CxJAK f4xQ9lpPQjzpeQS86sUyAftu3J8XpeYw1Doh/Aupn1IhTs3zcEUWlny4iVnlWyOzmyiV wbpUwVOrIrVVdbt+2YwY0ArNMRW9tiQ4UGan1N+NxxwydI4zKfN78JdLm597mpWnxoud TGHQdCaomXy4Wo2uSaMgNP7ANM2IRSRZsyMuC6L8rOsiiFEfZCnshRXuROdxRgXltn/D Fz6A== X-Gm-Message-State: AOAM532MlIFlUcNL93ccHPyZLqg+PXAY8ylc7DMpMhapl57vl7USnj5P e3kyTGmhZzDVH7Dj6azlXMxrBYuxuN0= X-Google-Smtp-Source: ABdhPJwaOLbceJqRCAwZ6LRyLzlKXWRSae3MDSF8ITCbBeQnaFPQ5m3C71B2x3IlwR+JmjLpql6PHQ== X-Received: by 2002:a2e:87d9:: with SMTP id v25mr2856981ljj.171.1597147022118; Tue, 11 Aug 2020 04:57:02 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id s1sm11688224lfi.76.2020.08.11.04.57.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2020 04:57:01 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id h8so6497363lfp.9; Tue, 11 Aug 2020 04:57:01 -0700 (PDT) X-Received: by 2002:ac2:58c6:: with SMTP id u6mr3065718lfo.105.1597147021425; Tue, 11 Aug 2020 04:57:01 -0700 (PDT) MIME-Version: 1.0 References: <20200807212855.GB2551@kib.kiev.ua> <20200808133000.GC2551@kib.kiev.ua> <20200809143742.430764e7@FreeBSD.org> <20200809154312.GH2551@kib.kiev.ua> In-Reply-To: <20200809154312.GH2551@kib.kiev.ua> From: Gleb Popov Date: Tue, 11 Aug 2020 15:56:35 +0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Undefined reference to __atomic_store_8 To: Konstantin Belousov Cc: =?UTF-8?Q?T=C4=B3l_Coosemans?= , toolchain@freebsd.org X-Rspamd-Queue-Id: 4BQrss1d06z4Qdn X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of 6yearold@gmail.com designates 209.85.208.178 as permitted sender) smtp.mailfrom=6yearold@gmail.com X-Spamd-Result: default: False [-1.47 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-0.80)[-0.803]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.65)[-0.651]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.02)[-0.020]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.178:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[arrowd@freebsd.org,6yearold@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.178:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[arrowd@freebsd.org,6yearold@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2020 11:57:07 -0000 On Sun, Aug 9, 2020 at 7:43 PM Konstantin Belousov wrote: > I do not believe there were any change in the toolchain between p2 and p7, > this is more likely indicates some fluctuation in the build. The only > change that could be even remotely declared as possibly related is > EN-20:10.build r360473. > Right, I was using a wrong set of port's OPTIONS that hide the problem. Indeed you need to look at the .o files that reference _8 symbol. I would > closely look at the compilation command used for them, for start. > After digging it a bit I found that the following command cc -x c /wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/ghc-prim/cbits/atomic.c -o /tmp/ghc_1.s -fno-PIC -Wimplicit -S \ -include /wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/includes/dist-install/build/ghcversion.h -I/usr/local/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/base/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/base/dist-install/build/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/base/dist-install/build/dist-install/build/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/integer-gmp/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/integer-gmp/dist-install/build/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/integer-gmp/dist-install/build/dist-install/build/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/rts/dist/build -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/includes \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/includes/dist-derivedconstants/header \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/includes/dist-install/build \ -march=i686 -U__i686 produce an assembly file with calll __atomic_load_8 instruction. The value of -march flag seems to be ignored. Interestingly, previous version of GHC calls C compiler in the following way: cc -U__i686 '-march=i686' -fno-stack-protector -DTABLES_NEXT_TO_CODE '-march=i686' -x c /wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.1/libraries/ghc-prim/cbits/atomic.c -o /tmp/ghc_1.s -Wimplicit -S \ -include /wrkdirs/usr/ports/lang/ghc/work/ghc-8.6.5-boot/lib/ghc-8.6.5/include/ghcversion.h \ -I/usr/local/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.6.5-boot/lib/ghc-8.6.5/base-4.12.0.0/include \ -I/wrkdirs/usr/ports/lang/ghc/work/ghc-8.6.5-boot/lib/ghc-8.6.5/include And this command produces an assembly without calls to __atomic_load_8 Any ideas what makes it appear?