Hans Petter Selasky
2019-Jul-25 07:39 UTC
Rel. 11.3: Kernel doesn't compile anymore (SVN-334762, please fix!)
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
Peter
2019-Jul-25 11:13 UTC
Rel. 11.3: Kernel doesn't compile anymore (SVN-334762, please fix!)
Hi Hans Petter, glad to read You! :) On Thu, Jul 25, 2019 at 09:39:26AM +0200, Hans Petter Selasky wrote: ! On 2019-07-25 01:00, Peter wrote: ! >> The offending feature is either ! >> options ZFS ! >> or ! >> device dtrace ! >> (Adding any of these to the GENERIC config gives the same error.) ! Can you attach your kernel configuration file? Yes, but to what point? I can reproduce this with the GENERIC configuration by adding "options ZFS" (My custom KERNCONF relates to my local patches, and is rather pointless without these. So at first I tried to reproduce without my local patches and with minimal changes from GENERIC config. And the minimal change is to add "options ZFS" into the GENERIC conf.) See here: root at disp:/usr/src/sys/i386/compile/GENERIC # make linking kernel.full atomic.o: In function `atomic_add_64': /usr/src/sys/i386/compile/GENERIC/./machine/atomic.h:629: multiple definition of `atomic_add_64' opensolaris_atomic.o:/usr/src/sys/i386/compile/GENERIC/../../../cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S:71: first defined here *** Error code 1 Stop. make: stopped in /usr/src/sys/i386/compile/GENERIC root at disp:/usr/src/sys/i386/compile/GENERIC # root at disp:/usr/src/sys/i386/compile/GENERIC # cd ../../../.. root at disp:/usr/src # svn stat M sys/i386/conf/GENERIC root at disp:/usr/src # svn diff Index: sys/i386/conf/GENERIC ==================================================================--- sys/i386/conf/GENERIC (revision 350287) +++ sys/i386/conf/GENERIC (working copy) @@ -1,3 +1,4 @@ +options ZFS # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # root at disp:/usr/src # svn info Path: . Working Copy Root Path: /usr/src URL: https://svn0.us-east.freebsd.org/base/releng/11.3 Relative URL: ^/releng/11.3 Repository Root: https://svn0.us-east.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 350287 Node Kind: directory Schedule: normal Last Changed Author: gordon Last Changed Rev: 350287 Last Changed Date: 2019-07-24 12:58:21 +0000 (Wed, 24 Jul 2019)