From owner-freebsd-current@freebsd.org Thu Aug 16 19:10:06 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A5A10734E9 for ; Thu, 16 Aug 2018 19:10:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6C2740BD for ; Thu, 16 Aug 2018 19:10:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 60B2B10734E7; Thu, 16 Aug 2018 19:10:05 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F09D10734E5 for ; Thu, 16 Aug 2018 19:10:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26FA740B8 for ; Thu, 16 Aug 2018 19:10:04 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: f7c22bcd-a187-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id f7c22bcd-a187-11e8-aff6-0b9b8210da61; Thu, 16 Aug 2018 19:09:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7GJ9wKZ078491; Thu, 16 Aug 2018 13:09:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534446597.1466.42.camel@freebsd.org> Subject: Re: /usr/bin/ld: error: undefined symbol: main [r337834 -> r337903] From: Ian Lepore To: Xin LI , Brad Davis Cc: current@freebsd.org Date: Thu, 16 Aug 2018 13:09:57 -0600 In-Reply-To: References: <20180816111532.GY1190@albert.catwhisker.org> <1534436769.312158.1476422048.77F4DB62@webmail.messagingengine.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2018 19:10:06 -0000 On Thu, 2018-08-16 at 11:25 -0700, Xin LI wrote: > On Thu, Aug 16, 2018 at 9:26 AM Brad Davis wrote: > > > > > > On Thu, Aug 16, 2018, at 10:13 AM, Xin LI wrote: > > > > > > This was caused by r337852, but I didn't investigated further. > > > > > > The problem is that we have a source file called 'moduli.c' in > > > crypto/openssh/ while the build target was moduli, and bmake seen > > > 'moduli' in source tree as older than moduli.c, and decided to > > > rebuild > > > it from source, while the two files are unrelated. > > Hi Xin, > > > > I don't see how that could be the case as I didn't move the file > > around, I just moved how it gets installed. > > > > I have done many many builds with this change in and haven't seen > > this problem.. > Yeah, let me rephrase: this might have been exposed by r337852; I > don't think your change itself really caused or should have caused > problem, but my theory based on what we have observed was that it > might have exposed a bug where either bmake itself, or some .mk files > might have generated e.g. automatic rule for ${foo}: ${foo}.c rules > (haven't traced that part down yet). > There is an implicit rule to build file from file.c, it's why you can type "make foo" in a dir that contains a foo.c and no Makefile. The CONFS=moduli makes moduli into a target.  The implicit rules search finds the rule to make moduli from moduli.c and because of the .PATH it's able to find a moduli.c. It might be fixable by simply adding a target with a do-nothing script for building moduli in usr.sbin/sshd/Makefile.  Something like moduli:     @ : # Do nothing. But that's just a wild guess on my part, not sure that'll work. Hmm, in fact, it'll probably cause a make warning about duplicate targets with scripts. --Ian > The most scaring part is that the build system seems to trying > building crypto/openssh/moduli because moduli.c was newer, and the > file was deleted as part of the rebuild; should moduli.c compile by > its own, we would end up with a binary moduli file. > > I'll take another look tonight if I had some time. > > > > > > > > > Regards, > > Brad Davis > > > > > > > > On Thu, Aug 16, 2018 at 4:19 AM David Wolfskill > > .org> wrote: > > > > > > > > > > > > Running: > > > > > > > > FreeBSD g1-215.catwhisker.org 12.0-ALPHA1 FreeBSD 12.0-ALPHA1 > > > > #80  r337834M/337834:1200077: Wed Aug 15 04:34:45 PDT 2018      > > > > root@g1-215.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/s > > > > ys/CANARY  amd64 > > > > > > > > after updating working copy to r337903, I'm seeing: > > > > > > > > ... > > > > > > > > > > > > > > > > > > > > > > > > > stage 4.3: building everything > > > > ... > > > > --- ifconfig_make --- > > > > Building > > > > /common/S4/obj/usr/src/amd64.amd64/rescue/rescue/usr/src/sbin/i > > > > fconfig/af_inet6.o > > > > --- all_subdir_secure --- > > > > --- moduli --- > > > > /usr/bin/ld: error: undefined symbol: main > > > > > > > > > > > > > > > > > > > > > > > > > referenced by crt1.c > > > > > > >               /common/S4/obj/usr/src/amd64.amd64/tmp/usr/ > > > > > > > lib/crt1.o:(_start) > > > > /usr/bin/ld: error: undefined symbol: Fssh_error > > > > .... > > > > make[5]: stopped in /usr/src/secure/usr.sbin/sshd > > > > .ERROR_TARGET='moduli' > > > > .ERROR_META_FILE='/common/S4/obj/usr/src/amd64.amd64/secure/usr > > > > .sbin/sshd/moduli.meta' > > > > .MAKE.LEVEL='5' > > > > MAKEFILE='' > > > > .MAKE.MODE='meta missing-filemon=yes missing-meta=yes > > > > silent=yes verbose' > > > > _ERROR_CMD='cc -target x86_64-unknown-freebsd12.0 -- > > > > sysroot=/common/S4/obj/usr/src/amd64.amd64/tmp > > > > -B/common/S4/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe   - > > > > I/usr/src/crypto/openssh -include ssh_namespace.h -DHAVE_LDNS=1 > > > > -DUSE_BSM_AUDIT=1 -DHAVE_GETAUDIT_ADDR=1 -DUSE_BLACKLIST=1 > > > > -I/usr/src/contrib/blacklist/include -include krb5_config.h > > > > -DLIBWRAP=1 -std=gnu99 -fstack-protector-strong -Wno-pointer- > > > > sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const- > > > > variable -Wno-tautological-compare -Wno-unused-value -Wno- > > > > parentheses-equality -Wno-unused-function -Wno-enum-conversion > > > > -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno- > > > > switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno- > > > > parentheses  -Qunused-arguments   - > > > > L/common/S4/obj/usr/src/amd64.amd64/lib/libblacklist  /usr/src/ > > > > crypto/openssh/moduli.c  -o moduli; ;' > > > > .CURDIR='/usr/src/secure/usr.sbin/sshd' > > > > .MAKE='make' > > > > .OBJDIR='/common/S4/obj/usr/src/amd64.amd64/secure/usr.sbin/ssh > > > > d' > > > > .TARGETS='all' > > > > DESTDIR='/common/S4/obj/usr/src/amd64.amd64/tmp' > > > > .... > > > > > > > > (on both the laptop and the build machine). > > > > > > > > I have copied the .ERROR_META_FILE to > > > > > > > eta and > > > > a typescript of the attempted build to > > > > > > > pt>. > > > > > > > > Additional information (previous day's verbose dmesg.bot, etc.) > > > > may > > > > be found at > > > > . > > > > > > > > Peace, > > > > david > > > > -- > > > > David H. Wolfskill                              david@catwhiske > > > > r.org > > > > Trump is gaslighting us: https://www.bbc.com/news/world-us-cana > > > > da-44959300 > > > > > > > > See http://www.catwhisker.org/~david/publickey.gpg for my > > > > public key. > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd > .org"