From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 3162B3858D37 for ; Thu, 3 Feb 2022 11:02:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3162B3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-lj1-x230.google.com with SMTP id j14so3377162lja.3 for ; Thu, 03 Feb 2022 03:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version:content-transfer-encoding; bh=1NEcLdlEBMMxu+mP/doWudmI4QirxmMxINL1ZY6vF3c=; b=TDIIF1pe1ymm6Ky5+zcLrz7vk4gkbDvID/nRGIEVZZzNmle7W1pVczSq4gsLerafsY BnFDtysDg2bmhU4Wusb8OrBNNjDS8l/Y1vXBu7t9glOSiKk7IYiCdklVmS8QaoHgmU0A Af5GwEVd8chEwo2mcx2rVQljunX7snfGXKvpc5XRXvE/c2CpdV2k+Js1OkIISynf1884 DDvOGaKt6xoN0I8KD5KV9srL7cvy4v07JPjgENWzzNyeE+Yd+6Td7VeYqPpq4LMWpdG3 QfnnXee7Qylr5ORbyQRrAm6zovTiur+pG7gYhFeLIqOdhFqvz0kYN9s7Fz1Rur/M8Dz4 Svjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-transfer-encoding; bh=1NEcLdlEBMMxu+mP/doWudmI4QirxmMxINL1ZY6vF3c=; b=H1uoaHldGLcLh2Qc6eJ0Iw7BKdDw+hHRHmiRmavrst6GYA+CJuZy+ZHX3/crGhEHfi HXuStSGOpfhoJ5qE+A4IffY6Z2QHHIA+aoon09YVucRM2YOOwtC540C8h0q2s4txCszG AMEvv8CP9/vfMHs6V99p4vNyiOTJE5Q5NFH9+yj7YHFIUKEbZBGvJ1HVzOpcIUCPJOPU Vxj/w9WLKqKLuUIzx/3ZW8pzaWLysx9c0c0QDw/qkTjgXKpElaXfMo6ywyDfLjBD7ey7 acZBThHjGDIv7TKrYntTAUsy3EunP4iewHljLkPEk8G7JMt2bn0HuOPZHpkPRaCOkb/h q16Q== X-Gm-Message-State: AOAM531+WrnAepuDCPpJe+CqKzkxIAaqPFwAhDLKcjttf+EgehC3HuEV a0eeLNkVmEWA9kZuoVbQg7qV7g== X-Google-Smtp-Source: ABdhPJx7fJBc73mBslybrBhMtUKnYdLD3Abgg1PyuQXX4pdLYRzBWYZMbkZfLlZRK2lVJxgKst7daA== X-Received: by 2002:a2e:a236:: with SMTP id i22mr22201371ljm.313.1643886135818; Thu, 03 Feb 2022 03:02:15 -0800 (PST) Received: from [192.168.219.3] ([78.8.192.131]) by smtp.gmail.com with ESMTPSA id d19sm4121765lfn.21.2022.02.03.03.02.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Feb 2022 03:02:15 -0800 (PST) Date: Thu, 3 Feb 2022 11:02:12 +0000 (GMT) From: "Maciej W. Rozycki" To: Vladimir Mezentsev cc: "Jose E. Marchesi" , Vladimir Mezentsev via Binutils Subject: Re: [PATCH V4] gprofng: a new GNU profiler In-Reply-To: <1397fd59-7142-fc73-80f0-9893f7b07f33@oracle.com> Message-ID: References: <7dadb881-ab4b-de4a-0453-6d8661a8cd83@oracle.com> <44e0ca3c-0792-7fc2-bff4-0918f1f4bea2@redhat.com> <653282db-9261-e5fc-4280-0d00be272d81@oracle.com> <53d65dfe-38b4-7a2c-2052-b3c039642392@redhat.com> <3d87cce5-1ac6-ca35-0baa-576d599acdc7@redhat.com> <1c976060-3d2f-1050-f948-9448acb33c71@oracle.com> <87fsp9jli4.fsf@oracle.com> <877dadw7r7.fsf@oracle.com> <1397fd59-7142-fc73-80f0-9893f7b07f33@oracle.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2022 11:02:22 -0000 On Wed, 2 Feb 2022, Vladimir Mezentsev wrote: > > > > Woudn't it be better to skip building gprofng in case no --enable-shared > > > > is specified at `configure' time? > > > Is it actually necessary to require `--enable-shared' in the first place > > > for the program to work? > > I think so. AFAIK the gprofng collector works as an interposed shared > > object. > > yes. > We use the gprofng library in LD_PRELOAD. This library should be a shared > library. > > > I am trying to set  extra_configure_flags='--enable-shared' for gprofng build > only. > But gprofng depens on libopcodes and this library should build with -fPIC. > I haven't yet found how to solve this build issue. Forcing `--enable-shared' in gprofng/ unconditionally could be confusing to the user who might want to avoid shared libraries for a reason. I think perhaps the best solution would be using AC_ENABLE_SHARED in gprofng/ or the equivalent LT_INIT option (I think it's the default anyway) and bail out with a suitable message such as: "Building in gprofng is unsupported with shared libraries disabled. Please reconfigure with `--enable-shared=gprofng' or `--disable-gprofng'." or suchlike. Then in libopcodes/ you probably want the `pic-only' option to LT_INIT (or use `--with-pic') unless `--enable-shared' has been also used for the library, though I think it would best be conditionalised on gprofng having been enabled if possible as there's a performance hit from using PIC code. As there's a `--without-pic' option too the user can give this all may have to be coordinated at the top level rather than within gprofng/. Perhaps the way how `extra_host_libiberty_configure_flags' are handled could serve as an example (though I think it should also use `--with-pic' rather than `--enable-shared' unless `--enable-shared' has been explicitly given already). I realise what I have outlined is not a complete solution, but I hope it can help regardless. Maciej