From owner-freebsd-hackers@freebsd.org Sun Jan 1 03:21:35 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F9BC95355 for ; Sun, 1 Jan 2017 03:21:35 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) (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 39A931288 for ; Sun, 1 Jan 2017 03:21:34 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave08.hostedemail.com (Postfix) with ESMTP id 059E4211214 for ; Sat, 31 Dec 2016 15:32:36 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id C4163268E11 for ; Sat, 31 Dec 2016 15:32:27 +0000 (UTC) X-Session-Marker: 7368656140736865616C6576792E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, shea@shealevy.com, :, RULES_HIT:41:355:379:599:800:871:960:966:968:973:988:989:1000:1260:1313:1314:1345:1359:1381:1437:1516:1518:1534:1541:1575:1711:1730:1747:1777:1792:2194:2196:2198:2199:2200:2201:2393:2559:2562:2731:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3870:3871:3872:3874:4362:4385:5007:6261:6506:6747:7281:7909:8603:9010:9040:9108:10004:10848:11026:11232:11658:11914:12296:12438:12663:13138:13161:13229:13231:14096:14180:14181:14721:14819:21060:21080:21324:21433:30034:30041:30054:30070:30075, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none X-HE-Tag: price96_328b02b6bac01 X-Filterd-Recvd-Size: 3694 Received: from localhost (unknown [50.49.103.26]) (Authenticated sender: shea@shealevy.com) by omf06.hostedemail.com (Postfix) with ESMTPA for ; Sat, 31 Dec 2016 15:32:27 +0000 (UTC) From: Shea Levy To: freebsd-hackers@freebsd.org Subject: Re: Detecting changes when mapping /dev/devstat In-Reply-To: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> Date: Sat, 31 Dec 2016 10:32:26 -0500 Message-ID: <87mvfcnmgl.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2017 03:21:35 -0000 --=-=-= Content-Type: text/plain So looking into this more I see the thing to check is stat.allocated && stat.unit_number != -1. But there's a bigger problem of there being no good way (as far as I can tell) to know how big of a mapping we want! The number of devices is not enough, because depending on the order of calls to devstat_new_entry and devstat_remove_entry the actually active devices can live anywhere in the list. The best I can come up with is: * map successively larger multiples of the page size. * iterate through the map until I find numdevs structures with stat.allocated && stat.unit_number != -1 (and properly matching sequence numbers), mapping more pages in if needed. * Check the generation number and reiterate, possibly dropping pages if all devices are now available and adding them if needed. Can we do better? In particular, do we need to get the generation number to detect when to reiterate? Thanks, Shea Shea Levy writes: > Hi all, > > What is the appropriate way to detect changes when accessing devstat > info via a mapping of /dev/devstat? I'm interested both in changes to > the device list as a whole and new statistics on a given device. > > For new stats on a given device, it seems the only way to detect a new > stat is to check the sequence number for that device. Is that right? > > For changes in the device list, it's a bit less clear. My hope was that > I could map space for one more struct devstat than the current numdevs > and just check to see if some field or other is nonzero, but in my > glances through subr_devstat.c I'm not sure if there are any guarantees > about those fields for structures past the current list, especially if a > device was added and removed. Is there anything doable here? > > Thanks, > Shea > > P.S. I wasn't quite sure which list was appropriate for this question, > please feel free to point me to another! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE6ESKvwKkwnxgMLnaXAvWlX2G/icFAlhnz4oACgkQXAvWlX2G /icsUhAAkggKWLIX4/gGh9QSR3+QgUOCBinhpwfBUcVLfILMvTuiJMyVrCazHJNH ovyGfA1naRtEOkp29hgAv1Y0KzhgU1erYqAx/TD86NEl0arWmWoGCXiEdsUkjmSl pOrn0i12Ijv8wvHRdL9NxvVJoW1tvIGuDozAQW69HJ2bQifU/cEFsxI3OTYhqiRv 6Cw0JTbXQzXrITYKKkcY3HZdUjFcKBG+XZ2YucPnLOCWK96/v6NZNXSYhtoaxPXL CyAjaujlKHGlgbMzoDW7emxkxTpg3R+yNa3q1G7LitGflrqzgE33URll1TDY9/Y8 4SkM4TNcpySRtxj4hUF4Vgj1mX97H5e6y7nC7brYAGGiHa9vKyf3WofGCA0zL77s 2hS9l4sFAhz996iYOQf0PPBrAOkhJzvTyN8SXxPSEq5iEBej5QL+9w9dKYb6mBBw uWQnYg2x9AsFqrv9oJU1i9I1SXYSkQmZf1MRuKgwwiDvltHmVWuo4mspP+ljnXqP je0mlG4/sjGa7JxPvRWDlhMsFylOaEvg7bBau/g/2OZ0vXfgZA0nHycQkSoK7Ofm XP0SjvzY9HFOY4AxjqXVdLq/2rsrU64OWZ0Mi/rHZa1Sf87J4UZsrYppQVeohdA+ ALnMgvE5kdMvYWO4/4FW/JM98hykkBrqey8iee+HqxW6eV3Xui4= =bMB3 -----END PGP SIGNATURE----- --=-=-=-- From owner-freebsd-hackers@freebsd.org Sun Jan 1 14:34:14 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14413C9A2EC for ; Sun, 1 Jan 2017 14:34:14 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) (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 DE6C01E64; Sun, 1 Jan 2017 14:34:13 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave02.hostedemail.com (Postfix) with ESMTP id 6DE1D25CE; Sun, 1 Jan 2017 13:17:20 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 73D04351F90; Sun, 1 Jan 2017 13:17:10 +0000 (UTC) X-Session-Marker: 7368656140736865616C6576792E636F6D X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, shea@shealevy.com, :::, RULES_HIT:41:355:379:599:800:871:960:966:967:973:988:989:1000:1260:1263:1313:1314:1345:1359:1437:1516:1518:1534:1537:1561:1575:1711:1714:1730:1747:1777:1792:2194:2196:2199:2200:2393:2525:2560:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3622:3865:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4362:4385:4659:5007:6119:6261:6506:6747:7281:7903:7909:9025:9108:10004:10848:11232:11658:11914:12043:14180:14181:14721:21060:21080:21324:21451:30054, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:2, LUA_SUMMARY:none X-HE-Tag: jam47_5baf27b941a26 X-Filterd-Recvd-Size: 2175 Received: from localhost (unknown [50.49.103.26]) (Authenticated sender: shea@shealevy.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Sun, 1 Jan 2017 13:17:09 +0000 (UTC) From: Shea Levy To: cem@freebsd.org Cc: "freebsd-hackers\@freebsd.org" Subject: Re: Detecting changes when mapping /dev/devstat In-Reply-To: References: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> Date: Sun, 01 Jan 2017 08:17:13 -0500 Message-ID: <87k2aeor6u.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2017 14:34:14 -0000 --=-=-= Content-Type: text/plain Hi Conrad, That package uses libdevstat, which uses the kern.devstat.all sysctl, not the /dev/devstat device. Thanks, Shea Conrad Meyer writes: > Shea, > > You might try looking at how devstat(8) uses the interface. > http://devstat.googlecode.com/ ("pkg install devstat"). > > Best, > Conrad --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE6ESKvwKkwnxgMLnaXAvWlX2G/icFAlhpAVkACgkQXAvWlX2G /ieuvQ//UK8t9ays/7tZqO35t2kij+UudR4QNKqAu2y9vvzLY9K3e9oatCZR8RPd avuUu6a4s0KSJ5DyroYOcmGgnl/G0m1TNpBAW8U59Ze513faig8DTnEXDS5Gsci7 fekMviJ0ClkAuaFlfuq0QezyQxjifPSY9Wv46sBvPxPmd1wfNwVt4eiBWwuxqI5E mre0gsBbpWf+oPg6P2DrCuziu9H8wjUbocHiE7z0Vfc1mtTjSaExtsSYzEti2GTk m4Gge2IkMnOxd24fn/QOVv+KAJyRX1IxHFT4bKlWI1ebHf5Nj9FOmF0mX+aQXfLS meVM0HYQbl6G+eNAIvBLocL9sohWXi/UwH2ySM9aVf1IsttnjD/a+6BPf/4CLn4l bTb926Mb2FVgiPZ47C4RPqdh94RM94O0WgGBtKtrG5PPw3ZZnLq0K0Khx64eubAV b+M470cgae9JYcXHSkWyBrks/RTgONCMVBvrFAfygYg7Ldd+UKzcT8FjFdDGoZ8z +bTHW7ldK8pOqcDtxDgah8Y3uCT7+GmpRw9NMC6wl8bNhbFNhG8AMvZ080Phxpbl 7HBq0hj/fUzSTGZR8gmPuVG/1TRG0GTV/vRr0ZIfr7Qp7q5WlOOOojVOCSJUKLg9 FPnuY1zJkAoTyvbMRzyQDa5SUg4wcTE53y6iUSrZQl/Cped1HYs= =kaN0 -----END PGP SIGNATURE----- --=-=-=-- From owner-freebsd-hackers@freebsd.org Sun Jan 1 21:47:38 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7974DC9A9CD; Sun, 1 Jan 2017 21:47:38 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (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 F0AE9117E; Sun, 1 Jan 2017 21:47:37 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190c-27fff70000004853-34-586978efc3c3 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 4E.B9.18515.FE879685; Sun, 1 Jan 2017 16:47:30 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id v01LlQMh023725; Sun, 1 Jan 2017 16:47:26 -0500 Received: from kduck.kaduk.org (24-107-191-124.dhcp.stls.mo.charter.com [24.107.191.124]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id v01LlNDo003151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 1 Jan 2017 16:47:25 -0500 Date: Sun, 1 Jan 2017 15:47:23 -0600 From: Benjamin Kaduk To: freebsd-hackers@FreeBSD.org Cc: freebsd-current@FreeBSD.org Subject: FINAL CALL for 2016Q4 status reports Message-ID: <20170101214722.GH8460@kduck.kaduk.org> References: <20161226203144.GZ8460@kduck.kaduk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161226203144.GZ8460@kduck.kaduk.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJIsWRmVeSWpSXmKPExsUixG6novupIjPCYNtpTotd106zW8x584HJ Yvvmf4wOzB4zPs1nCWCM4rJJSc3JLEst0rdL4Mq4eX4RY8EbnoqPS4MbGPdzdTFyckgImEis nTWNqYuRi0NIoI1JYs3HM8wgCSGBDYwSh+4VQCSuMEmcnTIBLMEioCIxf9V9dhCbTUBNYv2K a2BxEQF5iX1N78HizED2r61NYLawgK7E+i0bGUFsXgFjid19C6EWGEvM6lzGBBEXlDg58wkL RK+WxI1/L4HiHEC2tMTyfxwgYU6gQ+8fWM4GYosKKEs0zHjAPIFRYBaS7llIumchdC9gZF7F KJuSW6Wbm5iZU5yarFucnJiXl1qka6iXm1mil5pSuokRFKKckjw7GM+88TrEKMDBqMTDKxCd GSHEmlhWXJl7iFGSg0lJlDdhQ0aEEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHeFSVA5bwpiZVV qUX5MClpDhYlcd5Lme4RQgLpiSWp2ampBalFMFkZDg4lCV5BYCwKCRalpqdWpGXmlCCkmTg4 QYbzAA3XBanhLS5IzC3OTIfIn2JUlBLnPVQOlBAASWSU5sH1glKIRPb+mleM4kCvCPPmgLTz ANMPXPcroMFMQIO/xqWDDC5JREhJNTBeify2aNPB1jCOi0s2bDmvtFNgdoR7d57Yixu+cwzZ nSJdpjxfJZLVoRt7I+jkK9XZQf01T3tv/mZ88WxZ5m0PVSsb1tc7pi7uTz7l5fshTjhbeeYD l/SzUmfNQl69vf73/9/IeSbyYT+OHBe4vfuUvv2EgKk35kt6RqiwfuherS3YPnFD6wVvJZbi jERDLeai4kQACrRqPPwCAAA= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2017 21:47:38 -0000 The deadline for submitting 2016Q4 entries is just a week away! -Ben On Mon, Dec 26, 2016 at 02:31:44PM -0600, Benjamin Kaduk wrote: > Dear FreeBSD Community, > > The deadline for the next FreeBSD Quarterly Status update is January 7, > 2016, for work done in October through December. > > Status report submissions do not need to be very long. They may be about > anything happening in the FreeBSD project and community, and provide a great > way to inform FreeBSD users and developers about work that is underway and > completed. Submission of reports is not restricted to committers; anyone > doing anything interesting and FreeBSD related can -- and should -- write one! > > The preferred and easiest submission method is to use the XML generator [1] > with the results emailed to the status report team at monthly@FreeBSD.org . > (Do be sure, though, to save the form output and not the form itself!) There > is also an XML template [2] that can be filled out manually and attached > if preferred. For the expected content and style, please study our guidelines > on how to write a good status report [3]. You can also review previous issues > [4][5] for ideas on the style and format. > > We look forward to seeing your 2016Q4 reports! > > Happy Holidays, > > Ben (on behalf of monthly@) > > [1] https://www.FreeBSD.org/cgi/monthly.cgi > [2] https://www.FreeBSD.org/news/status/report-sample.xml > [3] https://www.FreeBSD.org/news/status/howto.html > [4] https://www.FreeBSD.org/news/status/report-2016-04-2016-06.html > [5] https://www.FreeBSD.org/news/status/report-2016-07-2016-09.html From owner-freebsd-hackers@freebsd.org Wed Jan 4 04:10:01 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B5AC9EB4D for ; Wed, 4 Jan 2017 04:10:01 +0000 (UTC) (envelope-from murray@stokely.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id A22CD1057 for ; Wed, 4 Jan 2017 04:10:01 +0000 (UTC) (envelope-from murray@stokely.org) Received: by mailman.ysv.freebsd.org (Postfix) id 9EB3AC9EB4A; Wed, 4 Jan 2017 04:10:01 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5B1C9EB49 for ; Wed, 4 Jan 2017 04:10:01 +0000 (UTC) (envelope-from murray@stokely.org) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 731971055 for ; Wed, 4 Jan 2017 04:10:01 +0000 (UTC) (envelope-from murray@stokely.org) Received: by mail-it0-x22f.google.com with SMTP id o141so292024374itc.0 for ; Tue, 03 Jan 2017 20:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stokely-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=5wDF5hKXq72HrlNZRyLO8x3RrIbT77EWR0QDDQ+xLp4=; b=lFq41CVYhTjlX9AvmjNP3oSLW9iNaMTaxQxi1CtgeqIBsi6pFtFl9585xVE7UsBbeA TdYipYxdv1goI+podUfg+GiYXWuRnLWBVCIM1q8LzdLYdkIpUzdWkDwCGtdwACJwK1Zo Lb1VgcIts3Te+mqNdTZoyBKuTQvdXLkv2lhDAJfTZuGe3gNgiWj34P/ijt33VgXLRDnb LzSzXfYQ5MSgZb299gpBmutyCiE6IUQKqPou7DPTS46zAZBU1UHH2dnCWLE7VIWDPKnx UMHKXpZKtJIL1jqFkOKRtVPUQ8n5nRWoX5fBVOkyIAmQAgcn89M3E0aJBPzK2Ny/yJfz QS/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=5wDF5hKXq72HrlNZRyLO8x3RrIbT77EWR0QDDQ+xLp4=; b=RJSgW4y7vHafTLc+snGahOP11GCFYoedSEwmmjkHfxAWgp3qjR7X1X8QpapiRk0vRW DkhjK8RCQ0p7N+Edet48vcHuMAlaL/TgbKamyOy+MZGHV8m+tpHqsFFg2zv4V4+VaWvW eUL6ktgvKVdC5N1Wv/tOpia7PuufgalxpfcfuufVl+yr/+C1jLOdL0xC7jCOcEGh9rFM eRstYIQlc7ljeUQzVxvZu2VnQzck1NNAr05mV8Z5X+ALr7DnH8mb68ErSj2GvzERMCkv +ArtdK3nffylF8eK+juERZfWhKnxQJmkk5IYyx9xS2PLZp4feOgY7SLVBraYamkUpfa2 OKjw== X-Gm-Message-State: AIkVDXKxxx/83G4zn7QLEW+4VMDnDUCxNFbsTUbL5K537G9yPzjGW35DRhxoesDtFJKiq8YmOfoaf3I5+oJpwA== X-Received: by 10.36.5.141 with SMTP id 135mr1821890itl.47.1483503000659; Tue, 03 Jan 2017 20:10:00 -0800 (PST) MIME-Version: 1.0 Sender: murray@stokely.org Received: by 10.79.21.66 with HTTP; Tue, 3 Jan 2017 20:10:00 -0800 (PST) From: Murray Stokely Date: Tue, 3 Jan 2017 20:10:00 -0800 X-Google-Sender-Auth: IJiPUFFdOFtvC_JPUAs3tVWzRNI Message-ID: Subject: New Kaby-Lake NUCs: Thunderbolt 3 and Optane NVRAM in -CURRENT? To: hackers@freebsd.org, Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 04:10:01 -0000 I've had a good experience with the last generation of Intel NUCs on -CURRENT and -STABLE. Today Intel announced their latest NUC offerings with Kaby Lake processors, Thunderbolt 3, and their Octane NVMe SSDs. Any thoughts on how these will perform with -CURRENT? The hardware isn't shipping yet, but will additional driver support be required to e.g. make use of the Thunderbolt 3 ports? Will these use the Intel Wireless 8260 supported by the iwi driver? - Murray From owner-freebsd-hackers@freebsd.org Wed Jan 4 06:10:55 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0675C96573 for ; Wed, 4 Jan 2017 06:10:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) 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 803D917AE for ; Wed, 4 Jan 2017 06:10:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 7F910C96572; Wed, 4 Jan 2017 06:10:55 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F32FC96571 for ; Wed, 4 Jan 2017 06:10:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E91D17AC; Wed, 4 Jan 2017 06:10:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id c85so215120887wmi.1; Tue, 03 Jan 2017 22:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=voIuxw3XrDLYJ5Sl1rKvew4FdJt6JPqUkbMOpo6lLUM=; b=NNCNbEII1Ed7gEm6TdNZ41ttpvXbdtHJFdEej2WZxiTVuz3N+i4+FbbTo3WnY134sz NU+XxhN1IYFbQ4TB5XwWXvy2VRg9CywL2awy07EL1PvRGUE7IGHNUobuvdQ9CE7XNqJP xnZeFPn5o+9GiC5w710q35YwbY5/A6CwRHxDasgmoivQnMPhf22rVWhO4/0yOKbUbRqF vU14DVRAVOge1vrSVYJ4iteI3JTpxnOHYMVptMIVLwAFMtYTZoH3vKmH+PbTTT++6Kby 7nL2OaHEDwOzyztflOh3QlqQg4+1wbSjAZ0MwSxxKmK4+6/dX33VtT5rQ0ZByvvJOXYR EoAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=voIuxw3XrDLYJ5Sl1rKvew4FdJt6JPqUkbMOpo6lLUM=; b=A2nZlLa8AqDqkA7rH+Ntj++DmfLXe8MfNqRLuYn8rZn9SGAphbLKC37wpkCpjlnNzg 5znNpp/R3cENBXJtn8FpIXpKKHWxtOaGGuUzxApa9pfdhn7gf4SW7Di0EVMECjeCvwVi LlvIfpdlmFS4VHbwUH1iEkpbZfXDT7/T3OJ7fiTprVQDyT9H+R7FmYhmtRDXyql3UQPp +zxXqUN+3fpPleO5det2WxAlTYuUeA/EyNBDChKAIvGo9GDcqViVZHbHfUqT5V53rNOR lXLreh22m5BB8eWGSe05iNsLBslstrJ9y1xN2D71zmMK1Ba5S/iIBBMRsdMfQTkQTm93 I5bg== X-Gm-Message-State: AIkVDXLn/QGxoYXIQdGwQbzZeySyTo0eBatTPgoA37IPLLGYX5k5uxTwuTJCowTEQMjep6ZKAmMVBx1ve9yQGA== X-Received: by 10.28.109.156 with SMTP id b28mr54577302wmi.116.1483510253421; Tue, 03 Jan 2017 22:10:53 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.44.1 with HTTP; Tue, 3 Jan 2017 22:10:52 -0800 (PST) In-Reply-To: References: From: Adrian Chadd Date: Tue, 3 Jan 2017 22:10:52 -0800 X-Google-Sender-Auth: p0Eoxx-bBAiT31fwc1TuK1lff74 Message-ID: Subject: Re: New Kaby-Lake NUCs: Thunderbolt 3 and Optane NVRAM in -CURRENT? To: Murray Stokely Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 06:10:55 -0000 hi, maybe 8260 will work with if_iwm. I don't have one! -adrian From owner-freebsd-hackers@freebsd.org Wed Jan 4 15:59:09 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995A9C9FF32 for ; Wed, 4 Jan 2017 15:59:09 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5211BA4 for ; Wed, 4 Jan 2017 15:59:09 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OJ900D00IQWYH00@mr11p00im-asmtp002.me.com> for freebsd-hackers@freebsd.org; Wed, 04 Jan 2017 15:58:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1483545531; bh=Kf2L7IBfAuGMbIul5UP8y9nZwq1Fe93JMEGbFRG1q6g=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=npJkCeQvh9llP6SpdKGGSKrbZgtmP3lMta/BeVfMiF7BovReUfNzJiTPoYzsB7gPJ cAatfLTXoph5aGY5X4Z5zGj7909bEE4S0lSKlhYJQz5x1AiM31ICt6//s7g5mOcUVv t5peh9f/ECrFRaym4OkP90rdvYqB9R6ixr5PNVUOx5XLlKbPhpNCjbu5MBA1OP7VL1 8WuglZG8jsN/A2ZiU3+pmseht1rRw6YDUgN/E+6H588yduq+K9XfNF5oYzo0h6UWEV 1BYxGx92Os6sJxNBwscbX2jU2mGIhxk2r6uhMvJmf+x+DOYDo/3hbl8iQtvmLkNqdR GqWcfiv+gcNDw== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OJ900JU1J20BT00@mr11p00im-asmtp002.me.com> for freebsd-hackers@freebsd.org; Wed, 04 Jan 2017 15:58:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-04_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1701040254 User-Agent: Microsoft-MacOutlook/f.1d.0.161209 Date: Wed, 04 Jan 2017 07:58:47 -0800 Subject: Re: New Kaby-Lake NUCs: Thunderbolt 3 and Optane NVRAM in -CURRENT? From: Ravi Pokala Sender: "Pokala, Ravi" To: "freebsd-hackers@freebsd.org" Message-id: <186F7B06-9EDD-4C92-99C9-0BC292E7B511@panasas.com> Thread-topic: New Kaby-Lake NUCs: Thunderbolt 3 and Optane NVRAM in -CURRENT? MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 15:59:09 -0000 > Date: Tue, 3 Jan 2017 20:10:00 -0800 > From: Murray Stokely > To: hackers@freebsd.org, Adrian Chadd > Subject: New Kaby-Lake NUCs: Thunderbolt 3 and Optane NVRAM in > -CURRENT? > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > I've had a good experience with the last generation of Intel NUCs on > -CURRENT and -STABLE. > > Today Intel announced their latest NUC offerings with Kaby Lake processors, > Thunderbolt 3, and their Octane NVMe SSDs. > > Any thoughts on how these will perform with -CURRENT? The hardware isn't > shipping yet, but will additional driver support be required to e.g. make > use of the Thunderbolt 3 ports? > > Will these use the Intel Wireless 8260 supported by the iwi driver? > > - Murray There shouldn't be any issues w/ the Optane NVMe SSDs, because they are just NVMe SSDs. The NVMe interface standard doesn't make any assumptions about the underlying media of the device, so you can have Optane-backed NVMe just like you have NAND-backed SATA or NAND-backed SAS. For that matter, you don't need Kaby Lake to use Optane NVMe SSDs, for that same reason. Using Optane *DIMMs*, *does* require some hardware platform support, which may or may not be in Kaby Lake; I don't remember the details on that. -Ravi (rpokala@) From owner-freebsd-hackers@freebsd.org Wed Jan 4 18:05:16 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C19C9F355 for ; Wed, 4 Jan 2017 18:05:16 +0000 (UTC) (envelope-from derrick.mckee@gmail.com) Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307731EDF for ; Wed, 4 Jan 2017 18:05:16 +0000 (UTC) (envelope-from derrick.mckee@gmail.com) Received: by mail-vk0-x22e.google.com with SMTP id 137so290669592vkl.0 for ; Wed, 04 Jan 2017 10:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=NjZWr0/woneWrJkAmhIqbIuK7M6aDlPmOpM/7d9bf9I=; b=DtXZGA/BIe4QBbn2J+8LktZjxPPjdsI9anVvOXjixsi1DFYb70W9iJOw0mEpRxs5mw CcUPFIMI59xljdt9slGryZBXhFuMMTJSzcPsKS5m9dJtHsER2dZoO3DBUncfeR0WVjsl CxwfbQIerZ9f26I0j2O/oZ5rb0Uz19clr3G2WHkBPES2DoDsZAm+VsBYkJdOz+HF5ZBO 202gsZNoWNSI9isEMNBSdpYsWI7IIP23dfu3HpMEVaaqElFIHrBG2g155aPq/NagUkrq gtKzKX1Qky2SAWBdu28TLfCE/Vm5dN/zZbM/15rCrrqhVbEJVj/JSALIH48DV7xzg4uz Uddg== 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; bh=NjZWr0/woneWrJkAmhIqbIuK7M6aDlPmOpM/7d9bf9I=; b=cCP7neKcjZtNG3JIZPg7LZYx/gYZPxZxaqnKygXYEFtpmfatYbJE5jfy82uxMLNqAu apYG5uB6olRymIdIoLm8vObwe3gJIaBynzZ6PO+psmMwX03BbIH3Cm/3n/MfIhjervp3 21CVxrLbCWxm96YuGMGsVtaBzziBaynlHgIhusX2Pq17wghMct7TzH95FeXu4boWupLe q2mYNj999HXEKSOciCke7xViy7D68J5q1VAHi7j3gI3SAxwabpaCTL6K2DZwHcNHppyB M1hrvLAAqYZLCqCA0NDYa8hY8cq8wQIBHkvLc3zG0II9tbPIqoTUhPu4Ezy//vcOFqnK U4hg== X-Gm-Message-State: AIkVDXIP8kHxI+w/hKu1Pd8gKEGczUguE5L3K6mypuHATL6QoWuGQYOpkc7Mmk6l9hsET1ffLxL1Iu3h37z7Xw== X-Received: by 10.31.227.130 with SMTP id a124mr19302953vkh.45.1483553113742; Wed, 04 Jan 2017 10:05:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Derrick McKee Date: Wed, 04 Jan 2017 18:05:03 +0000 Message-ID: Subject: Using non-standard libc To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 18:05:16 -0000 Hi, I am conducting research into memory safety, and I have developed a custom LLVM pass. I have successfully built libc using my pass. However, when I try to compile a helloworld program using my built libc, I get a whole bunch of undefined reference errors: /path/to/custom/clang -static -nostdlib -L/usr/src/lib/libc -lc -I/usr/src/include hello.c /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400160 /usr/src/lib/libc/libc.a(getenv.o): In function `__clean_env': /usr/src/lib/libc/stdlib/getenv.c:(.text+0x168): undefined reference to `environ' /usr/src/lib/libc/stdlib/getenv.c:(.text+0x171): undefined reference to `environ' /usr/src/lib/libc/libc.a(getenv.o): In function `getenv': /usr/src/lib/libc/stdlib/getenv.c:(.text+0x1f6): undefined reference to `environ' /usr/src/lib/libc/libc.a(getenv.o): In function `__merge_environ': /usr/src/lib/libc/stdlib/getenv.c:(.text+0x42d): undefined reference to `environ' /usr/src/lib/libc/stdlib/getenv.c:(.text+0x459): undefined reference to `environ' /usr/src/lib/libc/libc.a(getenv.o):/usr/src/lib/libc/stdlib/getenv.c:(.text+0x524): more undefined references to `environ' follow /usr/src/lib/libc/libc.a(getprogname.o): In function `getprogname': /usr/src/lib/libc/gen/getprogname.c:(.text+0x7): undefined reference to `__progname' /usr/src/lib/libc/libc.a(auxv.o): In function `init_aux_vector_once': /usr/src/lib/libc/gen/auxv.c:(.text+0x27): undefined reference to `environ' /usr/src/lib/libc/libc.a(exec.o): In function `execl': /usr/src/lib/libc/gen/exec.c:(.text+0x154): undefined reference to `environ' /usr/src/lib/libc/libc.a(exec.o): In function `execlp': /usr/src/lib/libc/gen/exec.c:(.text+0x484): undefined reference to `environ' /usr/src/lib/libc/libc.a(exec.o): In function `execvp': /usr/src/lib/libc/gen/exec.c:(.text+0x4e3): undefined reference to `environ' /usr/src/lib/libc/libc.a(exec.o): In function `execv': /usr/src/lib/libc/gen/exec.c:(.text+0x537): undefined reference to `environ' /usr/src/lib/libc/libc.a(exec.o):/usr/src/lib/libc/gen/exec.c:(.text+0x5b7): more undefined references to `environ' follow clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) Any idea of what I am missing? Thanks. -- Derrick McKee Ph.D. Student at Purdue University -- Derrick McKee Ph.D. Student at Purdue University From owner-freebsd-hackers@freebsd.org Wed Jan 4 19:07:49 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED8AC9F281 for ; Wed, 4 Jan 2017 19:07:49 +0000 (UTC) (envelope-from alexander.tarasikov@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3566A1311 for ; Wed, 4 Jan 2017 19:07:49 +0000 (UTC) (envelope-from alexander.tarasikov@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id v84so553458708oie.3 for ; Wed, 04 Jan 2017 11:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nrD0B9yN2y5JPQ260I2beHmnOQ3lDxJ46zFZqzaswXQ=; b=VIroqTStwCkGmreWvI0hf2mp2VO3H9telZgxWniLwhDR5dEwpUwkhuDHRgHFIGV7Mc QFN5w7bmzeS2pZwsr1AhciLMR+ECK7u7UAWitw2i9rbuZ7ezxdjgMulrtfLa0D3vgMvR tnO9FoaUdBfwPnaH6Aqx8m+pS63ZwJj+rsdTNVE8TTfPm2WUc4qPDteqSPGKIdxWEIsc EQ3n1r2bmUxMr80Ab6SuUr8jKclPUPEnHhnT6PbdTN1s/FwVkMdHDfH8JRsL41X+7rJi ELMh1iMDyPhR/YjzwIcxbHm8Of2orIdiAaalr4Wkh+4VxvYCWKDwaP6nOzX8gDuuUH5e CMkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nrD0B9yN2y5JPQ260I2beHmnOQ3lDxJ46zFZqzaswXQ=; b=L4RLrBMueaeOshmwR5nj4gh3hWa46DmsRnsLBmtFDO7zMCQHRdElwAKkmXG5SQYTKD MvziITzhsmgB+e3/OvUpBmYWT2H/mXt9I76it4KPpWZLYDUcS5FJTso8GzF4FJgJ+Cbf fHWxbXnibBPpq9Rj1PGMi+ETAe88dLuZVo1PNwrmiJAurb9C4tcpB2HrcFgpU+SKfCva EOt/zXeOLOzxlUUrQkMKPbjlgA1pgKOc25Hyb0ISllfAD69VfWhdCBhge7MVsHK3UXCI eEJOc02XQXNqnHKO3LHc2P7VaBFyP/orzn6oJHFGHMVVceXS12UgUlt2i8iTedwGmRJN QbjQ== X-Gm-Message-State: AIkVDXL83w+TuMVnSWj5d28oadMqBqurPVVJVnAFHVlBVMH1/hgSAzc9iUE5ue9RCLzCC7BXjDB4x8X0kDIpsA== X-Received: by 10.157.47.234 with SMTP id b39mr37916484otd.0.1483556867439; Wed, 04 Jan 2017 11:07:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.97.225 with HTTP; Wed, 4 Jan 2017 11:07:46 -0800 (PST) In-Reply-To: References: From: Alexander Tarasikov Date: Wed, 4 Jan 2017 22:07:46 +0300 Message-ID: Subject: Re: Using non-standard libc To: Derrick McKee Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 19:07:49 -0000 I think you need to grep for the "environ" symbol. Most likely it's in the crt library (crt1.o or crti.o). On Linux that would be libgcc (lgcc) which provides crtbegin.o, should be something similar on FreeBSD. On Wed, Jan 4, 2017 at 9:05 PM, Derrick McKee wrote: > Hi, > > I am conducting research into memory safety, and I have developed a custom > LLVM pass. I have successfully built libc using my pass. However, when I > try to compile a helloworld program using my built libc, I get a whole > bunch of undefined reference errors: > > /path/to/custom/clang -static -nostdlib -L/usr/src/lib/libc -lc > -I/usr/src/include hello.c > > /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to > 0000000000400160 > /usr/src/lib/libc/libc.a(getenv.o): In function `__clean_env': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x168): undefined reference to > `environ' > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x171): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o): In function `getenv': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x1f6): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o): In function `__merge_environ': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x42d): undefined reference to > `environ' > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x459): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o):/usr/src/lib/libc/stdlib/getenv.c:(.text+0x524): > more undefined references to `environ' follow > /usr/src/lib/libc/libc.a(getprogname.o): In function `getprogname': > /usr/src/lib/libc/gen/getprogname.c:(.text+0x7): undefined reference to > `__progname' > /usr/src/lib/libc/libc.a(auxv.o): In function `init_aux_vector_once': > /usr/src/lib/libc/gen/auxv.c:(.text+0x27): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execl': > /usr/src/lib/libc/gen/exec.c:(.text+0x154): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execlp': > /usr/src/lib/libc/gen/exec.c:(.text+0x484): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execvp': > /usr/src/lib/libc/gen/exec.c:(.text+0x4e3): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execv': > /usr/src/lib/libc/gen/exec.c:(.text+0x537): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o):/usr/src/lib/libc/gen/exec.c:(.text+0x5b7): > more undefined references to `environ' follow > clang-4.0: error: linker command failed with exit code 1 (use -v to see > invocation) > > Any idea of what I am missing? Thanks. > -- > Derrick McKee > Ph.D. Student at Purdue University > -- > Derrick McKee > Ph.D. Student at Purdue University > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Regards, Alexander From owner-freebsd-hackers@freebsd.org Wed Jan 4 19:55:57 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6469C9F86B for ; Wed, 4 Jan 2017 19:55:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4FBD31979 for ; Wed, 4 Jan 2017 19:55:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v04JtpWK007112 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jan 2017 21:55:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v04JtpWK007112 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v04JtpeP007111; Wed, 4 Jan 2017 21:55:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 4 Jan 2017 21:55:51 +0200 From: Konstantin Belousov To: Derrick McKee Cc: freebsd-hackers@freebsd.org Subject: Re: Using non-standard libc Message-ID: <20170104195551.GA2533@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 19:55:57 -0000 On Wed, Jan 04, 2017 at 06:05:03PM +0000, Derrick McKee wrote: > Hi, > > I am conducting research into memory safety, and I have developed a custom > LLVM pass. I have successfully built libc using my pass. However, when I > try to compile a helloworld program using my built libc, I get a whole > bunch of undefined reference errors: > > /path/to/custom/clang -static -nostdlib -L/usr/src/lib/libc -lc > -I/usr/src/include hello.c > > /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to > 0000000000400160 > /usr/src/lib/libc/libc.a(getenv.o): In function `__clean_env': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x168): undefined reference to > `environ' > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x171): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o): In function `getenv': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x1f6): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o): In function `__merge_environ': > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x42d): undefined reference to > `environ' > /usr/src/lib/libc/stdlib/getenv.c:(.text+0x459): undefined reference to > `environ' > /usr/src/lib/libc/libc.a(getenv.o):/usr/src/lib/libc/stdlib/getenv.c:(.text+0x524): > more undefined references to `environ' follow > /usr/src/lib/libc/libc.a(getprogname.o): In function `getprogname': > /usr/src/lib/libc/gen/getprogname.c:(.text+0x7): undefined reference to > `__progname' > /usr/src/lib/libc/libc.a(auxv.o): In function `init_aux_vector_once': > /usr/src/lib/libc/gen/auxv.c:(.text+0x27): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execl': > /usr/src/lib/libc/gen/exec.c:(.text+0x154): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execlp': > /usr/src/lib/libc/gen/exec.c:(.text+0x484): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execvp': > /usr/src/lib/libc/gen/exec.c:(.text+0x4e3): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o): In function `execv': > /usr/src/lib/libc/gen/exec.c:(.text+0x537): undefined reference to `environ' > /usr/src/lib/libc/libc.a(exec.o):/usr/src/lib/libc/gen/exec.c:(.text+0x5b7): > more undefined references to `environ' follow > clang-4.0: error: linker command failed with exit code 1 (use -v to see > invocation) > > Any idea of what I am missing? Thanks. You are missing the so-called crt files which ensure that the resulting binary follows ABI etc. Easier way for you to see what is going on is to compile trivial program in the verbose cc driver mode: cc -v -o hello hello.c You will see what are the actual tools invocation, and in particular, how the actual linking is performed. Then you could replace system libc reference with your own lib by invoking ld manually.