From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by sourceware.org (Postfix) with ESMTPS id 77974385771A for ; Thu, 15 Jun 2023 19:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77974385771A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=anselmschueler.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=anselmschueler.com Received: from [192.168.146.195] ([89.204.137.153]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1M2etD-1q7x2q1MmV-004Dw0 for ; Thu, 15 Jun 2023 21:59:07 +0200 Date: Thu, 15 Jun 2023 21:59:01 +0200 From: Anselm =?iso-8859-1?q?Sch=FCler?= Subject: Interfacing with external code using libgccjit To: jit@gcc.gnu.org Message-Id: X-Mailer: geary/43.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-j/+joIpHZ4sS3MiNCdri" X-Provags-ID: V03:K1:RlBUoSzsOsrqifGbMJGpmFuP3TSFGxM7xP5DWXGWCcSDzjoZ2TQ 8verTxWSgz4G4bn6JZ7JaJyOZ5V+qq5TPRcA4nM2A6jPYYGO/f3w8hrTtecPxAsgH9YFNKD 1iD2rKaeD/MMhR+JhK3D+PVNl8Gc/LabzoguhrNXaMZVpzx1vKx9siMrukhOJqVCvdb/YSb 32r8wXtgeieaackTgacDw== UI-OutboundReport: notjunk:1;M01:P0:or5uSR6ynOM=;cEn22G36IN6B6nflTeAkyv4Mqg/ sMuDV7G2PA1l5wpWquyBcsOebSB4vZQmYceHg9TNXAEMZnNNAmMJy0ba1WVC7yzkwGZcSAXMi 5kqdtNbAZ/2luLYrXl19L0uJHgYjf7CI58nl7INGeBwhpYnBNUlObJVmQ14P0AOm9NA/drhNb IC6q10rSxu4aXq0TAPi0SxPAEnhEMdjObtiievc3uTrAEWl4G4/vQATt4+3l1v2t51ZRShR6l dyYAhc2wGSARC05Lgl8UtU/odw0PIiA+hyKTviLv+hPejng9gRE1r0C0cs49F8YAkrGLtmMuE qVfAq+m/57ab6/kfg6YH2bZF8ZHrKAP6N7uH4SNSbHZmDD+ouzEiIjhop5WPCciVaq52QImM7 Z4vb/W+FVT84qM6AflDXxOxCb83s8hK4bCD3XyfXS4oWkFa6P4b7EYLPGRKHfiqEMpaqBWXwZ K8wz5aEl6ppaoK3uin6UhgX9iZVgFziLH/CpvZzG/75BzUnxmfBprp3Y/q0NZ3B/hZo6O7+4N af4L0kg5OQG3kfSf1HwsvE0669XjZL1JHm9hbgKMQBgyl2f0UZyPSHRCXGOMt9FvT4byNFxCv P9kwlTMGIIx71GzXSac8njTWqs5Pw8Wc47XropOs2VRRs2VfqKL8/tOU2VdqzgPPX/xZjHgOE OMIQq52b/m5brBvOQlY1BL/EjUxQpu33Ndr3vgIiLA== X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_00,HTML_MESSAGE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-j/+joIpHZ4sS3MiNCdri Content-Type: text/plain; charset=iso-8859-13; format=flowed Content-Transfer-Encoding: quoted-printable Hi, I=FFm very new to libgccjit and was hoping to use it to implement a=20 DSL that abstracts over some high-precision mathematics. However, to do that, I need to interface with a high-precision library=20 such as GMP or MPFR. I=FFm wondering if that=FFs possible. Can I use=20 gcc_jit_context_new_function with GCC_JIT_FUNCTION_IMPORTED to define=20 such functions from e.g. MPFR? If so, is the function retrieved from=20 the binary itself or does it need to be installed on the target=20 machine? Do I need to pass -lmpfr to libgccjit or does it suffice to=20 use it during the compilation of the host program? Additionally, it seems to be necessary to redefine all the types=20 defined by the library in order to be able to pass and receive them. Is=20 there some facility for automating this? It seems rather laborious. --=-j/+joIpHZ4sS3MiNCdri--