X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66C22385EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1609553623; bh=pCvb1wdMC5+tqs6Ez4reoNSTaz+YcvTUL7ZD4QKwccg=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JHsh3EC68n4ZPPvEI7AYJjCPwyxKR5qjuKMYOHyljNTuR2IzPClL9Kc3e2L9EQ1Id DKWfbWcz3rv4ZULm6L51gC8TX4mHoo/Xe3kntRCS/k+3gyBzi5PIwegj5loQwkC5ek YsnK792mG6vp5gC8Bqeq5fFeUaL5393vjRO66Uls= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B92773858D29 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:in-reply-to:references :message-id:mime-version:content-transfer-encoding; bh=r7RQC8D1KhB+taZX9beEqFKvCL5EZsIyX1eKTw4QuK0=; b=A5O5WRBIASHEhCWK4t9QFziz61t6GBp65cPNBtzJgmhchJXPiIUhQMGfxa5yfE3huC ihAlBN/mfztKkT2fkl0r9DjNoaYD0VGPodp47H+VHsjETTJbu0p8e+tgbzrBf6NG9lze 11sRXzxNJu24+cs+WPb1Iz5LwJi4xYo1obz5CuOt+lGnY7cLA7dRlfo0v0eMfmad5qeW S4nmYoNIY4xcC3TmlB+A0rgSqbWzyU2C3q81H7mRY0ckLWoFLJqUdhoR8QjDrp6Ws41Y abYhAY5a2WiKLsv5pnMDWxu8Wy2KYqBirytzEW5X4kutEbVdQk13q9jXgBNjCFpJ4Y6/ r+mQ== X-Gm-Message-State: AOAM530cwKDf3XBU+c0yR3zU0SdmKYX1mtRysg+dp+bdw8mCbqqAbXBM +OhN898EpLb1uOPKBq8C5JQwyjesyOY= X-Google-Smtp-Source: ABdhPJwL46Fr/TH922Mvq3ZKR/sC8RQRMmyenbgpt3fQMJEYpmfIYN1ObtzL65GnsSdJsWFpQ40ejQ== X-Received: by 2002:a63:4451:: with SMTP id t17mr57553944pgk.322.1609553619611; Fri, 01 Jan 2021 18:13:39 -0800 (PST) Date: Sat, 02 Jan 2021 11:13:38 +0900 To: cygwin AT cygwin DOT com Subject: Re: python header puzzle In-Reply-To: <20210102073001.D611.50F79699@gmail.com> References: <3c67977a-f7d6-c7bd-2397-b33ed4fba049 AT gmail DOT com> <20210102073001 DOT D611 DOT 50F79699 AT gmail DOT com> Message-Id: <20210102110605.007E.50F79699@gmail.com> MIME-Version: 1.0 X-Mailer: Becky! ver. 2.75.01 [ja] X-Antivirus: Avast (VPS 210101-0, 2021/01/01), Outbound message X-Antivirus-Status: Clean X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lemures Lemniscati via Cygwin Reply-To: Lemures Lemniscati Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" On Sat, 02 Jan 2021 07:30:05 +0900, Lemures Lemniscati > On Fri, 1 Jan 2021 19:33:03 +0100, Marco Atzeri via Cygwin > > Hi All, > > > > trying to build postgresql 12.X with python3 interface, I hit an > > interesting issue > > > > all headers > > /usr/include/python{3.6-3.8}/pyport.h > > > > are including > > > > # if defined(__CYGWIN__) > > # define PyMODINIT_FUNC __declspec(dllexport) PyObject* > > # else /* __CYGWIN__ */ > > # define PyMODINIT_FUNC PyObject* > > # endif /* __CYGWIN__ */ > > > > and the postgresql python 3 interface has in the code and the header > > src/pl/plpython/plpy_plpymodule.{h,c} > > > > the following lines: > > > > PyMODINIT_FUNC PyInit_plpy(void); > > > > PyMODINIT_FUNC PyInit_plpy(void)... > > > > Unfortunately the shared lib produced is crippled and does not > > export correctly the symbols. > > > > Changing the lines in > > > > extern PyObject* PyInit_plpy(void); > > > > PyObject* PyInit_plpy(void).. > > > > solves the problem and pass all tests. > > > > At first glance the Python headers seem the wrong one; the postgresql > > code has no special CYGWIN handling in that point, just the note > > > > * Must have external linkage, because PyMODINIT_FUNC does dllexport on > > * Windows-like platforms. > > > > Comments ? > > Any one seeing similar issue with Python3 code ? > > > > For what I see the usage of PyMODINIT_FUNC is very limited > > only python-cffi and python-lxml seem to use it in their headers > > > How about like this, though it should need more refinements. > > A cygport file is attached, or placed at > https://github.com/cygwin-lem/cygwin-pkg/tree/w_postgresql-12.5-1/postgresql > I'm sorry. I was wrong. Regards, Lem -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple