From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fis Trivial Subject: How to make a working ld in guix pure environment? Date: Thu, 24 May 2018 18:14:07 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLukh-0006HJ-JK for help-guix@gnu.org; Thu, 24 May 2018 14:14:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLukd-0003td-Cg for help-guix@gnu.org; Thu, 24 May 2018 14:14:15 -0400 Received: from mail-oln040092001013.outbound.protection.outlook.com ([40.92.1.13]:36064 helo=NAM01-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLukd-0003tC-1Z for help-guix@gnu.org; Thu, 24 May 2018 14:14:11 -0400 Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix Hi, I'm working to get OpenCL into guix. In the OpenCL world, source code for devices (such as GPU or FPGA or just CPU) is shipped as string and embeded in the binary object, then latter compiled by OpenCL implementation at runtime. So, a correct linker at runtime is necessary for runing OpenCL program, but I don't know how to achieve it. I tried to use ld in guix pure environment, tested with bintuils, gcc-toolchain, ld-wrapper, and none of them work. Take the following trivial snippy (not opencl related) as an example: // main.c #include int main() { log1p(32); } To build it, one would do something similar to `ld -lm main.o` after compilation. But I got an error saying "ld: cannot find -lm". I have a little chat with @lfam at IRC (thanks:) ). In order to clear one of the confusions, please know that ld needed to be used standalone, not with gcc-toolchain, since it's needed at target program runtime. Please give me some advices about making a correct ld. Thanks in advance.