From owner-svn-src-all@freebsd.org Thu Apr 18 15:12:02 2019 Return-Path: Delivered-To: svn-src-all@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 CC2B915740BD for ; Thu, 18 Apr 2019 15:12:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (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 6B8B06B52D for ; Thu, 18 Apr 2019 15:12:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x841.google.com with SMTP id x12so2524486qts.7 for ; Thu, 18 Apr 2019 08:12:01 -0700 (PDT) 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=TRSN82XmM4JARmlpawANEUATfqbhfYnuAVuWT0801dI=; b=vdjqhlNNzluCGvTQfZO2ZUlsa1WxQv5mOXg2kN1LJ1/fA+8xigZW0kKeLiL8iWNGpk IPyc9Dv9Avx7reGF/P+VQhg2oB02EbAjlmC2yhkCH1YC88ovDLXLk1yMdeB1MoGB/+IT RfTsGDWDEZseTAu2f2KAk6D0d6y9Te78O58G14l1IzknLAnySDR4SUE9eakL6u+FONC6 Nuife8blpW0eznqrEX8qjdUzryQCFK4N9aI53GMu7o2dDlLc6317lQR8ODMicXNWRiGu LgbBcYm8QIrhRZY5w99CqIqVSJDszeGKOKSv/eARxICFcC2WwWHZlvwJIHspcRZjJcYs xD8A== 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=TRSN82XmM4JARmlpawANEUATfqbhfYnuAVuWT0801dI=; b=LGCFOOdSKNZaMEIfKmeHwj6pFO7HvriPbLQpQAU3uJtViZieXOXVQfrTZDE3MUF7gb GWbExGEZf+9Ta5qKy1vKW7leam6RJZL1hvZIeSusZTAN/4bZzWKh3uYpRYUwucRQRE1o QZK3F+PqcbzbUAjKQnOEUTqPbMY4vcxg931euC8w2icAYkT8Y+D52bPw6y1brpxx3BIH GlbZlxFKDAXmyYRCBJQFJzJQmCb+ENkie8BF+/TLYldLGRAATm4onGdx/rRC/MXx2/+p x9fLjPGXgehgok8aNR/9rssyyszCk3zjpzp4DPejyV78TVI3dWh7LWOHtDJrF+6Eq9hY Q/5A== X-Gm-Message-State: APjAAAU+Ujxqeh8hOfyRQbaovz4bnzSKm9WlQS6dSRYNDtkAzqwryhZ6 rkoZTEJcjQW5zKyRWJkEtAwAyffYN4eY/nJJnOuy3A== X-Google-Smtp-Source: APXvYqyZH25ZVhd9VjMTPr2uI3vD4vXH7wPhlfqwT4QxY8KcOSrIOeSxNNGZzTBIjZiNFt0Cjd6GuqNMi3MSH+U0bA0= X-Received: by 2002:ac8:38b6:: with SMTP id f51mr77932163qtc.33.1555600320760; Thu, 18 Apr 2019 08:12:00 -0700 (PDT) MIME-Version: 1.0 References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> In-Reply-To: <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> From: Warner Losh Date: Thu, 18 Apr 2019 09:11:49 -0600 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: Cy Schubert Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 6B8B06B52D 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Thu, 18 Apr 2019 15:12:02 -0000 On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert wrote: > On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" < > freebsd@gndrsh.dnsmgr.net> wrote: > >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes > >> wrote: > >> > > >> > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, > >"Rodney W. > >> > > Grimes" > >> > > writes: > >> > > > > Author: cy > >> > > > > Date: Thu Apr 18 01:02:00 2019 > >> > > > > New Revision: 346341 > >> > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > >> > > > > > >> > > > > Log: > >> > > > > As an interim measure until a more permanent solution is > >implemented > >> > > > > workaround the following error: > >> > > > > > >> > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: > >error: use of > >> > > > > undeclared identifier > >> > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, > >&rights, FA_OPEN); > >> > > > > > >> > > > > Reported by: O. Hartmann > >> > > > > Reported by: Michael Butler > >> > > > > Reported by: gjb@ & cy@ (implicit) > >> > > > > Reviewed by: emaste@ > >> > > > > Noted by: rgrimes@ > >> > > > > > >> > > > > Modified: > >> > > > > head/tools/build/Makefile > >> > > > > > >> > > > > Modified: head/tools/build/Makefile > >> > > > > > > >=========================================================================== > >> > > > === > >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 > > (r34634 > >> > > > 0) > >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 > > (r34634 > >> > > > 1) > >> > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > >> > > > > INCS+= libcasper.h > >> > > > > .endif > >> > > > > > >> > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > >> > > > > CASPERINC+= > >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > >> > > > rgs.h > >> > > > > -.endif > >> > > > > >> > > > As a further note, we should probably hunt for any thing > >> > > > that is explicity looking at /usr/include/... in a Makefile, > >> > > > as that is minimally missing a ${DESTDIR} argument. > >> > > > > >> > > > The above may of actually worked if it had been written: > >> > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > >> > > > someone may wish to test that. > >> > > > > >> > > > Also a pathname rooted at / without ${DESTDIR} is almost > >certainly a mistake. > >> > > > >> > > This is a better solution. I tested this in a tree with a > >duplicated > >> > > environment: Problem solved. Before this is committed it should > >be > >> > > tested on one of the universe machines. > >> > > >> > From what Ed just said this would also be wrong, > >> > as well as CASPERINC+= above being wrong, if this > >> > is being built for the host we should not be using > >> > any headers from ${SRCTOP} at all. > >> > > >> > if capfileargs.h does not exist on the host that functionality > >> > must not be compiled into the buildtool as the host does not > >> > have this feature and attempting to use it from SRCTOP is wrong. > >> > > >> > >> Keep in mind that this is bootstrap; it's being built for the host > >> system, but it will link against a version of libcasper that's been > >> built in an earlier stage with the proper featureset. > > > >Ok, flip flop again, if infact this is linked against a > >library that implements the stuff from cap_fileargs.h then > >infact the ${DESTDIR} addition so that the build peaks into > >the cross build tree is correct, or what ever the equivelent > >to DESTDIR is for that ? BUILDDIR? The point is it should > >be picking this header up from the object tree, NOT from > >the running system. > > Yes, this was my conclusion when working on kerberos and ntp. This is also > true of libraries, else one would need to installworld and buildworld > again to get a properly built library/binary. > > IIRC ngie@ fixed a number of these across the tree a couple of years ago. OK. There's a number of different issues going on. As the original author of libegacy (which is what we're seeing fail), let me address the design generically and comment on different things that have come up in this thread. Since this is going into the libegacy that we're using to build the system, the check for file is bogus, for reasons I'll discuss below. When we add new includes to the system, it is appropriate to do it this way. And when this file was added to the system, the check was correct. First off, DESTDIR is absolutely not correct since this is to build the legacy library and legacy includes which augment the host's sources on legacay system, hence the name. It's never the correct thing to use. The problem that we have here is not that the file is missing (which is why it was added the way it was a long time ago), but rather missing functionality in a file that's been around for a long time. So, since it is that class of problem, the canonical way we've dealt with it in the past is to do something like create a file foo.h that looks something like #include_next #ifndev SOMETHING_NEW #define SOMETHING_NEW 0 /* Or other values that are fail-safe on the old system */ #endif and that's the change that needs to be made here. Sometimes, more extensive things need to be done when the old library can't work at all with the new code. In those cases, the pattern is for foo.h to include #define problem_fn my_problem_fn and then write a my_problem_fn that wraps problem_fn in a way that works on the old system. Kinda a poor man's symbol versioning, in a way (note: we can't use symbol version for this since we're building new binaries). The "stop gap" gets things compiling, and maybe OK for the moment, unless the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes the old library to do the wrong thing. I've not done the deep dive to see if this is the case or not. So, does that make sense? Warner