From nobody Sat Feb 11 17:10:02 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PDcY95xvYz3pfjK for ; Sat, 11 Feb 2023 17:10:05 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PDcY95VdRz4HV4; Sat, 11 Feb 2023 17:10:05 +0000 (UTC) (envelope-from theraven@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676135405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p8Ll62jtVCdAD563FEDxQL+xOGDd4/78HLVokc2rbPQ=; b=MMjHincxNgq5JWsvbd6Z1hlJPvQSWclMP9IUFMuUyiUMzeMmzpxYtGGiELehWswOqz0Kj1 NYKWiKhe4H76QBRyDf5VfhX93EaKJljDKGigeZ+xoAtAJp5Gm3aELJaC068oOJbn7G6gub y4L/iNK8pFB1hmPPDxL5+GhtaQB+ZXHgeKWmrs1OhjSJDR7R8M4e6LHbwWG9vA62B2p2SL hmyjluc2REzF0ZTl7V0hZ5YM4M8kHSVT39eGVfvnonK4Kt6xPyMPIKvZEPT/qK8UU+4ys1 Kt6IBF+Tqhs/hCgl5Y8gZktAVmHKlfpvCJmL+LxEUcAVObwJqjHfBK9kt1hXLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676135405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p8Ll62jtVCdAD563FEDxQL+xOGDd4/78HLVokc2rbPQ=; b=wTZl5iZ2dUFVD5SAldHu8SwUc/xlxPj2QdA/R+/iPP/0pMe/xqyJD79hoRxQJZmOnhDe/x 54K1nJFCvZlCzHm9A6ELxUmElr1SUlrfQSxlodNUj5LvnwEAd5FdVZrGwLWJsDF0RvCfz8 Ul0/OlENVMZkBEM+M36N6JoI3/+tEuQveE3+6BHzmiF1t8igx45V6khNSPccy5QHtimOpo ZkfoqTQG/XbWCVMr/gTyhJjqN+HHb5JujrRFaHzlFakvjUqNAJq1f92e3gDDA76d/BxGlI 7N3kfvUQjlqkKnduYfwJDY2p3gvJQn9OcHj0e72AEvYu0b4vdAM+B9sUi3AyeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676135405; a=rsa-sha256; cv=none; b=HRdaGFc9b6i03UdpRXHVlnBU9HKPa+61f+LqElS2KutxCLvDrPTFpQsJzRGm9WYFnPdfUj F1HCgNES8FL9txaFA/dmVE6XuFAI3jNcjuVX9b/P54qj7bTueqOVkqSrZ+xJ255H9yLDWm ztJ4bclCpEDyR5tk6DlCNbJtHNUpACZByOcT9w6wd7djK8VGid/QvupdljiQT1FSnaNxLp GZ/ufhu1TVLsjKg/JUHefCt/YsBh8s49654ad1rlaIkCI8nQtAcmLKiUqLDfcSzBJREAxV 4181T/X9pW2WrP3PtmPjfFJ6DwO12pZD7n0TeXk5RizitR9+dIRsUlPbbTh+VQ== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PDcY94MlDzN2W; Sat, 11 Feb 2023 17:10:05 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtpclient.apple (host81-158-36-31.range81-158.btcentralplus.com [81.158.36.31]) by smtp.theravensnest.org (Postfix) with ESMTPSA id A3E25105D0; Sat, 11 Feb 2023 17:10:03 +0000 (GMT) Content-Type: text/plain; charset=utf-8 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: CFT: snmalloc as libc malloc From: David Chisnall In-Reply-To: <20230210162350.gg5g7dihp3zef3ov@mutt-hbsd> Date: Sat, 11 Feb 2023 17:10:02 +0000 Cc: freebsd-hackers Content-Transfer-Encoding: quoted-printable Message-Id: <193D1E1C-73EB-42BB-8A6A-87B0E4AD9D7C@FreeBSD.org> References: <2f3dcda0-5135-290a-2dff-683b2e9fe271@FreeBSD.org> <20230210162350.gg5g7dihp3zef3ov@mutt-hbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3654.120.0.1.13) X-ThisMailContainsUnwantedMimeParts: N On 10 Feb 2023, at 16:23, Shawn Webb wrote: >=20 > So I took a little bit of a different approach, which should provide > the same end result as your submodule approach. Note that I'm doing > this in HardenedBSD 14-CURRENT (the hardened/current/master branch). >=20 > 1. git cherry-pick -xs a5c83c69817d03943b8be982dd815c7e263d1a83 > 2. git rm -f .gitmodules contrib/snmalloc > 3. git commit > 4. git subtree add -P contrib/snmalloc \ > git@github.com:microsoft/snmalloc.git main >=20 > I believe this should leave me with a tree that populates > contrib/snmalloc and pulls in your non-contrib/ changes, leading me to > end up in the same end state as your submodule approach. >=20 > I am seeing some build errors. I've uploaded a WITHOUT_CLEAN=3Dyes log > to: >=20 > https://hardenedbsd.org/~shawn/2023-02-10_snmalloc-01.log.txt >=20 > Note that this is with llvm 15.0.7 that just landed in FreeBSD main. The error is a bit confusing, because nullptr_t has been in libc++ since = C++11. Does HardenedBSD change anything in include orders? Can you add = -v to the end of the compile command: c++ -target x86_64-unknown-freebsd14.0 = --sysroot=3D/usr/obj/data/src/hardenedbsd/amd64.amd64/tmp = -B/usr/obj/data/src/hardenedbsd/amd64.amd64/tmp/usr/bin = -fomit-frame-pointer -O2 -pipe -fno-common -DHARDENEDBSD -DNO__SCCSID = -DNO__RCSID -I/data/src/hardenedbsd/lib/libc/include = -I/data/src/hardenedbsd/include -I/data/src/hardenedbsd/lib/libc/amd64 = -DNLS -ftls-model=3Dinitial-exec -D__DBINTERFACE_PRIVATE = -I/data/src/hardenedbsd/contrib/gdtoa = -I/data/src/hardenedbsd/contrib/libc-vis -DINET6 = -I/usr/obj/data/src/hardenedbsd/amd64.amd64/lib/libc = -I/data/src/hardenedbsd/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE = -I/data/src/hardenedbsd/lib/libmd = -I/data/src/hardenedbsd/lib/libc/locale -DBROKEN_DES -DPORTMAP = -DDES_BUILTIN -I/data/src/hardenedbsd/lib/libc/rpc -DWANT_HYPERV -DYP = -DNS_CACHING -DSYMBOL_VERSIONING -g -gz=3Dzlib -mretpoline -fPIC -flto = -MD -MF.depend.malloc.o -MTmalloc.o -Wno-format-zero-length = -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k = -Wno-uninitialized -Wdate-time -Wno-empty-body -Wno-string-plus-int = -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable = -Wno-error=3Darray-parameter -Wno-error=3Ddeprecated-non-prototype = -Wno-error=3Dunused-but-set-parameter -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 -Qunused-arguments = -I/data/src/hardenedbsd/lib/libutil = -I/data/src/hardenedbsd/lib/msun/amd64 = -I/data/src/hardenedbsd/lib/msun/x86 --include-directory-after = /data/src/hardenedbsd/lib/msun/src -DHARDENEDBSD = -I/data/src/hardenedbsd/contrib/snmalloc/src/snmalloc -std=3Dc++20 = -mcx16 -fno-exceptions -fno-rtti -DSNMALLOC_USE_THREAD_CLEANUP = -DSNMALLOC_BOOTSTRAP_ALLOCATOR -DSNMALLOC_JEMALLOC3_EXPERIMENTAL = -DSNMALLOC_JEMALLOC_NONSTANDARD -DSNMALLOC_PLATFORM_HAS_GETENTROPY = -DSNMALLOC_STATIC_LIBRARY_PREFIX=3D__ -ftls-model=3Dinitial-exec = -DSNMALLOC_CHECK_CLIENT -DSNMALLOC_FAIL_FAST=3Dfalse -DNDEBUG -g = -gz=3Dzlib -mretpoline -flto -Wno-c++11-extensions -c = /data/src/hardenedbsd/lib/libc/stdlib/snmalloc/malloc.cc -o malloc.o That should dump the include paths. It=E2=80=99s possible that the = libc++ headers are being included in the wrong order with respect to the = C paths? David=