Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhPML-0006fM-4P for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Nov 2021 04:55:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mhPMK-0007CK-0y for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Nov 2021 04:55:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhPMJ-000750-OX for pgsql-hackers@lists.postgresql.org; Mon, 01 Nov 2021 04:55:47 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mhPME-0007g9-UM for pgsql-hackers@postgresql.org; Mon, 01 Nov 2021 04:55:46 +0000 Received: by mail-wr1-x430.google.com with SMTP id d5so11103958wrc.1 for ; Sun, 31 Oct 2021 21:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=qRObyd2jevd6OrsKrcemgfXmZVhqJQGzIlX2MogekOM=; b=mqWyqqR5NAJ9t2Lyq7OYc/rigR6Iv5EzTZSZmQW24KSXf3Kn0O1KmQB7r+XplKBf3a KzwWNbwGUtA4zs2Dnbwic2hiekjcYDVA1b9n7kZ8i72YEm/HbKzUk1mHPV+Z2yQpd1Tc wcb3boo1WpfxfL6+El09E8iglKJJAdFi9qekLM5k+CvVtmiK/EuHwLYBgA04MuOF+yy/ aHyBbiKhfyCdcdO4tCnzmIpSqN6zg4NFgYXSXiQvAp9MKdQ7+C1NIOE6aIYKyllZdtEL tnL6zUvLFtvAgBOjV//8funElTxM7FruUEhROlPvyf8lGvHh4QbIcwJ20Y+AYtiS2J2i 89XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=qRObyd2jevd6OrsKrcemgfXmZVhqJQGzIlX2MogekOM=; b=ubsdSN3IGqxQz0drni+0ywq3papoLyKQWia4SJYSlL03x4cF9+HYxBDldkT862zFae p7PUHKxt3Sc+mWjovjCMcJ55YSTjz/Io5R6qY1DhTxBaoYyOnrDAMWsqRYcauR2MgoSQ 12hqa3MN09PVfVeW7HxPeQq+RQ43knjcRMLefzJ58fAHg/FA1z/xb5rQDLMPje5RfHSc XY8/r6bqOxYjBts0380hafIy22rwaojen9VJ4l93AK7HPFKZ5vUG8lSlRygl4cFGAn8p 0Zmi0Sil9bibdrkOZtiFvjGSEMDwEPc4riLXRTon6zUImubCvGLDjjkV73W+meHwXIWS 3U/Q== X-Gm-Message-State: AOAM532iW7Z9QhJHD/AXpWi+eXsT8Q9xSlyQSVgHMpSKOLPj+hqH+aAz NMz+xjVf/MzqDMVPX3trRV30+KBhjAf/ZQ== X-Google-Smtp-Source: ABdhPJy7lA9CCvH8vUuu2woVEoV8fjuZAk85t2B41sIQ3sZvomeMaFvwF0WzD9Ik+8GlLjJSGTFX2A== X-Received: by 2002:a5d:64ee:: with SMTP id g14mr35156257wri.376.1635742541181; Sun, 31 Oct 2021 21:55:41 -0700 (PDT) Received: from localhost.localdomain (62-47-151-123.adsl.highway.telekom.at. [62.47.151.123]) by smtp.gmail.com with ESMTPSA id h17sm11425960wrp.34.2021.10.31.21.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Oct 2021 21:55:40 -0700 (PDT) Message-ID: Subject: Re: Use -fvisibility=hidden for shared libraries From: Laurenz Albe To: Andres Freund , pgsql-hackers@postgresql.org Date: Mon, 01 Nov 2021 05:55:40 +0100 In-Reply-To: <20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de> References: <20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2021-10-31 at 19:03 -0700, Andres Freund wrote: > Currently postgres builds extension shared libraries (i.e. pretty much > everything but libpq) with global visibilty. I.e. symbols that are not > static will be visible from outside the shared library. > > On the one platform where that behaviour is not available, namely > windows, we emulate it by analyzing the input files to the shared > library and exporting all the symbols therein. > > For the meson build [1] proposal that turned out to be a bit more > verbose to implement than I'd liked. Thinking about the problem I > realized that, at least I think so, there's really no good reason to > force-export symbols in our shared libraries: > > Because the number of symbols required from shared libraries is > typically small, and the majority of the symbols are generated via > PG_FUNCTION_INFO_V1, it isn't a lot of work to explicitly export the > necessary symbols. That sounds like a good idea. I see that at least clang and gcc support this flag. Could the reduced number of exported functions be a problem, if someone relies on some function being exported? It may not be worth worrying about, and they can always come and make a case for that symbol to be exported. Yours, Laurenz Albe