From nobody Thu Dec 02 10:34:35 2021 X-Original-To: freebsd-current@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 928CA18CDC4B for ; Thu, 2 Dec 2021 10:34:40 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4J4XQ834nDz56XM for ; Thu, 2 Dec 2021 10:34:40 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 453B92BB16 for ; Thu, 2 Dec 2021 10:34:40 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.202] (host86-166-82-189.range86-166.btcentralplus.com [86.166.82.189]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 8C1CE2D8EA for ; Thu, 2 Dec 2021 10:34:38 +0000 (GMT) Message-ID: Date: Thu, 2 Dec 2021 10:34:35 +0000 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: failure of pructl (atexit/_Block_copy/--no-allow-shlib-undefined) Content-Language: en-GB To: freebsd-current@freebsd.org References: <20211202020326.GU35602@funkthat.com> <75CCC6A8-F777-48F9-9AC7-5A08FA9CCD25@FreeBSD.org> From: David Chisnall In-Reply-To: <75CCC6A8-F777-48F9-9AC7-5A08FA9CCD25@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638441280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XetTbBT2mGDM8Ow6f/Qmt4NEPenBFzc6pijnKf6kyEE=; b=LiuURoD8CuJpqObWhjvzASsXpmVYKhEaIttt9vSTcExlrY/k5vezEitaZrxvEJvjrwVDhb E/T83UXadt793ElCNpjilj7XMHFjLqhSSh+mLemQdA/cSDB2sB7AtLkeoSx9pwjczZ0yeI sVE1ZT+ND/YlF5a/AAdYaw7haWe4xO3J1+y2W7ttA5OuzvDbVqgFhbZRjCxY84yWlPBt0z Rzs80dTKhH3WFisvcLuod1O9Pq3Q+4PSe5MM/YXyUfpmpM5kHFLFE2Jroo00dwLnrpSPUO Biyk6fVmM4j0l638AWQIyr/mqDmhWnGdyhdw0rbsmNKsPa3Ev89/qUp9H4ZaDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638441280; a=rsa-sha256; cv=none; b=GOgcxCeuRCD3c3hZKI8YrsuL1334FmM0E1a+z7C5u3utU4lCdo1eKNAbG+ny74GH2ExUKz B4wFyTIyCZUO8mPQRzUwlZHCQZIWgXATgUyewcHF8+fQLQrJQY4Ds83LIGLnxoAPhRYzQX gy0aTSdHa7EEVueHzg3CmM9QgbrFZ3DTzioA10jHwqQhydvBeuw7760I4WmOvPosA4ZwOn 0Bu87dbx5XYSD1UjOK1Ef5WnUldSSGDSO5+CC1Fjjv6VW/yeW1EhmMZ2pAYUaAamqUjedF pWJtXxn6spiFAXYm/ptSppg6w5/ONtzLBux6YTKANwKErEm5U4q5S/fLdW6zkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 02/12/2021 09:51, Dimitry Andric wrote: > Apparently the "block runtime" is supposed to provide the actual object, > so I guess you have to explicitly link to that runtime? The block runtime provides this symbol. You use this libc API, you must be compiling with a toolchain that supports blocks and must be providing the blocks symbols. If you don't use `atexit_b` or any of the other `_b` APIs then you don't need to link the blocks runtime. I am not sure why this is causing linker failures - if it's a weak symbol and it's not defined then that's entirely expected: the point of a weak symbol is that it might not be defined. This avoids the need to link libc to the blocks runtime for code that doesn't use blocks (i.e. most code that doesn't come from macOS). This code is not using `atexit_b`, but because it is using `atexit` the linker is complaining that the compilation unit containing `atexit` is referring to a symbol that isn't defined. David