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 1kAnhD-0003qn-52 for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 05:10:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAngf-0002Kv-HV for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 05:09:29 +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 1kAngf-0002Ko-1s for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 05:09:29 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAngY-0004iW-5W for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 05:09:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+IicRl7L4g3ppT8jCyNtj7k0PDU7f6Ct7ahV5dviTis=; b=KLD8J5yxvLGkRIKRFsIilH4ypS PKA6eZDV01ziKuUqSd9AckWPdWtdvmmsKeQEPwfZpsNDrpsqP1poyBwTFNBvYlmqAss+2gfXY5fHw pAAg8yBIhlqlTaQp4UfoyOKqEb4TxFl4ByvfFAxJva49CqXgl/jTTnXTZ7wsqi6Z1a2d78irwZvzF eyAcd/TUMWRWJg4QQv2pEkHH5J7vg5oqT2psATrSdawYO38XSonH5bHan4LHP1WR6IHuheJ6jg5LG AN2y5Xydu170VO+v3TRUp8p+1Ogr3MBZ0svXMLibHsDDW0LuDrz/RfbD89BXnoOW/o2yWmdjd1yKF dZf/mGqQ==; Received: from [184.19.31.139] (port=50218) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kAngV-00FrpC-TV; Wed, 26 Aug 2020 01:09:20 -0400 Subject: Re: the ScriptingMojo To: Kartik Ohri References: <5F3A7DC6.8090905@anastigmatix.net> <5F3D32E9.80504@anastigmatix.net> <5F3D36BE.70703@anastigmatix.net> <5F3D38F8.7050907@anastigmatix.net> <5F3D3A75.5010304@anastigmatix.net> <5F3D3D2E.4070109@anastigmatix.net> <5F3D43BD.4020900@anastigmatix.net> <5F3DA48D.7090408@anastigmatix.net> <5F41943D.9080707@anastigmatix.net> <5F427604.5010103@anastigmatix.net> <5F42A71F.8000002@anastigmatix.net> <5F459B6E.3020803@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F45EE7F.5020609@anastigmatix.net> Date: Wed, 26 Aug 2020 01:09:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/26/20 00:44, Kartik Ohri wrote: > Also, I had another question: is there any particular reason that compiling > and linking should > be two different commands. To me it appears to be another one of nar maven > quirks. > Compilers by default compile and link in a single step. It seems nar maven > overrides it due to > reason. Since, there is no configuration to suggest that this is desired I > am a bit confused. > Do we want to compile and link in different steps ? Yes ... because not only is it done by the nar-maven-plugin (which is not what we want to imitate), it is also done that way by the PGXS makefiles (which are what we want to imitate). In fact it has been the usual practice for about as long as there have been makefiles. One reason is that compiling C programs is a kind of local activity. Each .c file is transformed into a .o file, without needing to know very much about the others. (What little it does need to know, it gets from .h files.) Conceptually, it's a different operation once you have all of those .o files and you want to edit and link all of them together into some kind of binary image with the references resolved. On top of that, there are choices in what kind of result to produce. A standalone executable? A static library? A dynamic library? A loadable plugin? (The Mac OS linker really makes a distinction between a regular dynamic library and a plugin. The unresolved references in a dynamic library have to be findable in the other libraries given as its dependencies. For a plugin, the assumption is they will be findable in the program that the plugin gets loaded into. The Mac linker actually checks that at link time, which is why there is a -bundle_loader option added in the Mac OS profile in pljava-so.) Even when you can just pile all the compiling and linking options onto one gcc command line, that still is just the gcc wrapper command being clever and sorting the options out and running the preprocessor and compiler and then the linker. But for clarity in makefiles, it is very common to separate the rules for compiling the components from the rules for linking the final product. Regards, -Chap