From owner-freebsd-stable@freebsd.org Thu Jul 25 07:40:08 2019 Return-Path: Delivered-To: freebsd-stable@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 93E8EC5011 for ; Thu, 25 Jul 2019 07:40:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 553736DCBE; Thu, 25 Jul 2019 07:40:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C4CFC260082; Thu, 25 Jul 2019 09:40:04 +0200 (CEST) Subject: Re: Rel. 11.3: Kernel doesn't compile anymore (SVN-334762, please fix!) To: Peter , freebsd-stable@freebsd.org, Ed Maste References: <20190724230054.GA81816@gate.oper.dinoex.org> From: Hans Petter Selasky Message-ID: <2a95277f-0646-aeb1-ddf5-9f08bb35161f@selasky.org> Date: Thu, 25 Jul 2019 09:39:26 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190724230054.GA81816@gate.oper.dinoex.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 553736DCBE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2019 07:40:08 -0000 On 2019-07-25 01:00, Peter wrote: >> Trying to compile my custom kernel in Rel. 11.3 results in this: >> >> -- kernel.full --- >> linking kernel.full >> atomic.o: In function `atomic_add_64': >> /usr/obj/usr/src/sys/E1R11V1/./machine/atomic.h:629: multiple definition of `atomic_add_64' >> opensolaris_atomic.o:/usr/src/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S:71: first defined here >> *** [kernel.full] Error code 1 >> >> Same config worked with 11.2 >> >> The offending feature is either >> options ZFS >> or >> device dtrace >> (Adding any of these to the GENERIC config gives the same error.) >> >> This happens only when building for i386. Building amd64 with these >> options works. > > > Trying to analyze the issue: > > > The problem appears with SVN 334762 in 11.3: > > This change adds two new functions to sys/i386/include/atomic.h: > atomic_add_64() > atomic_subtract_64() > [I don't really understand why this goes into a headerfile, but, well, > nevermind] > > Also, this change deactivates two functions (only in case *i386*) from > sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c > atomic_add_64() > atomic_del_64() > [Now, there seems to be a slight strangeness here: if we *deactivate* > atomic_del_64(), and *insert* atomic_subtract_64(), then these two > names are not the same, and I might suppose that the atomic_del_64() > is then somehow missing. But, well, nevermind] > > Now, the strange thing: > this file sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c > from which now two functions get excluded *only in case i386*, is not > even compiled for i386: > >> /usr/src/sys/conf$ grep opensolaris_atomic.c * >> files.arm:cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-with "${CDDL_C}" >> files.mips:cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-with "${CDDL_C}" >> files.powerpc:cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc | dtrace powerpc compile-with "${ZFS_C}" >> files.riscv:cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-with "${CDDL_C}" > > [So maybe that's the reason why the now lack of atomic_del_64() is not > complained? Or maybe it's not used, or maybe I didn't find some > definition whereever. Well, nevermind] > > > Anyway, the actual name clash happens between > sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S, > because that one *is* compiled: > >> /usr/src/sys/conf$ grep i386/opensolaris_atomic.S * >> files.i386:cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}" > > > I tried to move out the changes from SVN 334762. Sadly, that didn't > work, because something does already use these atomic_add_64() stuff, > > So instead, I did this one: > > --- sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S (revision 350287) > +++ sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S (working copy) > @@ -66,8 +66,7 @@ > * specific mapfile and remove the NODYNSORT attribute > * from atomic_add_64_nv. > */ > - ENTRY(atomic_add_64) > - ALTENTRY(atomic_add_64_nv) > + ENTRY(atomic_add_64_nv) > pushl %edi > pushl %ebx > movl 12(%esp), %edi // %edi = target address > @@ -87,7 +86,6 @@ > popl %edi > ret > SET_SIZE(atomic_add_64_nv) > - SET_SIZE(atomic_add_64) > > ENTRY(atomic_or_8_nv) > movl 4(%esp), %edx // %edx = target address > > > And at least it compiles now. If it actually runs, that remains to be > found out. Can you attach your kernel configuration file? --HPS