From patchwork Mon Jan 2 11:39:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 62542 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D6213858C39 for ; Mon, 2 Jan 2023 11:39:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D6213858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672659595; bh=MI1t28X8zToGT7laDqhtADRq9mY+Zk79dGOwO1AWVww=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qjDIlxwkBxmRvuNkNWCahax6SnxL+GoSLusV9qwTVvxoTLWwYqLMphmkbCHXw4qKN jD2hhkMcyAwzWa2Zq62b9+91b7SExyBX2fGG+BCxrgPxSnP/0j3OZCkwsdqkIRALmA /X2khOaa2fQCTHGu4I4gFOzCLXRGLtyrDpYDz+5M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 223563858D32 for ; Mon, 2 Jan 2023 11:39:25 +0000 (GMT) Received: by mail-wr1-x429.google.com with SMTP id j17so20710374wrr.7 for ; Mon, 02 Jan 2023 03:39:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MI1t28X8zToGT7laDqhtADRq9mY+Zk79dGOwO1AWVww=; b=678Lv+fjU233UaI6G/J93T3jyr75tcd4i0uurJd2B4C32SJrQA0bD3ezEE7aE0RJ5a /P/VKsNqNjazIAxlqrMiUOdeukY7orNEM4l4E5tOwkq0jL1NZbxo58Fg8FmV5uiKkoH3 kxJks+Eih+RNrJP/yvCwHbJE3VxjCSVMNchvq3m5dz24YWRvShuCFor0LaD6rdEfc7hM b88XDDyLccxJvebJqTbOOb+ztTMc/V892kYwpSXTaoMMmZQv044NCIxwJdT0Tzgdeh08 9IJ8a8bv8N9KKy716H/28SDeFExMB8Tbs6w32sGo7OT2BcQZu0vdgA4QujmM5K1/RHUL 0fCQ== X-Gm-Message-State: AFqh2koH2C2To2yuEA5hTOeQEWWzOTLaRp6/zbiALj90GRmvb5ITGtnq is2ghaxLkTgIIEiiO9CC+SJIn4xoMGQ= X-Google-Smtp-Source: AMrXdXtFwf9pAkRHFfI1W5wUH7c4ViYCW+udEeGBeSYG/EOdnev0UY5/BMSHogzUVrQixQ5IuIYkMA== X-Received: by 2002:a5d:438e:0:b0:241:94bc:26d3 with SMTP id i14-20020a5d438e000000b0024194bc26d3mr29038743wrq.49.1672659563792; Mon, 02 Jan 2023 03:39:23 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id f14-20020a5d664e000000b0027f4a7efc54sm19815342wrw.15.2023.01.02.03.39.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 02 Jan 2023 03:39:23 -0800 (PST) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [PATCH] modula-2: Module registration constructors need to be visible [PR108259]. Date: Mon, 2 Jan 2023 11:39:22 +0000 Message-Id: <20230102113922.5458-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe , gaiusmod2@gmail.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Tested on x86_64-linux-gnu, x86_64,aarch64-darwin21. There remain issues with shared libraries, but the link fails are fixed by this. OK for master? Thanks Iain --- 8< --- In the current design the main executable links explicitly to the module registration construtors that it uses. This means that they must be visible in shared libraries. PR modula2/108259 gcc/m2/ChangeLog: * gm2-gcc/m2decl.cc (m2decl_DeclareModuleCtor): Make module registration constructors visible. --- gcc/m2/gm2-gcc/m2decl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/m2/gm2-gcc/m2decl.cc b/gcc/m2/gm2-gcc/m2decl.cc index 62bfefd2530..d849f8aefc4 100644 --- a/gcc/m2/gm2-gcc/m2decl.cc +++ b/gcc/m2/gm2-gcc/m2decl.cc @@ -276,7 +276,7 @@ m2decl_DeclareModuleCtor (tree decl) /* Declare module_ctor (). */ TREE_PUBLIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; - DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; DECL_VISIBILITY_SPECIFIED (decl) = 1; DECL_STATIC_CONSTRUCTOR (decl) = 1; return decl;